Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data from ASP to PDF

Status
Not open for further replies.

chrissypchy

Programmer
Jun 23, 2003
40
0
0
US
Hello All,
I have this web page where the user fills out their name in a text field and then presses the "submit" button to send the data. I was wondering if anyone knew how to generate a PDF file with the user's name that they just submitted included in it (A Dynamic PDF). Anyone's help would be greatly appreciated.
-Chrissy
 
here how I've done it in the past using

<%
sql1 = &quot;SELECT My_folders.folder, My_folders.username, My_folders.password, My_request.client FROM My_request INNER JOIN My_folders ON My_request.ids = My_folders.ids where My_folders.ids = &quot; & request(&quot;ids&quot;)
Dim oRSNew
Set oRSNew = Server.CreateObject(&quot;ADODB.Recordset&quot;)
oRSNew.open sql1, &quot;dsn=MyDSN;uid=MyID;pwd=MyPSSWD&quot;

response.buffer = True
response.expires = 0

'create and populate the PDF File =======================================================================
Set APToolkit = Server.CreateObject(&quot;APToolkit.Object&quot;)
APToolkit.OutputPageWidth=612
APToolkit.OutputPageHeight=792
Y = APToolkit.OpenOutputFile(&quot;MEMORY&quot;)

'Set field values to equal your variables
vara = &quot;Company FTP Site instructions for &quot; & ORSNew(&quot;Client&quot;)
varb1 = &quot;Open your FTP Software & follow directions of your software to connect to ftp://xx.xxx.xx.xxx. &quot;
varb2 = &quot;You may need to enter JUST the IP address depending your FTP Software. &quot;
varb3 = &quot;Your Account Representative will call you with the username and password.&quot;
varb4 = &quot;Leave initial remote directory as default or leave blank.&quot;
varb5 = &quot;Upload, Download, or delete as necessary.&quot;
varb6 = &quot;After the file completes transfer, please email your account representative&quot;
varb7 = &quot;to confirm integrity of the file transfer (typically the byte count of the file).&quot;

varc = &quot;If using browser (such as Internet Explorer)&quot;
varc1 = &quot;Type the following URL in the address bar: FTP://username@xx.xxx.xx.xxx &quot;
varc2 = &quot; Press the Enter key.&quot;
varc3 = &quot; Enter the username & password as prompted.&quot;
varc4 = &quot; Drag files into the open browser window.&quot;
varc5 = &quot; After the file completes transfer, please email your account representative&quot;
varc6 = &quot;to confirm integrity of the file transfer (typically the byte count of the file).&quot;

vard = &quot;If you need assistance, please e-mail ME@company.com or call (xxx) xxx-xxxx.&quot;

APToolkit.SetFont &quot;Times-Roman&quot;,18
APToolkit.LineWidth(1)
'=========================================Header Section======================
'APToolkit.PrintText 36,548,reqTitleLine

APToolkit.PrintText 36,720,vara
APToolkit.SetFont &quot;Times-Roman&quot;,12

APToolkit.PrintText 36,660,varb1
APToolkit.PrintText 36,640,varb2
APToolkit.PrintText 36,620,varb3
APToolkit.PrintText 36,600,varb4
APToolkit.PrintText 36,580,varb5
APToolkit.PrintText 36,560,varb6
APToolkit.PrintText 36,540,varb6
APToolkit.SetFont &quot;Times-Roman&quot;,18
APToolkit.PrintText 36,500,varc
APToolkit.SetFont &quot;Times-Roman&quot;,12
APToolkit.PrintText 36,480,varc1
APToolkit.PrintText 36,460,varc2
APToolkit.PrintText 36,440,varc3
APToolkit.PrintText 36,420,varc4
APToolkit.PrintText 36,400,varc5
APToolkit.PrintText 36,380,varc6

APToolkit.PrintText 36,320,vard

'=======================================Print Out Section ====================
Y = APToolkit.CloseOutputFile()
zz = APToolkit.BinaryImage
response.expires = 0
response.clear
response.ContentType=&quot;application/pdf&quot;
response.AddHeader&quot;Content-Type&quot;,&quot;application/pdf&quot;
response.AddHeader&quot;Content-Disposition&quot;,&quot;inline;filename=ftppages.pdf&quot;
response.BinaryWrite zz
response.End
set APToolkit = nothing
%>


pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top