cpan PDF-Builder 3.014

latest releases: 3.026, 3.025, 3.024...
5 years ago

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.

Don't miss a new PDF-Builder release

NewReleases is sending notifications on new releases.