Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I generate a PDF document “on-the-fly” directly in users browser window?

0
Posted

How can I generate a PDF document “on-the-fly” directly in users browser window?

0

The technique is quite simple: 1. Create a PDF Creator Pilot object and initialize it: Set PDF = CreateObject(“PDFCreatorPilot.PDFDocument4”) PDF.SetLicenseData “demo”, “demo” 2. Fill the PDF document with text, graphics etc. PDF.ShowTextAt 40, 40, “Hello.” 3. Use the “response” ASP object to stream the document to the browser directly, or write the data into the output “response” object. A byte array is required. Use the GetBuffer method of PDF Creator Pilot to get the generated PDF document as a byte array. 4. Use the following code: Response.Clear Response.ContentType = “application/pdf” Response.AddHeader “Content-Type”, “application/pdf” Response.AddHeader “Content-Disposition”, “inline;filename=test.pdf” Response.AddHeader “Content-Length”, PDF.GetBufferSize Response.BinaryWrite PDF.GetBuffer Response.End As a result, the user will see your PDF document in the browser window. You can find an example for ASP that will generate a simple PDF document and output it via browser: see V

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.