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

Changes for version 3.014 - 2019-04-26

  • MANIFEST, tools/*.pl move four developmental test .pl files from root into new tools directory. They were not intended to be installed into the Perl lib/PDF/ production directory, but for some reason that's where they were ending up. This change should keep them out of lib/PDF/ when installed via CPAN and the like.
  • lib/PDF/Builder/Basic/PDF/File.pm [ref RT 117184] fix contributed by Vadim Repin to allow PDF::Builder to write out a cross reference stream, if one was read in with an existing PDF (forcing a PDF 1.5 output level). This does not (yet) create an XRef stream from scratch. lib/PDF/Builder.pm, lib/PDF/Builder/Docs.pm update documentation for save(), saveas(), and stringify() to reinforce that the $pdf object is unusable after calling these methods.
  • lib/PDF/Builder/Resource/CIDFont/TrueType/FontFile.pm [ref RT 128674] rewrite CMap handling, with contributions by Alfred Reibenschuh (original PDF::API2 author) and Bob Hallissy (TTF::Font author). Only attempt to use the original four .cmap files, and now only if -usecmf flag set to 1. Otherwise -cmaps flag can set a list of Platform/Encoding pairs in priority order to look for a match in the font's internal cmap tables, or use the default set, or force a lookup with the find_ms() method. In all cases, either one list can be given, and will be used for both Windows and non-Windows platforms, or two lists can be given, separated by a semicolon, with the first one being for a Windows platform and the second for non-Windows. A debug flag -debug may be set to 1 to show various diagnostic information while processing the CMap/.cmap section. Now the default processing is to use the default list of internal cmaps, and if no match is found, call find_ms(), and as a last resort, if there is a .cmap file found, use that. To emulate the old CID mapping, set -usecmf=>1 and -cmaps=>'find_ms'. Various random documentation updates made, particularly regarding the use of "core" fonts, and recommending using TTF/OTF instead. Have not yet found a good data source to generate updated .cmap files for FontFile's use -- still TBD. Could not generate a generic "Adobe:Identity" .cmap file. The ticket is being held open for now as a reminder to deal with .cmap updates. lib/PDF/Builder/Resource/CIDFont/CJKFont.pm notes added as to why FontFile changes not made here (.data and .cmap files are required, no searching of internal cmaps).
  • lib/PDF/Builder/Basic/PDF/File.pm, Objind.pm, Pages.pm [ref RT 121911] fixes contributed by Vadim Repin to deal with the failure of adding new pages to an existing document. This apparently had something to do with circular references, improper 'realise' of objects, and other things.
    • There were three other issues raised in this ticket: rebuild_tree didn't work (already dealt with in PDF::Builder), a useless line of code (already removed from PDF::API2 and PDF::Builder), and LZWDecode/ FlateDecode optimizations (maybe look at again later).
  • lib/PDF/Builder.pm, lib/PDF/Builder/Docs.pm add documentation (POD) explaining how the interaction between text objects and graphics objects may result in (apparently wrong) unexpected order of output (rendering order).
  • lib/PDF/Builder/Content.pm, lib/PDF/Builder/Docs.pm, examples/Content.pl further explanation (mostly POD) on text and graphics object interactions, and especially the effect on clipping, particularly of text glyphs.
  • examples/022_truefonts add a flag --full (or -f) to force 65536 characters to be output, rather than whatever the count of CIDs is reported in the font. This may be useful for seeing all the defined glyphs if there are gaps in the CID sequence.
  • Makefile.PL, README, lib/PDF/Builder/Docs.pm Move "optional" libraries (modules), currently Graphics::TIFF and Image::PNG::Libpng, to new "recommends" section in Makefile.PL. Your installer MAY attempt to automatically install these as prerequisites. If it does, and fails, no need to panic: they aren't vital to the operation of PDF::Builder, and should NOT cause an overall installation failure! You are free to remove these optional libraries from your Perl installation if you do not plan to use them. More information is in PDF::Builder::Docs. PDF::Builder is now expected to show up in CPAN's listing of "Reverse dependencies" for these libraries.
  • lib/PDF/Builder/Resource/Font/SynFont.pm, lib/PDF/Builder/Docs.pm, lib/PDF/Builder.pm, DEPRECATED, examples/021_synfonts, examples/README, examples/example.output Deprecate -slant option, replacing by -condense, for the option to condense or expand character widths in a synthetic font. Expand and clarify documentation. 021_synfonts add a page of text showing all the options in use together, and command-line type. There is still much to be done to make synthetic fonts completely usable, and I am exploring some alternatives.
    • Fonts are limited to single byte encoding (you may wish to select an alternate plane as a font and run that through synfont()). A major problem I have not been able to solve is the expansion of Latin alphabet ligatures to multiletter capital strings (e.g., ffi to F+F+I) for small-caps usage, as well as small-caps for things like "long s" which are not in the base plane, because the ASCII letters do not appear to be available in other planes.
  • lib/PDF/Builder/Basic/PDF/File.pm [ref RT 106020 and RT 117210] add some tolerance for out-of-spec PDF files. Initially this is permitting a comment between the PDF version number in the header and the EOL, and extra whitespace in the cross reference listing and some other wigglies (e.g., starting object 1, not 0, 0 entries per subsection, lots of warnings). These files don't strictly meet the PDF formatting spec, but many readers seem to tolerate them (fix them up), so PDF::Builder should, too. Note that PDF::Builder already is happy to read a Mac-style PDF using only CR for an EOL (one byte, not the required two).
    • There is one more that I haven't added yet: there are reports of sightings "in the wild" (e.g., RT 106020) of a PDF version header followed by a comment followed by the first object (n 0 obj) before encountering the first $cr. If I can come up with or obtain a "working" PDF like this, I will look into adding tolerance code for it.
    • For future consideration: save header comments (in-line and after header) for output at overall header. Should coordinate with being able to specify a header comment (in .pl code) and possibly comments within objects. Other out-of-spec conditions that most readers tolerate will be added over time.
  • CONTRIBUTING, MANIFEST Add file (at CPAN's request) suggesting how best to contribute to the project.
  • examples/025_unifonts, 3_examples.pl, INFO/old/examples.bat The data used by 025_unifonts (attached PDF-J document) is encoded in SJIS. This is invalid UTF-8 and caused the script to blow up. The fix is to inform Perl that the DATA being read is SJIS, so it can be encoded on the fly to UTF-8.
  • INFO/Changes_2018, Changes, MANIFEST, lib/PDF/Builder.pm, README 2019 copyright, archive 2018 changes.
  • (see INFO/Changes_2018 for earlier changes) (see INFO/Changes-ver_2 for changes to PDF::API2 up through 2.033)

Modules

Facilitates the creation and modification of PDF files
Add annotations to a PDF
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
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 (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.