Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Create PDF on fly in Asp.Net
  FAQ FAQ  Forum Search   Register Register  Login Login

Create PDF on fly in Asp.Net

 Post Reply Post Reply
Author
Message
prashant.mala View Drop Down
Beginner
Beginner


Joined: 16 Oct 07
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant.mala Quote  Post ReplyReply Direct Link To This Post Topic: Create PDF on fly in Asp.Net
    Posted: 16 Oct 07 at 7:44AM
Hi All,
How to create PDF on fly in asp.net using QuickPDF..??
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 17 Oct 07 at 5:16AM
Hi!

Here's an example from the iSED-knowledgebase.
I'll insert the complete knowledgebase with Michel here soon.

Best regards,
Ingo

Knowledge Base

Streaming the PDF document directly to the browser in ASP

The SaveToVariant function returns a byte array which can be sent directly to the browser. This method means that you do not need to create a physical file for your users to download, the file can be sent directly to the user's browser.

Setup iSEDQuickPDF according to the previous tutorial.

Now write an ASP script to generate your PDF document, and stream it to the browser:
<%
 Dim QP
 Set QP = Server.CreateObject("iSED.QuickPDF")
 Call QP.UnlockKey("type your license key here")
 Call QP.DrawText(100, 500, "ASP stream to browser test")
 Call QP.CompressContent()
 Response.ContentType = "application/pdf"
 Response.AddHeader "Content-disposition", _
   "attachment; filename=test.pdf"
 Response.BinaryWrite QP.SaveToVariant()
 Response.End
 Set QP = Nothing
%>

The following line compresses the PDF document, this results in a faster download of the document. The CompressContent function should obviously be called before the SaveToVariant function.
Call QP.CompressContent()

Now the HTTP headers are set up to tell the browser that the information is a PDF document:
Response.ContentType = "application/pdf"
Response.AddHeader "Content-disposition", _
 "attachment; filename=test.pdf"

Finally, the binary PDF data is generated using the SaveToVariant function, and the resulting byte stream is sent to the browser.
Response.BinaryWrite QP.SaveToVariant()
Response.End


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store