Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Load PDF from blog field in SQL Server 2008

Question

I have stored a pdf file in a blob field in SQL Server 2008 table. How I can load this file using the quick PDF Library DLL edition. I have tried to use the QuickPDFLoadFromFile or QuickPDFLoadFromString but I cannot.

Answer

The following functions should be of assistance to you:

char * QuickPDFCreateBuffer(int InstanceID, int BufferLength)
int QuickPDFAddToBuffer(int InstanceID, char * Buffer, char * Source, int SourceLength)
int QuickPDFLoadFromString(int InstanceID, char * Source)
int QuickPDFReleaseBuffer(int InstanceID, char * Buffer)

Here are the steps to follow:

  1. Read the PDF data from the database into a block of memory.
  2. Call QuickPDFCreateBuffer to ask Quick PDF Library to make an internal buffer the same size as the data you read from the database. The function will return a 32-bit pointer to the start of the buffer.
  3. Call QuickPDFAddToBuffer to add the data from the database into the Quick PDF Library buffer.
  4. Call QuickPDFLoadFromString, passing it the pointer you got from step 2, to load the PDF.
  5. Call QuickPDFReleaseBuffer to release the memory.

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum