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

Windows 2000 End-Of-Support

February 21, 2011

We’ve made the decision to end official support for Windows 2000 effective immediately as this operating system has reached the end of its livecycle and is no longer being supported by Microsoft.

Please note that there are no Windows 2000 specific hacks in the Quick PDF Library code base, so we will not be “removing” support as such. All this decision really means in real-terms is that Windows 2000 is no longer listed as a supported operating system on our website.

A quick tip for anyone who is going to continue developing applications for Windows 2000 is that if you’re using Visual Studio 2010 with runtime 10.0 this may cause issues on Windows 2000. Specifically, this error message:

“The procedure entry point EncodePointer could not be located in the dynamic link library KERNEL32.DLL”

Head on back to Visual Studio 2008 with runtime 9.0 or earlier and this error message will disappear.

Sayonara Windows 2000, it was nice knowing you.

About PDF Files

February 18, 2011

The goal of PDF is to enable users to exchange and view electronic documents easily and reliably, independent of the environment in which they were created or the environment in which they are viewed or printed.

PDF files can be thought of as self-contained composite documents made up of many instances of many things: page contents, images, graphics, fonts, colorspaces, metadata, annotations, links, digital signatures and more.

If you open up a PDF in a text editor you will notice that there are parts of it which make sense, but that the majority is unreadable to the human eye. That’s because much of the data in PDF files is stored inside binary streams, in which data has been encrypted or compressed. This binary data looks like garbage, but you can easily break your PDF just by adding a single character. It’s best not to edit PDF files directly in a text editor.

Underneath the hood PDF files are made from unordered numbered objects which can refer to each other by number and are all linked together by a cross reference table which maps object numbers to very specific places within the file.

At a low level PDF combines three technologies:

  • A subset of the PostScript page description programming language, for generating the layout and graphics.
  • A font-embedding/replacement system to allow fonts to travel with the documents.
  • A structured storage system to bundle these elements and any associated content into a single file, with data compression where appropriate.
As you can see, PDF files are quite complex and it makes a lot of sense (and saves a lot of time and money) to use products such as Quick PDF Library to keep those complexities out of your life.

However, if you are interested in studying the internals of PDF files further then these resources should be helpful:

By Rowan | Comments Off on About PDF Files | Posted in Quick PDF Library,Tips & Tutorials

The Basics: Getting Familiar with Quick PDF Library

February 17, 2011

Quick PDF Library is a big library and sometimes it can be a little daunting getting started, so we’ve put together a few basic tips to help you get up to speed quickly. We’ll enhance this document as we think of new tips. If you have any tips you’d like us to add to this document or questions about the intended use of certain features, please leave a comment.

Unlock the library

The UnlockKey function needs to be called and the return value checked otherwise most other functions called later will fail. More info here.

Check functions for return values

Always check the return value of the important functions such as LoadFromFile because if this function fails the subsequent function calls will fail to. Every single function returns a value. Checking for return values is not a requirement, but it can be immensely useful in ensuring the robustness of your code and debugging.

If a function is not documented as having a return value then you can assume the a return value of one (1) indicates successful. Zero (0) or other values could indicate an error or it could be returning a valid handle or ID.

Memory and direct access functions

Function names that start with DA indicate that the function is a direct access function. Functions that do not have this pre-fix are memory functions. Direct access and memory functions cannot be used together. Combining them in your code will result in your code not working correctly.

The DA functions are primarily used for PDF documents that are very large and contain thousands of pages. They are generally faster for these larger documents because the document does not need to be loaded into memory. For file sizes under 500 MB or under a few thousand pages the speed differences are negligible.

Blank document automatically loaded

When you initialise the library there is always a one page blank document in memory. It is selected and ready to use by default. This is due to the design of the library. There can never not be at least one document in memory, so if you try to delete that document using the DeletePages function, the library will automatically re-create a one page blank document.

The blank one page document uses a Letter page size which is 8.5 x 11 inches or 215.9 mm × 279.4 mm. The page size can be changed using the SetPageSize function.

New documents automatically selected

Whether you load an existing document using the LoadFromFile function or create a new document using the NewDocument function, it will automatically be selected in memory and the documents ID can be retrieved using the SelectedDocument function.

Multiple documents in memory permitted

You can have more than one document in memory and can swap between them using the ID returned from calls such functions as NewDocument and SelectedDocument. You can also count all documents in memory using the DocumentCount function and then retrieve each documents ID or filename using GetDocumentID or GetDocumentFileName. All of the document management related functions can be seen in the document management section in the function reference.

Origin point for drawing operations

The origin has coordinates of 0,0 and is the starting point for finding all other points. The origin point for a page in a PDF typically starts at a page corner. The default origin for Quick PDF Library is the bottom left page corner.

Using the SetOrigin function in Quick PDF Library you can change the point of origin to be any page corner (bottom left, top left, top right, bottom right).

By default calling QP.DrawText(10, 10, “Test”) will result in the text being drawn at 10 points in from the left of the page and 10 points up from the bottom of the page, but if you call QP.SetOrigin(1) prior to DrawText then the text will be drawn at 10 points in from the left of the page and 10 points down from the top of the page because passing the value 1 to the Origin parameter for the SetOrigin function changes the origin to top left of the page.

The default point of origin in Adobe Acrobat was the bottom left page corner up until Acrobat 8, at which point Adobe switched the point of origin to the top left page corner. As mentioned above, you can set Quick PDF Library to use any page corner in a PDF.

Measurement units

In PDF the coordinate system is called default user space. The default for the size of the unit in default user space (1/72 inch) is approximately the same as a point, a unit widely used in the printing industry. It is not exactly the same, however; there is no universal definition of a point.

Using the SetMeasurementUnits function you can change the units for all measurements given to and returned from the library. The available options are default user space, millimetres and inches.

Unicode, UTF-8 and the DLL and Delphi Editions

There are many different ways to encode Unicode characters. One way is to use strings with 16-bit characters. COM/ActiveX uses 16-bit characters, so adding Unicode support for the ActiveX edition of the library was easy.

For the Delphi and DLL editions, the strings have always been 8-bit characters. Unfortunately we can’t change the definition of functions as this would cause issues with backwards compatibility.

This means that when using the Delphi and DLL editions and working with Unicode characters, you need to encode your file names with UTF8 encoding, as mentioned in the function reference. Make sure that you pay attention to each function description as it will specifically mention if you need to encode or decode the input or output.

Different languages will have different functions to do the UTF8 encoding.

Standard Fonts

The PDF specification outlines 14 fonts that should always be available in all PDF viewers. These 14 fonts are called standard fonts and can be added to your PDF using the AddStandardFont function.

Font embedding, subset font embedding and no font embedding

There are three key ways that fonts can be handled in PDF files. They are:

Full Font Embedding = Larger file size
Recipient doesn’t need the same font to view or edit the file

Subset Font Embedding = Smaller file size
Recipient doesn’t need the same font to view but does need the same font installed in order to edit the file

No Font Embedding = Smallest file size
Recipient needs to have same fonts installed

Each option has its merits. As long as option 1 or 2 above when you are building your PDF files, then you can be sure that when your PDF is rendered or printed the font you’ve specified will be used. If you use option 3, then the PDF viewer will attempt to locate the specified font on the local machine but if it cannot be found then it will use a substitute font during the viewing/printing process.

When a PDF is displayed on your screen it is rendered in exactly the same fashion as it would be prior to being printed.

Quick PDF Library can only fully embed or subset fonts during the PDF creation process. The AddTrueTypeFont function can be used to add and embed a TrueType font in the document and the AddSubsettedFont function can be used to embed a subset of a font in the document. The AddCJKFont function is also available for CJK fonts.

Quick PDF Library 7.24 Beta 2 Released

February 7, 2011

Quick PDF Library 7.24 beta 2 has been released and is ready for testing. This new beta includes several bug fixes, enhancements and new functions. The 7.24 beta 2 installer can be downloaded from the button below.

Release Notes

New functions

  • GetFormFieldNoExport
  • GetFormFieldRequired
  • SetFormFieldNoExport
  • SetFormFieldRequired

Bug fixes

  • Bug fix for handling of choice form fields
  • Bug fix for processing of Separation color space
  • Bug fix for duplicate rendering of image

Enhancements

  • Range check improvements to Type1 decoding
  • Support for GS1-128 (EAN-128) barcodes
  • DataMatrix 2D barcodes can be rotated
  • ActiveX edition now marked with ‘Safe for initializing’ and ‘Safe for scripting’ flags
  • Support for DeviceN color spaces
  • Minor documentation updates

Feedback! Any feedback large or small is appreciated. We’ll shortly be planning the next round of exciting new features for Quick PDF Library, so we’d really like to know what you want to see added to the SDK. Don’t be shy, email us at support@quickpdflibrary.com and have your say.

By Rowan | Comments (6) | Posted in News,Quick PDF Library,Releases

Quick PDF Library 7.24 Beta 1 Released

January 27, 2011

Quick PDF Library 7.24 beta 1 has been released and is ready for testing. This new beta is a minor release and includes several bug fixes and enhancements. The 7.24 beta 1 installer can be downloaded from the button below.

Release Notes

Bug fixes

  • Bug fix for handling of choice form fields
  • Bug fix for processing of Separation color space
  • Bug fix for duplicate rendering of image

Enhancements

  • ActiveX edition now marked with ‘Safe for initializing’ and ‘Safe for scripting’ flags
  • Support for DeviceN color space added
  • DrawDataMatrixSymbol now supports rotation
  • Minor documentation updates

Feedback! Any feedback large or small is appreciated. We’ll shortly be planning the next round of exciting new features for Quick PDF Library, so we’d really like to know what you want to see added to the SDK. Don’t be shy, email us at support@quickpdflibrary.com and have your say.

By Rowan | Comments (4) | Posted in Quick PDF Library,Releases

Using WoW64 To Run Quick PDF Library On 64-bit Machines

January 21, 2011

UPDATE: There is now a 64-bit compatible version of Quick PDF Library available as part of version 8. Read more here. Native 64-bit support is provided for the DLL, ActiveX and Delphi editions.

A native 64-bit solution is not yet available but Quick PDF Library can be successfully run on on 64-bit machines using WoW64.

Here is the relevant information on this issue for each edition:

  • Delphi Edition — Delphi generates 32-bit code and so Windows will know to automatically run it through WoW64 on 64-bit machines.
  • ActiveX Edition — if you’re using Visual Studio (or similar) you will need to set the platform target to x86 instead of Any CPU.
  • DLL Edition — if you’re using Visual Studio (or similar) you will need to set the platform target to x86 instead of Any CPU.
  • TCP Edition — this edition is designed to run as a service and will run successfully on 32-bit and 64-bit machines.

The basic steps required for configuring a project in Visual Studio to work on 64-bit machines with either the ActiveX or DLL editions are shown below.

  1. Right-click on your project and select ‘Properties’ from the menu
  2. Click on the ‘Build’ tab
  3. Under ‘General’ change the ‘Platform target’ to x86
  4. Save

In the future we will release a native 64-bit version of Quick PDF Library. The library is written using the Delphi programming language and at this stage, Embarcadero has not released a 64-bit compiler for Delphi — although it is on their roadmap and they’re working on it. As soon as Embarcadero release a public beta version of their Delphi 64-bit compiler we’ll get to work on building a 64-bit compatible version of Quick PDF Library.

Finally, if you would like to be notified by email when we release a native 64-bit version of the library please let us know by leaving a comment.

Quick PDF Library 7.23 Released, Includes New LIB Edition

December 20, 2010

Quick PDF Library 7.23 has been released and is ready for download.

This new version is a relatively minor release in comparison to 7.22 but it does include some exciting new additions — specifically a LIB edition of the SDK for C/C++ developers — and some important bug fixes and enhancements for digital signatures and font handling.

Release Notes

Enhancements

  • First release of Quick PDF Library LIB Edition (static link .lib)
  • Improvements to exception handling while accessing file streams
  • Renderer handles images and vector graphics using the /Lab color space
  • LoadFromCanvasDC allows control over which fonts are embedded
  • Documentation improved for NewChildFormField function

New functions

  • NoEmbedFontListCount
  • NoEmbedFontListAdd
  • NoEmbedFontListGet
  • NoEmbedFontListRemoveIndex
  • NoEmbedFontListRemoveName
  • NoEmbedFontListRemoveAll
  • NewPageFromCanvasDC
  • SaveImageToString
  • SaveImageToVariant
  • DAHasPageBox
  • DASetPageBox
  • DADrawRotatedCapturedPage

Bug fixes

  • Dingbats font is rendered correctly when drawn multiple times
  • DASetPageBox supports Options = 3, 4 and 5 in accordance with the documentation
  • DADrawCapturedPage handles direct page contents array
  • SignFile handles encrypted files and files with cross reference streams
  • DAAppendFile handles files with cross reference streams
  • AddSubsettedFont and GetSubsetString functions handle character codes less than U+0100
  • Pixel size of renderer output is now consistent with the DPI, page dimensions and SetRenderScale

Feedback! Any feedback large or small is appreciated. We’ll shortly be planning the next round of exciting new features for Quick PDF Library, so we’d really like to know what you want to see added to the SDK. Don’t be shy, email us at support@quickpdflibrary.com and have your say.

By Rowan | Comments (2) | Posted in News,Quick PDF Library,Releases

Statically Linked Version Of Quick PDF Library

December 17, 2010

Exciting news for all of our C/C++ customers: we’ve just finished creating a statically linked version of Quick PDF Library.

The LIB Edition of Quick PDF Library is generated automatically by converting the DLL Edition into a static link library. The static link library file is called QuickPDFLIB0723.lib and a header file called QuickPDFLIB0723.h is included.

The new .LIB version will be included with the 7.23 release which will be made public very soon.

Make sure you read the getting started guide for the new .LIB version when you get it for some information on link dependencies and initializing/releasing the library.

Determining Which Fonts Support A Particular Charset

December 16, 2010

It can be a little difficult at times to determine which fonts support the character set that you’re trying to use. One option is to manually use the Windows Character Map utility to check each font available on your system to see if it provides support for your language. The Character Map utility can be accessed from Start > Run > charmap.

An alternative method, and a much quicker one, is to use the GetInstalledFontsByCharset function, which we added in version 7.21. This function allows you to specify a charset (ANSI, Hangeul, Russian, Baltic, Hebrew, Arabic, Greek, etc) and then to immediately see (via the string that is returned) a list of all the fonts installed on your machine which support the specified character set.

We’ve found it to be a very useful feature internally and we’re sure that you will too.

By Rowan | Comments Off on Determining Which Fonts Support A Particular Charset | Posted in Quick PDF Library,Tips & Tutorials

PicaJet.com: Review of Quick PDF Library

December 5, 2010

A few months ago PicaJet, a happy customer of Quick PDF Library, wrote a review of the SDK on their website:

It took us about six months of experimenting before finally selecting Quick PDF Library from among all the other PDF libraries. Quick PDF Library is not 100% pure .NET code, but it still renders PDF documents with maximal speed and quality; it supports CMYK images; it quickly extracts native PDF properties; it sells for a reasonable price. And it is backed by a company with a solid reputation and history of excellence.

You can read the full review on PicaJet.com.

By Rowan | Comments Off on PicaJet.com: Review of Quick PDF Library | Posted in News,Quick PDF Library

« Older PostsNewer Posts »