Changes for version 3.027 - 2025-04-18
- New features
- examples/FontManager.pl Add more examples of non-standard fonts, and give more control over which get displayed (if available). Note that not all these fonts come with a given OS, and those that do almost certainly need their paths updated. "Script" is omitted for this release, as it still needs work on selecting a suitable default script font.
- META.json, META.yml, Makefile.PL, README.md, examples/Column.pl, lib/PDF/Builder.pm, version Update minimum supported Perl level from 5.26 to 5.28. Also copyright dates to 2025.
- README.md, INFO/Prereq_fixes.md (new), MANIFEST, examples/Column.pl Move patches needed for some prerequisites (required or optional) to a new file INFO/Prereq_fixes.md, to reduce clutter in README.md.
- lib/PDF/Builder.pm, lib/PDF/Builder/Resource/XObject/Image/SVG.pm (new), lib/PDF/Builder/Content.pm, Makefile.PL, README.md, INFO/ACKNOWLEDGE.md, tools/optional_update.pl, t/svg.t (new), t/00-all-usable.t, META.yml, tools/2_t-tests.pl, devtools/PDFbuild.pl, MANIFEST, version, examples/SVG.pl (new), examples/resources/SVG/ATS_flow-GIFfilein- GPscatter5-MJdisplayNoTag-QRcode.svg (new), examples/README, examples/examples.output, tools/3_examples.pl Add code to support via SVGPDF (package by Johan Vromans) SVG images with image_svg() method. In the near future, plans are to add MathJax markup, GNUplot interfaces, and enhanced barcode support; all of which make use of SVG.
- lib/PDF/Builder/Content/Text.pm, lib/PDF/Builder/Docs.pm, lib/PDF/Builder/Content.pm, MANIFEST, README.md, tools/3_examples.pl, examples/Column.pl, examples/Column_lists.pl (new), devtools/PDFbuild.pl Rearchitect list (ul and ol) generation to improve appearance and permit upgrades to capabilities. Add <_marker> tag to permit overrides of properties of individual <ol> and <ul> markers (e.g., bullet color) at any or all <li>. This non-standard HTML tag can be used explicitly to modify marker properties, and is automatically inserted into the code if not manually given. The new (non-standard) CSS properties and defaults and examples are _marker-text (define text to use as marker, rather than default) '' (no change) for ol, ul; "=>" instead of a bullet _marker-color (change color from default) '' (no change) for ol, ul; "blue' instead of normal text black _marker-font (change marker font-family) '' (no change) for ol, ZapfDingbats for ul; "sans-serif" for different ol marker font _marker-style (change marker font-style, e.g., italic) '' (no change) for ol, ul; "italic" to italicize a marker _marker-size (change marker font-size) '' (no change) for ol, 50% for ul; "80%" for slightly reduced size _marker-weight (change marker font-weight) 'bold' for ol, ul; "normal" if don't want bold markers _marker-align (left/center/right justify marker text within marker_width). 'right' is default The defaults are the normal font-family, color, etc. inherited from the <ol> or <ul> tag, updated by the usual suspects (style, CSS, etc.), and finally overridden by _marker-* properties (inherited and set in the usual manner). If you nest lists, you may need to cancel _marker-* properties by setting them to ''. Note that if you set something like the "color" property in the <ol> or <ul> tag, it will *also* apply to each <li> list item! Instead, set "_marker-color" to affect only markers. Split out list examples from Column.pl examples, into Column_lists.pl.
- lib/PDF/Builder/Content/Text.pm, examples/Column_lists.pl Add "simple" list <_sl>, much like <ul> with 'none' for the list-style-type, that is, a list with no marker.
- lib/PDF/Builder/Content/Text.pm, examples/Column_lists.pl Support standard HTML attributes <ol type="f"> (1AaIi), <li value="n">, <li type="f">. The <li> are useful for changing the count in the middle of an ordered list, or overriding the list-style-type for one element.
- lib/PDF/Builder/Content/Text.pm, examples/Column_lists.pl Add CSS list-style-position property, with support for 'inside' and 'outside' (default). In addition, extend CSS by allowing N% value, where the value is the percentage of marker_width to indent the left edge of second, etc. lines of <li> text. This permits a "hanging marker" effect without the full "outside" setting (0% = "inside", 100% = "outside"). Also, an Npt value may be given, which is the indent amount in points (0 = "inside", marker_width pts = "outside"). In both cases, results may be undesirable if N% is outside the range 0 to 100, or Npt is outside the range 0 to marker_width. We recommend that you stay within these limits.
- lib/PDF/Builder/Content/Text.pm, examples/Column.pl CSS text-align property for left, center, and right added.
- lib/PDF/Builder/Content/Text.pm, examples/Column.pl Implement HTML extension <_move> tag: "x" attribute = absolute positioning within column and/or "dx" attribute = relative positioning. If $x is undefined, assume is at 0. This can be used to place text at desired point(s) on a given line, such as a page title at the left and page number at the right of a header or footer.
- lib/PDF/Builder.pm, lib/PDF/Builder/Basic/PDF/File.pm, lib/PDF/Builder/Content/Text.pm, lib/PDF/Builder/Content.pm, version, Makefile.PL, tools/optional_update.pl, docs/buildDoc.pl, t/00-all-usable.t, t/tiff.t, t/version.t, tools/2_t-tests.pl Fix "require" of external libraries so oddly formatted VERSION numbers don't derail PDF::Builder loading. Builder was blowing up when Image::PNG::Libpng went to version 0.57_01 (development version) for a while. Use version->parse("string")->numify() to create a uniform numeric version value for comparison (against a mininum). Also add SVGPDF version. Because of the conflict between the package 'version' and the function 'version()', change the function name to pdf_version(). Note that minimum levels must be proper integer or real numbers, and cannot have any underscores, dashes, or multiple decimal points! To do so would require quotes around the value so it is treated as a string.
- examples/020_corefonts Clean up code to permit any of three command lines: (nothing) -- default list of all core fonts, (-s) -- 3 sample core fonts, (list of names) -- specified names (e.g., you need a quick list of what's in Zapf Dingbats and Wingdings).
- lib/PDF/Builder/Content/Text.pm Minor change to font size upon entry: first it is defaulted to 12pt. The next step of overriding that setting with the text object's fontsize has been removed, as this often produced unexpected results. Finally, the third step is to use the 'font_size' optional value, if given.
- lib/PDF/Builder/Content/Text.pm, examples/Column.pl Fold all HTML tags to lower case (to support <P> etc.), detect unsupported or invalid tags and give error message (just once for each, per column() call). Treat unknown tags as <span> tag. In Column.pl, A few tags are now upper case (are accepted), and some bogus tags (expect an error message) and bogus CSS entries (ignored) in one sample.
- lib/PDF/Builder/docs/buildDoc.pl Add run suggestions and examples for other structures of packages.
- lib/PDF/Builder.pm, docs/buildDoc.pl, lib/PDF/Builder/Docs.pm, lib/PDF/Builder/Resource/UniFont.pm, lib/PDF/Builder/Resource/CIDFont/CJKFont-TrueType.pm, lib/PDF/Builder/Resoure/Font/BdFont-CoreFont-Postscript-SynFont.pm, Rearrange some of the documentation and update some "Options" lists to make looking up font options more straightforward and complete.
- lib/PDF/Builder/Content.pm Move end/endpath description (POD) to a more appropriate section.
- lib/PDF/Builder/Basic/PDF/File.pm If open() for update, check that existing PDF is read/write. Also report any error opening a PDF, and die, instead of just returning.
- lib/PDF/Builder/Docs-Outlines-Outline.pm Clarify and extend the documentation for creating and maintaining outlines (bookmarks), including how to create multilevel (nested) bookmarks. Remove '$prev' entry from Outline's constructor, as it appears to have never functioned as intended. Instead, use the methods insert_before() and insert_after() to place a bookmark within an existing list. If you *are* successfully using '$prev', please describe how you are using it so I can document it and restore it to the code! Note that original Outline problem (#207) remains to be fixed!
- lib/PDF/Builder.pm, lib/PDF/Builder/Resource/XObject/Image/PNG_IPL.pm, lib/PDF/Builder/Resource/XObject/Image/TIFF_GT.pm, lib/PDF/Builder/Resource/XObject/Image/TIFF/File_GT.pm Update Image::PNG::Libpng handling so that SVGPDF library will be able to handle inlined PNG images by passing an IO::String "filehandle" from File::LoadLines, etc. Also, TIFF (with Graphics::TIFF usage) will now accept filehandles (at least, "GLOB" type) as input, and write out a temporary file to use. Certain operating systems seem to have trouble erasing the temporary file, so temps may build up over time! This area of filehandle inputs is still being actively investigated. It appears that all image formats except GD (GIF, JPEG, TIFF, TIFF with Graphics::TIFF, PNM, PNG, and PNG with Image::PNG::Libpng) can now be given either a filepath and name, or a Perl filehandle.
- lib/PDF/Builder/Content.pm Correct placement of content of "object" and in POD elaborate on necessary corrections that may be needed.
- (most .pm files) update POD for more consistent appearance, including links for major entries and methods. docs/buildDoc.pl put NAVIGATION links at the top of the Table of Contents, since usually now many more entries are in the TOC. The links themselves are still at the bottom of the page. devtools/PDFbuild.pl updates found to be needed in 3.026 build. devtools/html2php.pl updates found to be needed. MANIFEST add INFO/Changes_2023.
- Bug fixes
- lib/PDF/Builder/Basic/PDF/Dict.pm Per #221, don't let unblessed objects get through (causes error).
- lib/PDF/Builder/Basic/PDF/Array.pm, examples/ShowFont.pl Fix a typo in ShowFont example (#222), and a bug in Array.pm that led to Array's outobjdeep() blowing up if there was no graphics object (page->gfx) defined, but apparently only when dealing with TTF fonts! It has been patched with a workaround, which will do for now, but a permanent fix is a TBD item.
- lib/PDF/Builder/Content/Text.pm Correct the wrong width being used when Content::Hyphenate_basic::splitWord is called from column(). Reported by @CtrlO.
- lib/PDF/Builder/Basic/PDF/File.pm Per PDF::API2 commit 308e70f, die (crash) with message instead of freezing up if a malformed PDF trailer's Prev keys result in a loop or if multiple trailers use the same object ID and generation number.
- README.md, INFO/prereq_fixes.md Note on installing on older Macs: see #223 and INFO/prereq_fixes.md for dealing with strange errors with the "convert" utility (ImageMagick). Apparently it was missing the Arial font on some older releases.
- lib/PDF/Builder/Content.pm, t/text.t The advancewidth() function was not properly counting the space added by character space and word space settings, in some cases. This could become very apparent in lines with multiple writes, where it wasn't counting extra space added after the last character in a write. A note was also added to the word space documentation explaining that all spaces between words receive the extra word space (not just once per run of spaces), and inter-word spaces also receive extra character space (Tc). Thanks to @gtnuux for reporting this (#224) and suggesting the fix.
- As a practical matter, advancewidth() now properly returns any extra space added to the last character (charspace or wordspace), whereas before, it wasn't. This may slightly change the behavior of your program, especially if a line was constructed with multiple writes (text calls). With single writes, the extra space was hidden by the right margin.
- lib/PDF/Builder.pm, /lib/PDF/Builder/Page.pm Per #219, fixes to default_page_boundaries().
- lib/PDF/Builder.pm Some PDF Readers (including some releases of Adobe Acrobat Reader) ignore a request for decimal page numbers (and output a page label of "Page m of n") if an explicit Start value isn't given. Default Start value to 1 (and always explicitly specify to PDF Reader if page labels used).
- lib/PDF/Builder/Basic/PDF/File.pm Add newline after 'm n obj' to bring more in conformance with PDF/A requirements (ISO 19005-1:2005, Clause: 6.1.8) per #52 and PDF::API2 #82. Already had newline before 'endobj'.
- lib/PDF/Builder.pm, lib/PDF/Builder/Docs.pm Update recommendations that not only should T1 (PS) font and CJK font users strongly consider changing over to TTF/OTF fonts, but add that "core" fonts (while they will always be supported), are rather limited in their capabilities (especially single-byte encoding only, no UTF-8, limited selection of glyphs, no font embedding) and users should consider changing over to TTF/OTF fonts to get more capabilities.
- lib/PDF/Builder.pm, lib/PDF/Builder/Content.pm, lib/PDF/Builder/Content/Text.pm, lib/PDF/Builder/CIDFont.pm Fix failed paragraph justification due to word-spacing not being passed to text output routine when TTF/OTF fonts are used, per #193.
- lib/PDF/Builder/Basic/PDF/File.pm, devtools/html2php-PDFbuild-PDFversion.pl Minor cleanup to get clean perlcritic run.
- lib/PDF/Builder/Content.pm, lib/PDF/Builder/Resource/BaseFont.pm, lib/PDF/Builder/Content/Text.pm Per ticket #215 (Johan Vromans), corrected underlining (and also strike- through and [future] overline) thickness and positioning to use the correct Units Per Em (usually 1000, but many recent TTF and OTF fonts use 2048 or even higher values).
- lib/PDF/Builder/Content/Text.pm Avoid top margins if at very beginning of column, and not just for <p> paragraphs.
- lib/PDF/Builder.pm, lib/PDF/Builder/Page.pm Fix #210 (reported in API2 #75) default_page_size() was failing.
- lib/PDF/Builder/Resource/Font/CoreFont.pm Expand on descriptions of standard and Windows core fonts.
- INFO/prereq_fixes.md, lib/PDF/Builder/Content/Text.pm, README.md, examples/Column.pl There is a bug in HTML::TreeBuilder prerequisite HTML::Tagset (https://rt.cpan.org/Public/Bug/Display.html?id=151970), prior to version 3.22, where <ins> and <del> tags cause unwanted paragraph breaks due to being missing from the list of inline tags. The instructions for fixing this in HTML::Tagset are given in INFO/prereq_fixes.md.
- README.md, contrib/*, examples/*, tools/*, devtools/PDFbuild.pl, devtools/PDFversion.pl, docs/buildDoc.pl Bite the bullet and change "my $LAST_UPDATE" to "our $LAST_UPDATE", and remove the build-time edit of all these files. .pm file instances were already changed earlier during POD structure updates.
- examples/RMtutorial.pl Correct font 'Times' to 'Times-Roman' to avoid warning messages.
- (see INFO/Changes_2023 for earlier changes)
- Note that INFO/Changes-ver_2 (for changes released for PDF::API2, and incorporated into PDF::Builder) is NOT being updated any longer. You may assume that any change logged for API2 has also been incorporated into Builder, with any exceptions or differences noted here.
Modules
Facilitates the creation and modification of PDF files
Add annotations to a PDF
Various utilities and support routines
Corresponds to a PDF array
Holds the strings true or false
PDF Dictionaries and Streams
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
Stores PDF names (things beginning with /)
PDF Null type object
Numbers in PDF
PDF indirect object reference
Represents a PDF page
PDF pages hierarchical element
PDF String type objects
Utility functions for PDF library
Methods for adding graphics and text to a PDF
Simple hyphenation capability
Additional specialized text-related formatting methods
Additional documentation for Builder module
Managing the font library for PDF::Builder
Lightweight PDF creation methods
Matrix operations library
Add named destinations (views) to a PDF
Manage PDF outlines (a.k.a. bookmarks)
Further Outline handling
Methods to interact with individual pages
Base class for PDF resources
Base class for font resources
Base class for CID fonts
Base class for CJK fonts
TrueType (ttfont) font support
Additional code support for TT font files
Base class for PDF color spaces
Colorspace handling for Device CMYK
Base colorspace support for indexed color models
Adobe Color Table support
Colorspace support for Device RGB
Colorspace support for "Web Safe" Device RGB colors
Support for color space separations
Translate color names into RGB settings
Graphics state dictionary support
Some common support routines for font files
Module for using bitmapped Fonts
Module for using the 14 standard PDF built-in Fonts (plus 15 Windows Fonts)
Font-specific information for Bank Gothic font
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
Font-specific information for bold weight Georgia font
Font-specific information for bold weight + italic Georgia font
Font-specific information for italic Georgia font
Font-specific information for regular Helvetica font
Font-specific information for bold weight Helvetica font
Font-specific information for bold weight + slanted Helvetica font
Font-specific information for slanted Helvetica 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
Font-specific information for bold-weight Trebuchet font
Font-specific information for bold weight + italic Trebuchet font
Font-specific information for italic Trebuchet font
Font-specific information for regular Verdana font
Font-specific information for bold weight Verdana font
Font-specific information for bold weight + italic Verdana font
Font-specific information for italic Verdana font
Font-specific information for WebDings symbol font
Font-specific information for WingDings symbol font
Font-specific information for Zapf Dingbats symbol font
Support routines for using PostScript (Type 1) fonts
Module for creating temporary synthetic Fonts
Preparsed uniglyph.txt file information
List of standard paper sizes and their dimensions
Support stub for fill patterns
Support stub for fill shading patterns
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
Code 128 and EAN-128 barcode support
Specific information for 3-of-9 bar codes
Specific information for EAN-13 bar codes
Specific information for interleaved 2-of-5 bar codes
Support routines for Forms
Base class for external raster image objects
Support routines for Graphics Development image library
Support routines for GIF image library
Support routines for JPEG image library
Support routines for PNG image library (using pure Perl code)
Support routines for PNG image library (using Image::PNG::Libpng)
Support routines for PNM (Portable aNy Map) image library
Support routines for SVG (Scalable Vector Graphics) image library
TIFF image support
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
How the PDF should be displayed or printed
Examples
- INFO/old/examples.bat
- examples/011_open_update
- examples/012_pages
- examples/020_corefonts
- examples/020_textrise
- examples/020_textunderline
- examples/021_psfonts
- examples/021_synfonts
- examples/022_truefonts
- examples/022_truefonts_diacrits_utf8
- examples/023_cjkfonts
- examples/024_bdffonts
- examples/025_unifonts
- examples/026_unifont2
- examples/030_colorspecs
- examples/031_color_hsv
- examples/032_separation
- examples/040_annotation
- examples/041_annot_fileattach
- examples/042_links
- examples/050_pagelabels
- examples/055_outlines
- examples/060_transparency
- examples/BarCode.pl
- examples/Boxes.pl
- examples/Bspline.pl
- examples/Column.pl
- examples/Column_lists.pl
- examples/Content.pl
- examples/ContentText.pl
- examples/FontManager.pl
- examples/HarfBuzz.pl
- examples/README
- examples/RMtutorial.pl
- examples/Rotated.pl
- examples/SVG.pl
- examples/ShowFont.pl
- examples/Windows/027_winfont
- examples/examples.output
- examples/resources/040_annotation.pdf
- examples/resources/SVG/ATS_flow.svg
- examples/resources/SVG/GIFfilein.svg
- examples/resources/SVG/GPscatter5.svg
- examples/resources/SVG/MJdisplayNoTag.svg
- examples/resources/SVG/QRcode.svg
- examples/resources/aptfrontview.jpg
- examples/resources/pod2htmd.temp
- examples/resources/sample.txt
- examples/resources/sample_55.pdf