June 21, 2011
For Quick PDF Library version 7.25 we changed the integer type of the device context handles returned by the GetCanvasDC function and accepted as parameters to the RenderPageToDC and DARenderPageToDC functions.
The reason for this is that the Delphi VCL declares the HDC type as an unsigned 32-bit integer.
The Windows graphics system does return values in the entire unsigned 32-bit range.
However, since making the change in 7.25 we have done further research and found some inconsistencies in various programming environments.
In particular, the Windows SDK defines a device context handle HDC as a PVOID which is a signed 32-bit integer.
The .NET Framework uses System.IntPtr which is also a signed 32-bit integer.
For 7.26 we will be making further changes to how device context handles are processed by Quick PDF Library to properly match different programming languages.
- Delphi DCUs – Unsigned – Cardinal
- Delphi DLL – Unsigned – HDC
- C# ActiveX – Signed – System.IntPtr
- C# DLL – Signed – System.IntPtr
- C++ DLL – Signed – HDC
- C++ ActiveX – Signed – HDC
- VB.NET ActiveX – Signed – System.IntPtr
- VB.NET DLL – Signed – System.IntPtr
- PowerBuilder DLL – Signed -long
- PowerBASIC DLL – Unsigned – DWORD
- ActiveX Type Library – Signed – long
The information in this article supersedes the information that we posted on this topic a couple of weeks ago (specifically two two blog posts: Unsigned Integers and Device Context Functions and Unsigned Integers And Visual Basic).
Quick PDF Library 7.26 beta 1 has been released and is ready for download and testing. This new beta includes numerous enhancements, new functions and bug fixes. The 7.26 beta 1 installer can be downloaded from the button below.

Release Notes
Enhancements
- Improved handling of unexpected CCITT data streams
- Elimination of invalid character codes in text extraction
- Improvements to accuracy of text extraction
- GetFormFieldSubName changed to return UTF-8 text for all field types
- Type library files included with ActiveX (special version for VB6)
- Added options 5 and 6 (character width output) to GetPageText function
- Better handling of malformed TrueType font data
- Added support for CMYK JPEG2000 images
- NormalizePage function now adjusts annotations
New functions
- CreateNewObject
- GetOptionalContentGroupPrintable
- GetOptionalContentGroupVisible
Bug fixes
- Parsing of strings containing invalid reverse solidus codes corrected
- Reduced inconsistencies of internal image conversions
- Corrected image reversal for CCITT mask images
- LIB Edition of QPL now built with FastMM4 memory manager
- ServiceUnit.dfm correctly generated as part of source code release
- Corrected the direction rectangle paths are drawn
- Corrections to the way parent form fields are created
- Internal parent/child relationship corrected with NewChildFormField
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.
June 9, 2011
Update: the information in this post has been superseded by the information from this post: Device context handles and signed/unsigned integer.
In version 7.25 of Quick PDF Library we made a change to the API which made the use of unsigned integers necessary.
Unfortunately this change will break backwards compatibility for code that makes use of the RenderPageToDC, DARenderPageToDC, and GetCanvasDC functions — the only functions which use unsigned integers.
This means that for the RenderPageToDC and DARenderPageToDC functions the DC parameter now requires an unsigned integer to be passed to it and that the GetCanvasDC function now returns an unsigned integer. You will need to update your code to reflect this change prior to being able to successfully compile using version 7.25.
If you do not use any of these functions then you do not need to make any changes.
Most modern programming languages support unsigned integers, but there are a few older languages which do not. So for those languages we will attempt to come up with suitable workarounds — for example, as mentioned on this blog post a couple of days ago, we have created a TLB file to be used with the ActiveX edition of our library and VB6 which resolves the issue of VB6 not supporting unsigned integers. Leave a comment if your programming language does not support unsigned integers.
We do apologize in advance for any inconvenience that this break in backwards compatibility causes. We do our utmost to avoid situations like this but sometimes breaking backwards compatibility is necessary for the future health of the library.
June 7, 2011
Quick PDF Library Lite 7.25, our free PDF SDK, has been released and is now ready for download from the Quick PDF Lite page.
Quick PDF Lite is a free cut-down version of Quick PDF Library. It includes functionality that lets you perform basic operations such as draw text or images onto a PDF. The new 7.25 version introduces a new function — RotatePage — which lets you rotate pages in a PDF.
Quick PDF Library Lite contains only a small percentage of the overall functions available in Quick PDF Library so if you are looking for a comprehensive PDF solution for your development needs, download the 30 day trial of the commercial version of Quick PDF Library.
Update: the information in this post has been superseded by the information from this post: Device context handles and signed/unsigned integer. It is no longer required to use unsigned integers with the ActiveX edition, this is handled internally by the library.
In version 7.25 of Quick PDF Library we made a change to the API which made the use of unsigned integers necessary. Unfortunately not all versions of programming languages support unsigned integers. In this particular case Visual Basic 6 and earlier versions do not support unsigned integers, while Visual Basic .NET and newer versions do.
Although VB6 was released over 10 years ago it still has a strong following and quite a few VB6 programmers use Quick PDF Library. This being the case we’ve come up with an easy workaround which will enable VB6 programmers to continue using all of the functions in Quick PDF Library.
We’re now providing a TLB file along with the ActiveX edition that handles the unsigned integers. The TLB file is only used at compile time so you won’t need to distribute it with your executable, but you will need to distribute the ActiveX as per usual.
The TLB file for Quick PDF Library 7.25 can be downloaded from here and will be included in all future installers.
Instructions for using the TLB file:
- Register the ActiveX on your machine as per usual
- Open your VB6 project
- Go to Project > References > Browse…
- Add the ‘QuickPDFAX0725VB.tlb’ file
- Compile
As you are adding the TLB file as the reference it is not necessary to add the ActiveX file as a project reference because the TLB file interfaces with the ActiveX through the registry.
Please note: if you do not use the GetCanvasDC, DARenderPageToDC or RenderPageToDC functions then you won’t run into any issues if you choose not to use the TLB file. The unsigned integers are currently only used with these functions.
June 3, 2011
The final version of Quick PDF Library 7.25 has been released and is ready for download from our updates page. This version includes numerous bug fixes, enhancements and new functions. As you can see from the list below, upgrading to version 7.25 will be a great decision for many Quick PDF users, especially those who use our PDF SDK for rendering.
Download 7.25 from our Product Updates page
Release Notes
Enhancements
- Added support for CCITT images with /Indexed color space
- Improvements to EMF import font scaling
- Improved reading of CID font encoding
- Documents with malformed trailers are now handled gracefully
- Reduced memory consumption with CanvasDC functions
- Added support for CCITT images with EncodedByteAlign encoding
- Documents with malformed page tree nodes are now processed
- Improvements to accuracy of text extraction
- Image resolution can now be read from certain BMP images
- Improved text alignment with certain CFF fonts
- Added support for CCITT images with the EndOfLine flag
- CMap parser now supports variable length codes
- Memory reduction on image decoding
- Metafile import now compresses images
- RenderPageToDC and DARenderPageToDC now renderer directly to the device context
- DARenderPageToDC now honours the values set using SetRenderDCOffset
- Certain TIFF images are now added directly without needing decompression
- More improvements to accuracy of text extraction
- Image import now includes support for RGB palette LZW TIFF images
- Image import now includes support for RGB palette Packbits TIFF images
- Radio button options can now be deleted Renderer output to EMF+ format now uses CreateCompatibleDC(0)’
- Changed co-ordinate order of GetAnnotQuadPoints and SetAnnotQuadPoints to match GetPageText
- Added support for flate compressed images with /Indexed /DeviceN color space
- GDI+ image smoothing now turned off by default when drawing images
- Metafile import handles all WinAnsi Unicode characters without creating subsetted fonts
New functions
- GetEmbeddedFileID
- NormalizePage
- DARemoveUsageRights
- RemoveUsageRights
- DrawImageMatrix
- SetObjectSource
- SetRenderDCErasePage
- SetMarkupAnnotStyle
Bug fixes
- ExtractPages, CopyPageRanges and ExtractPageRanges now handle inherited resources
- DrawDataMatrixSymbol now defaults to black if the fill color has not been set
- DrawDatamatrixSymbol correctly encodes double digits
- Resources are correctly freed during EMF+ output
- Corrected page indexing for DAFindPage
- Outlines are correctly appended during document merging
- Annotations now drawn independently of page transformation matrix
- Improvements to image decoding to prevent inverted images
- Image indexing bug removed from the renderer image caching system
- NewFormField returns a correct result even for fields with duplicate field names
- Improved error handling during image extraction
- Improved TIFF tag reading
- Renderer handles missing resources during color space lookup
- Improvement to text extraction
- Eliminated a possible divide by zero for DPI values in PNG images
- Renderer checks for /XObject dictionary type now allows an empty value
- HTML text drawing functions now retain list item state between breaks
- Corrected quad points order for text markup annotations
- SetAnnotQuadPoints now correctly sets the values without crashing
- Added support for OpenType fonts with CFF outlines stored in /TrueType font dictionaries
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.