Professional Documents
Culture Documents
It provides a comprehensive set of functions that allow you to create, render, print split, merge,
encrypt, modify and manipulate PDF form fields. It also provides advanced support for JavaScript.
Images can be added in BMP, TIFF, JPEG, PNG and EMF format. TrueType and Type1 fonts can be
embedded, and TrueType fonts can be subsetted allowing Unicode text to be drawn.
Quick PDF Library also includes a full built-in PDF rasterizer allowing PDFs to be rendered to the
screen or printer.
This developer guide is intended to provide you with the information you require to integrate Quick
PDF Library with your application.
What is required?
You will need a computer of adequate speed. Quick PDF Library can be used by any Windows-based
machine in any compiler which supports Delphi, ActiveX, or DLLs.
Desktop
Windows 2000 Professional
Windows XP (32-bit)
Windows Vista (32-bit)
Windows 7 (32-bit)
Server
Windows Server 2000
Windows Server 2003 (32-bit)
Windows Server 2008 (32-bit)
64-bit
Compatible within 64-bit environment if the project is target to an x86 CPU. This requires targeting
the Visual Studio solution configuration for x86 deployment, and then modifying the .NET project
build configuration to target the x86 platform.
You can use Quick PDF Library within a 64-bit application by use of our TCP/IP bridge service
however; the library itself will still be operating as a 32-bit application.
We estimate a native 64-bit build to be complete mid-2010 in conjunction with the release of
Embarcadero -bit Delphi compiler.
Support
Every purchase of Quick PDF Library comes with 14 days free email technical support from the day
you register your copy, in addition to free access to standard support facilities (online help,
knowledge base, FAQs, code samples and the Quick PDF Library forums).
Premium support, which includes fast response times and priority bug fixes, as well as upgrade
insurance, is also available. To enquire about purchasing Premium Support, contact our sales team.
About Debenu
Debenu is one of the world's leading SOHO Document Management and PDF software vendors and
the company behind Quick PDF Library.
Headquartered in Melbourne, Australia, Debenu has grown both organically and through
acquisitions since it was founded in 2007 by Karl De Abrew, the founder and former CEO of Nitro
PDF Software, and Rowan Hanna.
Quick PDF Library is a key element of Debenu's Document Management suite which includes
Benubird Pro, Quick PDF Library, and Quick PDF Tools.
Debenu is also responsible for two industry leading blogs, 4x PDF Blog and Digital Documents, both
which target the world of electronic documents.
Legal note
The full end user license agreement for Quick PDF Library can be read online at
http://www.quickpdflibrary.com/products/quickpdf/license.php, but to give you a rough idea of
how you can and can't use Quick PDF Library, here are a few key points:
Per developer. Licenses for Quick PDF Library are sold on a per developer basis.
Royalty free. You can use Quick PDF Library in your applications without needing to pay any
royalty fees for distribution.
No limits on number of applicaons . We sell licenses based on the number of your
developers who will be using the library, not the number of applications your company
intends to build using the library.
Servers. Your license also covers use of the software on any server with the small provision
that access to Quick PDF Library by third parties must be via your own software.
No reselling. You are not allowed to resell Quick PDF Library or your license key, but you can
embed the software in your application, or distribute it with your system.
Compiled applicaons onl y. You are not permitted to create your own PDF software
libraries using Quick PDF Library.
Comprehensive Feature List
Quick PDF Library is a powerful PDF SDK offering a comprehensive range of PDF functionality.
PDF Creaon
PDF Conversion
PDF to image rasterization BMP, JPEG, WMF, EMF, EPS, PNG and GIF)
PDF Prinng
Printing options (Page Scaling, Auto Rotate Center, Title, Page Range and Copies)
Create custom printers (page size, copies, quality, color, duplex, collate, etc)
PDF Security
Form field support for text, pushbutton, checkboxes, radio buttons, choice, and signature
PDF JavaScript
Extract text from a document (font, color, size and position of each piece of text)
PDF Color
RGB/CMYK/Gray color modes
Fonts
Standard fonts
Subsetted fonts
TrueType fonts
Type1 fonts
Full support for graphics state (load state and save state)
Clipping regions
PDF Compression
Compress fonts
Compress images
Compress content
Insert pages, append pages, move pages, reorder pages, clone pages and rotate pages
Crop pages, split pages, delete pages, hide pages and extract pages
Split the text and graphics on the current page into two layers
Document properties (filename, title, author, subject, keywords, pdf producer, pdf version, etc)
Security information
Get/Set Origin
GeoPDF support
Barcodes
Images
Compress images
Page layout
Get page dimensions, page size and page content (text, images, objects)
Direct Access
Direct access functionality can be used with large PDFs.Operations are carried out on the file on the
disk, instead of loading the file into memory.
Misc
Replace the path in the above command with the folder you chose in step 1.
On Vista you need to open a command prompt with administrator privileges in order to run the
command.
Class name
The class name of this release of Quick PDF Library ActiveX Edition is:
QuickPDFAX0715.PDFLibrary
The first function you should call is the UnlockKey function, passing it your license key.
When you are finished with the library, call QuickPDFReleaseLibrary to release all allocated memory.
int InstanceID;
InstanceID = QuickPDFCreateLibrary();
if (QuickPDFUnlockKey(InstanceID, "your license key") == 1) {
QuickPDFDrawText(InstanceID, 100, 500, "Hello world");
QuickPDFSaveToFile(InstanceID, "C:\Docs\HelloFromDLL.pdf");
}
QuickPDFReleaseLibrary(InstanceID);
If you need to send binary data to Quick PDF Library that may contain null characters, you can ask
Quick PDF Library to create a temporary buffer of a certain size.
Use the QuickPDFCreateBuffer and QuickPDFAddToBuffer functions to create the buffer and fill it
with data. The value returned by the QuickPDFCreateBuffer function can then be used for any Quick
PDF Library string parameter:
char * Buffer;
char * Content = ...; // pointer to the data
Buffer = QuickPDFCreateBuffer(10000);
QuickPDFAddToBuffer(InstanceID, Buffer, Content, 10000);
QuickPDFStoreCustomDataFromString(InstanceID,
"MyData", Buffer, 1, 0);
QuickPDFReleaseBuffer(InstanceID, Buffer);
Receiving strings from Quick PDF Library
Functions that return string data will return a PChar, a pointer to a null terminated string. The
memory for this string is contained within the Quick PDF Library instance.
The data in the string should be copied out immediately as the same memory will be used for
subsequent calls to the DLL.
To get the length of the returned string, use the QuickPDFStringResultLength function:
char * Content;
int ContentLength;
Content = QuickPDFRetrieveCustomDataToString(InstanceID,
"MyData", 1);
ContentLength = QuickPDFStringResultLength(InstanceID);
// copy the data in Content now
Getting Started: Delphi Edition
Installation
Copy all the DCU and RES files from the relevant installation folder into a directory of your choice,
for example C:\Program Files\Quick PDF Library\Delphi\
If you would prefer to set your project's Search Path, use the following Delphi menu:
Projects | Options | Directories/Conditionals | Search path
Class/unit name
The class name of Quick PDF Library Delphi Edition is "TQuickPDF" followed by the version number.
The unit name is the same but without the leading T. For example, in this release the full class name
is TQuickPDF0715 and the unit is QuickPDF0715.
Simply add the Quick PDF Library unit QuickPDF0715 to the uses clause, declare a variable of type
TQuickPDF0715, and call the Create class function.
When you are finished using the class, call the Free function, usually within a try...finally block.
The first function you should call is the UnlockKey function, passing it your license key.
Add Quick PDF Library's unit (QuickPDF0715) to the uses clause of your form unit:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, QuickPDF0715;
Double-click the TButton to add an OnClick event, and fill in the
following event code. Change the path in the SaveToFile function to
an existing folder on your computer.
procedure TForm1.Button1Click(Sender: TObject);
var
PDFLibrary: TQuickPDF0715;
UnlockResult: Integer;
begin
PDFLibrary := TQuickPDF0715.Create;
try
UnlockResult := PDFLibrary.UnlockKey(Edit1.Text);
Label1.Caption := PDFLibrary.LicenseInfo;
if UnlockResult = 1 then
begin
PDFLibrary.DrawText(100, 500, 'Hello from Delphi');
PDFLibrary.SaveToFile('C:\Docs\HelloFromDelphi.pdf');
end else
begin
ShowMessage('Invalid license key);
end;
finally
PDFLibrary.Free;
end;
end;
You can now run your program. Fill your Quick PDF Library license key into the edit box and then
click the button.
If the license key you put into Edit1 is valid, the call to the UnlockKey function will return the value 1
and a PDF will be created in the specified directory.
Getting Started: TCP Edition
Installation
During installation, the QuickPDFTCP0715.exe file will be copied into the directory you specify, for
example C:\Program Files\Quick PDF Library\TCP\
IPAddress=127.0.0.1
Port=10005
Starting the service
QuickPDFTCP0713 qp;
if (qp.Connect("127.0.0.1", 10005))
{
std::cout << "LibraryVersion = ";
std::cout << qp.LibraryVersion() << std::endl;
qp.UnlockKey("your license key here");
qp.DrawText(100, 500, "Hello from C++ via TCP/IP");
qp.SaveToFile("C:\\test.pdf");
}
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
In order to reduce any confusion, you should check the result of the UnlockKey function before
doing anything else. If the function returns a 0 then this means that the license key is missing,
expired or invalid, if the function returns a 1 then this means that the license key is valid and you will
be able to access the full functionality of the library.
PDF Creation
A blank document is automatically created when you instantiate Quick PDF Library.
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
QP.DrawText(100, 600, "Hello world");
QP.SaveToFile("Hello.pdf");
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
// Draw the image onto the page using the specified width/height
QP.DrawImage(0, lHeight, lWidth, lHeight);
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
strInputFilePath = "c:\\temp\\input.pdf";
// Iterate through each page in the PDF and append it to a text file
QP.LoadFromFile(strInputFilePath);
iNumPages = QP.PageCount(); // Calculate the number of pages
strText = "";
nPage = 0;
for(nPage = 1; nPage<=iNumPages; nPage++)
{
strText = strText + QP.ExtractFilePageText(strInputFilePath,
"", nPage, 0);
}
PDF to image rasterization BMP, JPEG, WMF, EMF, EPS, PNG and GIF)
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
PDF Printing
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
Create custom printers (page size, copies, quality, color, duplex, collate, etc)
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
CustomPrinter = "";
CustomPrinter = QP.NewCustomPrinter("My printer");
QP.SetupCustomPrinter(CustomPrinter, 5, 2); // Medium quality
QP.SetupCustomPrinter(CustomPrinter, 6, 1); // Monochrome
QP.SetupCustomPrinter(CustomPrinter, 7, 3); // Horizontal Duplex
PDF Security
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
// Function QuickPDF0715.PDFLibrary::SignFile(InputFileName As
String,
// OpenPassword As String, SignatureFieldName As String,
// OutputFileName As String, PFXFileName As String,
// PFXPassword As String, Reason As String, Location As String,
// ContactInfo As String) As Long
QP.SignFile("C:\\temp\\sign_me.pdf","","signature_field","c:\\temp\\
signed.pdf","c:\\temp\\Quick PDF Library.p12",
"ithinknot", "A good reason", "Here", "Quick PDF Library");
Decrypt PDFs
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("YOUR KEY HERE");
QP.SaveToFile("C:\\temp\\finger_printed.pdf");
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
QP.AddFormFont(FontID);
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
QP.LoadFromFile("Hello.pdf");
NumFields = QP.FormFieldCount();
strFieldValues = "";
for(i = 1; i <=NumFields; i++)
{
strFieldValues = strFieldValues + "Field " + i + ": " +
QP.GetFormFieldTitle(i) + " " + QP.GetFormFieldValue(i) + "\r";
}
Form field support for text, pushbutton, checkboxes, radio buttons, choice, and signature
XFA support (fill and read values from XFA forms)
Advanced control of form field appearance
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
QP.LoadFromFile("Hello.pdf");
FieldCount = QP.FormFieldCount();
FieldIndex = 1;
LoopNumber = 1;
PDF JavaScript
QP.AddFormFont(FontID);
Preview.LoadFromFile("Hello.pdf");
Extract text from a document (font, color, size and position of each piece of text)
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
strFileInputPath = "c:\\temp\\fun.pdf"
iFileID = QP.DAOpenFile(strFileInputPath, "");
iPageCount = QP.DAGetPageCount(iFileID);
iPageNum=0;
// Function QuickPDF0715.PDFLibrary::DASaveImageDataToFile(
// FileHandle As Long, ImageListID As Long, ImageIndex As Long,
// ImageFileName As String) As Long
Fonts
Standard fonts
Subsetted fonts
TrueType fonts
Type1 fonts
Full support for graphics state (load state and save state)
Clipping regions
PDF Compression
Compress fonts
Compress images
Compress content
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
QP.SaveToFile("Hello.pdf");
Insert pages, append pages, move pages, reorder pages, clone pages and rotate pages
Crop pages, split pages, delete pages, hide pages and extract pages
Split the text and graphics on the current page into two layers
Document properties (ilename , title, aut hor, subj ect, keywo rds , pdf pr oduc er, pdf versi on,
etc)
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
Security information
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
strLoadDocument = "C:\\temp\\sample.pdf";
QP.LoadFromFile(strLoadDocument); // load a local file
// Extract information
NumPages = QP.PageCount();
Get/Set Origin
GeoPDF support
Barcodes
Images
Compress images
QP = new ActiveXObject("QuickPDFAX0716.PDFLibrary");
QP.UnlockKey("j15z13nf3jw8cs9n78ou6r37y");
QP.LoadFromFile("Hello.pdf");
NumPages = QP.PageCount();
QP.SaveToFile("Hello2.pdf");
Preview.LoadFromFile("Hello2.pdf");
Draw text boxes
Page layout
Get page dimensions, page size and page content (text, images, objects)
Direct Access
Direct access functionality can be used with large PDFs.Operations are carried out on the
Misc
The latest release of Quick PDF Library is version 7.15 and it can be downloaded from here:
http://www.quickpdflibrary.com/products/quickpdf/trial.php
External help
Quick PDF Library Online Reference Guide -
http://www.quickpdflibrary.com/help/quickpdf/FunctionGroups.php
Quick PDF Library Knowledge Base http://www.quickpdflibrary.com/kb
Quick PDF Library Forum http://www.quickpdf.org
Quick PDF Blog - http://www.quickpdflibrary.com/blog/
Quick PDF Library Samples - http://www.quickpdflibrary.com/samples/index.php
End User License Agreement (EULA) -
http://www.quickpdflibrary.com/products/quickpdf/license.php
References
ISO 32000-1 (PDF 1.7)
Document management Portable document format Part 1: PDF 1.7, First Edition (July,
2008) (PDF, 8.6M) - http://www.adobe.com/devnet/pdf/pdf_reference.html