The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 3.020 - 2020-11-29

  • lib/PDF/Builder/Content-Outline-NamedDestination.pm, INFO/DEPRECATED Rename previously deprecated names "spline" (to "qbspline") and "pdfile" (to "pdf_file").
  • examples/042_links Add some examples showing non-default positioning (fit) on target PDF's page.
  • lib/PDF/Builder/Basic/PDF/File.pm Extend cross-reference stream handling (read-in PDFs) to cover field widths of 5, 6, or 7 bytes (40-, 48-, or 56-bit integers). Special case of 8 byte (64-bit integer) where top 32 bits are all 0, is treated as 32-bit integer to avoid requiring a 64-bit Perl build just for unpacking this field.
  • lib/PDF/Builder.pm, lib/PDF/Builder/Docs.pm Per [RT 130722, RT 133131, et al.] get any /Version override (in /Catalog) and update the read-in PDF version (beyond 1.4, even if the PDF header still claims 1.4). This minimizes extraneous warnings about having to bump up the PDF version from what is claimed in the header.
    • Cross-check parent/kids links, report orphaned objects, report objects referenced but not defined, report missing Info and Root objects, etc. The input PDF file or string is not changed, but at least it can give you an idea of why an error occurs, or the resulting PDF does not work correctly.
  • lib/PDF/Builder/Basic/PDF/File.pm, INFO/RoadMap Per [RT 133131, Vadim Repin's fix], change Quad int unpack code from Q to Q> to indicate "Big-Endian" byte order (MSB at left) for incoming data field in a cross-reference stream. Apparently, with just Q, Perl will assume the doubleword int is native format (for instance, Little-Endian on an Intel chip). Note: This is a PDF 1.5+ feature (cross-reference streams) and has no business being in a PDF 1.4 file (the original bug report). Also add warning if imported file declared to be PDF 1.4 (or lower), as cross-reference streams are a PDF 1.5 feature. Earlier fix had added cross-reference stream support, but it really doesn't belong in PDF 1.4.
  • lib/PDF/Builder/Outline.pm, lib/PDF/Builder/Basic/PDF/Objind.pm Per [RT 131657, Vadim Repin's fix] add weaken statements to eliminate "Deep Recursion" error messages.
  • lib/PDF/Builder/Matrix.pm Per latest changes to PDF::API2, some code cleanup in Matrix.pm (no functional change except for adding some diagnostic carps).
  • lib/PDF/Builder.pm Per [PR 139, by ppisar], replace some hard-coded checks for Graphics::TIFF and Image::PNG::Libpng with calls to LA_GT() and LA_IPL().
  • docs/buildDoc.pl, lib/PDF/Builder/Basic/PDF.pm, MANIFEST Add NAVIGATION LINKS section to go Up to parent(s), sideways to Siblings, and Down to children. This enables you to get from any place in the docs to any place else without (usually) having to go all the way back up to index.html. PDF.pm added just for a place to put links (no code).
  • lib/PDF/Builder.pm, INFO/RoadMap minor updates
  • lib/PDF/Builder.pm, README, INFO/LICENSE Make license-related text more consistent, and attempt to clarify the relationship between the LGPL 2.1 master license and the various other licenses that some files are under, as well as the ability to redistribute under a higher version of LGPL. ref [CTS 35]
  • Makefile.PL, t/author-critic.t, tools/1_pc.pl Update to fix some perlcritic warnings, enable author-critic (not useful, as tools/1_pc.pl does a better job of it). Suggested by 'carygravel', but [PR 135] rejected, as 1_pc is a superset of author-critic function. Can't change .perlcriticrc SEVERITY from 5 to 4, as the GitHub Actions CI testing appears to be using it, leading to a lot of errors.
  • lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm, t/tiff.t, lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm, Makefile.PL, lib/PDF/Builder.pm, lib/PDF/Builder/Resource/XObject/Image/TIFF.pm, Fix problem with reading colormap from TIFF [GH 133], by 'carygravel'. Note that this requires upgrade of Graphics::TIFF from 6 to 7.
  • t/tiff.t upgrade so tests 10 and 11 are no longer always skipped. This works only on a Linux system (definitely not on Windows), and makes use of ImageMagick and Linux utilities 'convert' and 'tiffcp'. Graphics::TIFF is needed for test 10, and test 9 (alpha layer) is still skipped. Thanks to GitHub user 'carygravel' for the upgrade.
  • INFO/DEPRECATED add a couple long-deprecated items ("PDFStr" and "PDFUtf") that were missing from this file.
  • INFO/RoadMap, lib/PDF/Builder/Docs.pm add discussion on why images (especially JPEG) are sometimes rotated and/or flipped, and what can be done about it.
  • t/fonts-synfont.t, t/fonts-ttf.t fix a couple paths to DejaVu fonts on certain Linux boxes. From 'gregoa' at Debian Perl Group.
  • lib/PDF/Builder/Resource/XObject/Image/PNM.pm Bi-level (1 bit per pixel) PNM/PBM image was not being handled correctly if the row length (width) was not a multiple of 8. Not enough data was copied over to the PDF. Continuation of [RT 132844]. Almost complete rewrite of PNM.pm to properly support all combinations of comments in the header, and support "plain" (ASCII) image files (P1..P3) and 16 bit samples for grayscale and RGB. Not yet supporting multiple images per file, as I don't have any firm definition!
  • lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm Make use of the new 'split_alpha' call in new release 0.47 of Image::PNG::Libpng (this version specified as minimum, for optional library installation). This brings the speed for RGB and Gray scale with Alpha channels up to reasonable levels, as the 'vec' call is no longer called (4 or 8 times per pixel). Note that in contrast to PDF::API2, both 8 and 16bps samples are supported, and Gray scale is supported, at high speed; not just 8bps RGBA.
  • lib/PDF/Builder/Docs.pm, Makefile.PL, README, t/00-all-usable.t PDF::Builder will (again) attempt to install or upgrade OPTIONAL libraries (see README). Includes a warning in Makefile.PL not to be unduly alarmed if an optional install should fail. The user is given a choice of selecting none/all/specific optional libraries when running Makefile.PL (default "all").
  • README add instructions for installing on pre-5.020 Perls, which may be adaptable to other OS's and Perls. Note that there's no guarantee that PDF::Builder will actually RUN on older Perls! (But you're welcome to try.)
  • lib/PDF/Builder/Docs-Content.pm, lib/PDF/Builder/Content/Text.pm Fix spelling errors/typos, per report by 'carygravel'.
  • lib/PDF/Builder/Resource/PaperSizes.pm Fix a couple missized entries (B7 and jr-Legal), added a bunch more sizes (mostly archaic American and British sizes): dbill, statement (= student), half-letter (= student), old-paper, b-plus (B+/Super-B/A3+/super-A3), arch-a, arch-b, arch-c, arch-d, arch-e, arch-e1, pott, post, large-post, crown, large-crown, demy, small-demy, medium, royal, small-royal, super-royal, imperial, a7, a8, a9, a10.
    • Note that some "standard" sizes, such as broadsheet and foolscap, seem to have a different size specification depending on where you look. You should check that the size used matches your actual paper supply, and to either update PaperSizes.pm to match, or specify the MediaBox in points instead of by name. This is probably a good idea with any unusual, large, archaic, or special-order paper... you want to check what its actual size is before going through a lot of expensive failed printing!
  • examples/HarfBuzz.pl, examples/resources/HarfBuzz_example.pdf In the updated 3.019 example, note that the entire AdobeMingStd-Light.otf font (ttfont call) appears to be embedded, rather than just the subset. This resulted in 3.019 being about 8MB larger than 3.018's version! It may be related to bug [RT 130041]. Use caution when embedding CJK fonts, even when not using the cjkfont call, as at least some apparently don't subset. I replaced the font with AdobeGothicStd-Light.otf, which appears to embed just a subset of the font, greatly reducing the size of the PDF file.

Modules

Facilitates the creation and modification of PDF files
Add annotations to a PDF
Various utilities and support routines
Corresponds to a PDF array. Inherits from PDF::Builder::Basic::PDF::Objind
A special form of PDF::Builder::Basic::PDF::String which holds the strings true or false
PDF Dictionaries and Streams. Inherits from PDF::Builder::Basic::PDF::Objind
Holds the trailers and cross-reference tables for a PDF file
Abstract superclass for PDF stream filters
compress and uncompress stream filters for ASCII-85
compress and uncompress stream filters for ASCII-Hex
compress and uncompress stream filters for Flate
compress and uncompress stream filters for Lempel-Ziv-Welch
compress and uncompress stream filters for Run-Length
Literal PDF Object. Inherits from PDF::Builder::Basic::PDF::Objind
Inherits from PDF::Builder::Basic::PDF::String and stores PDF names (things beginning with /)
PDF Null type object. This is a subclass of PDF::Builder::Basic::PDF::Objind and cannot be subclassed.
Numbers in PDF. Inherits from PDF::Builder::Basic::PDF::String
PDF indirect object reference. Also acts as an abstract superclass for all elements in a PDF file.
Represents a PDF page, inherits from PDF::Builder::Basic::PDF::Pages
a PDF pages hierarchical element. Inherits from PDF::Builder::Basic::PDF::Dict
PDF String type objects and superclass for simple objects that are basically stringlike (Number, Name, etc.)
Utility functions for PDF library
Methods for adding graphics and text to a PDF
Simple hyphenation capability
additional specialized text-related formatting methods. Inherits from PDF::Builder::Content
additional documentation for Builder module
Lightweight PDF creation methods
matrix operations library
Add named destination shortcuts to a PDF
Manage PDF outlines (a.k.a. bookmarks)
further Outline handling. Inherits from PDF::Builder::Outline
Methods to interact with individual pages
Base class for PDF resources. Inherit from PDF::Builder::Basic::PDF::Dict
Base class for font resources
Base class for CID fonts
Base class for CJK fonts
additional code support for TT font files. Inherits from PDF::Builder::Basic::PDF::Dict
Base class for PDF color spaces
colorspace handling for Device CMYK. Inherits from PDF::Builder::Resource::ColorSpace
base colorspace support for indexed color models. Inherits from PDF::Builder::Resource::ColorSpace
colorspace support for Device RGB. Inherits from PDF::Builder::Resource::ColorSpace::Indexed
colorspace support for "Web Safe" Device RGB colors. Inherits from PDF::Builder::Resource::ColorSpace::Indexed
Support for color space separations
translate color names into RGB settings
Graphics state dictionary support
some common support routines for font files. Inherits from PDF::Builder::Resource::BaseFont
Module for using bitmapped Fonts.
Module for using the 14 PDF built-in Fonts.
font-specific information for Bank Gothic font (not standard PDF core)
font-specific information for regular Courier font
font-specific information for bold weight Courier font
font-specific information for bold weight + slanted Courier font
font-specific information for slanted Courier font
font-specific information for regular Georgia font (not standard PDF core)
font-specific information for bold weight Georgia font (not standard PDF core)
font-specific information for bold weight + italic Georgia font (not standard PDF core)
font-specific information for italic Georgia font (not standard PDF core)
font-specific information for regular Helvetica font. Metrics and glyph list from Arial typeface.
font-specific information for bold weight Helvetica font. Metrics and glyph list from Arial typeface.
font-specific information for bold weight + slanted Helvetica font. Metrics and glyph list from Arial font.
font-specific information for slanted Helvetica font. Metrics and glyph list from Arial font.
font-specific information for the Symbol font
font-specific information for bold weight Times font
font-specific information for bold weight + italic Times font
font-specific information for italic Times font
font-specific information for regular (roman) Times font
font-specific information for regular Trebuchet font (not standard PDF core)
font-specific information for bold-weight Trebuchet font (not standard PDF core)
font-specific information for bold weight + italic Trebuchet font (not standard PDF core)
font-specific information for italic Trebuchet font (not standard PDF core)
font-specific information for regular Verdana font (not standard PDF core)
font-specific information for bold weight Verdana font (not standard PDF core)
font-specific information for bold weight + italic Verdana font (not standard PDF core)
font-specific information for italic Verdana font (not standard PDF core)
font-specific information for WebDings symbol font (not standard PDF core)
font-specific information for WingDings symbol font (not standard PDF core)
font-specific information for Zapf Dingbats symbol font
support routines for using PostScript fonts. Inherits from PDF::Builder::Resource::Font
Module for using synthetic Fonts.
preparsed uniglyph.txt file information
list of standard paper sizes and their dimensions
support stub for patterns. Inherits from PDF::Builder::Resource
support stub for shading patterns. Inherits from PDF::Builder::Resource
Unicode Font Support
Base class for external objects
Base class for external form objects
Base class for one-dimensional barcodes
specific information for CodaBar bar codes. Inherits from PDF::Builder::Resource::XObject::Form::BarCode
Code 128 and EAN-128 barcode support
specific information for 3-of-9 bar codes. Inherits from PDF::Builder::Resource::XObject::Form::BarCode
specific information for EAN-13 bar codes. Inherits from PDF::Builder::Resource::XObject::Form::BarCode
specific information for int 2-of-5 bar codes. Inherits from PDF::Builder::Resource::XObject::Form::BarCode
support routines for Forms. Inherits from PDF::Builder::Content, PDF::Builder::Content::Text, and PDF::Builder::Resource::XObject::Form
Base class for external raster image objects
support routines for Graphics Development image library. Inherits from PDF::Builder::Resource::XObject::Image
support routines for GIF image library. Inherits from PDF::Builder::Resource::XObject::Image
support routines for JPEG image library. Inherits from PDF::Builder::Resource::XObject::Image
support routines for PNG image library (using pure Perl code). Inherits from PDF::Builder::Resource::XObject::Image
support routines for PNG image library (using Image::PNG::Libpng). Inherits from PDF::Builder::Resource::XObject::Image
support routines for PNM (Portable aNy Map) image library. Inherits from PDF::Builder::Resource::XObject::Image
support routines for TIFF image library
support routines for TIFF image library (Graphics::TIFF enabled)
TIFF image support (Graphics::TIFF enabled)
support routines for finding line breakpoints with Unicode text
utility package for often-used methods across the package.