JPEG 2000 Backend

As of version 3.9.0, JPEG 2000 support uses OpenJPEG 2.5.4. The public TJpeg2000Bitmap API is unchanged, but loading and saving now use the OpenJPEG 2.x codec lifecycle and callback-based stream API.

Win32 and Win64 builds both link the bundled OpenJPEG object files statically. Lib\thirdparty\build-openjpeg-bcc32.bat and Lib\thirdparty\build-openjpeg-bcc64x.bat rebuild the checked-in objects directly under Lib\thirdparty\Win32 and Lib\thirdparty\Win64. The Win64 path uses bcc64x with jump tables disabled so dcc64 can consume the static COFF64 objects without an OpenJPEG runtime DLL.

The backend supports JP2 and raw J2K codestream detection through the existing stream loader. Color component routing is inferred from the OpenJPEG 2.5 image color space, component count, and alpha metadata because the legacy PDFlibPas comp_type extension is no longer present upstream.

JPEG Output Reliability in 3.9.1

Version 3.9.1 corrects the bundled libjpeg-turbo bindings used by TPDFJPEGImage and PDF page rendering. JPEG export now uses ABI-matched boolean fields, callback declarations, structure alignment, and memory-backed output buffers on Win32 and Win64.

The same release fixes Win32 FlateDecode decompression with the bundled zlib backend, so PDF xref streams in linearized files load correctly before page rendering begins.

Applications that call TPDFJPEGImage.SaveToStream, LoadFromFile, or render PDF pages to JPG files do not need source changes. Rebuild the Win32 and Win64 library outputs so existing projects pick up the corrected image and FlateDecode backends.

AES Backend in 3.9.3

Version 3.9.3 refreshes the bundled AES implementation from Brian Gladman's 2018 C sources on both Win32 and Win64. The public PDFlibPas encryption API is unchanged, but the AES object files can now be rebuilt from Lib\thirdparty\AES using the per-library build scripts.

Lib\thirdparty\build-aes-bcc32.bat produces the Win32 OMF objects and Lib\thirdparty\build-aes-bcc64x.bat produces the Win64 COFF64 objects. PDFlibAES.pas declares the AES entry points with the C calling convention so AES-CBC encryption and decryption match the compiled C ABI on both platforms.

Printer DEVMODE Handling in 3.9.4

Version 3.9.4 changes PDF printing setup so custom paper tray, media type, duplex, quality, copies, color, and orientation settings are applied through the printer DEVMODE handle returned by TPrinter.GetPrinter. The code no longer treats TPrinter.Handle as a global memory handle, because that property is a printer HDC rather than a DEVMODE block.

This improves printing through server-shared and network printers, including scenarios where applications print through a server IP address or select a non-default paper tray before printing. Existing API calls such as SetPrinterDevModeFromString and the print setup options keep the same public behavior.