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 - Retrieve pdf from db column and stream to browser
  FAQ FAQ  Forum Search   Register Register  Login Login

Retrieve pdf from db column and stream to browser

 Post Reply Post Reply
Author
Message
tallen14218 View Drop Down
Beginner
Beginner


Joined: 25 Jan 06
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote tallen14218 Quote  Post ReplyReply Direct Link To This Post Topic: Retrieve pdf from db column and stream to browser
    Posted: 21 Apr 09 at 5:47PM
Hi folks,
 
I was wondering if anyone has been able to do something like this before. I have an ASP page that retrieves a PDF from a SQL Server table (stored in an image column). I can Response.BinaryWrite that to the browser, but I need to be able to add a logo to the PDF before I stream it to the browser.
 
My thought was to read the PDF into a memory variable and then use the LoadFromString or LoadFromVariant functions to get the PDF into an object, and then add the logo and then output the modified PDF.
 
However, I can't seem to get the binary PDF data from the database loaded using either function. What am I missing?
 
Code sample:
 
sContent = rsPDF.Fields("Contents")
nRC = pdf.LoadFromString(sContent, Len(sContent))
pdf.DrawText 1, 1, nRC
Response.BinaryWrite pdf.SaveToVariant()
Thanks,
 
Tom
 
Tom
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: 22 Apr 09 at 2:30AM
Hi Tom!

DrawText is for the visible textcontent of a pdf-document - not for the unvisible code behind a pdf-document.
LoadFromString needs the complete code of your future pdf-document you want to create or examine.

So the question is what's in your variable "sContent"?
Is there something beginning with "%PDF-1. ..."? It should be 'cause this are the first bytes of each pdf-file.

If you want to create a new pdf with sContent you should use pdf.SaveToFile (that's the complete code) instead of pdf.DrawText (that's only the text).

Cheers and good luck!
Ingo

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