Apache XML Graphics FOP PDF Images
APACHE-2.0 License
$Id: README 1433 2011-07-01 15:12:30Z jeremias $
Contents of this file:
==============================================================================
This package contains classes which add support using PDF images in fo:external-graphic elements when you generate PDF files. This means you can write something like:
<fo:external-graphic src="my-doc.pdf"/>
Implementation notes:
This package uses the Apache PDFBox PDF library for parsing the PDF files as FOP's PDF library is a write-only library.
PDF image support is done differently for PDF output than for the other output formats. For PDF output, the plug-in tries to transfer the various PDF objects 1:1 to the target PDF. For the other output formats, Apache PDFBox is used to render the PDF to a Graphics2D object (Java2D). PDFBox still has some problems with rendering certain PDFs. Rather, consider helping out in the PDFBox project to improve the code. This plug-in only plays the adapter between FOP and PDFBox. It is not responsible for correct rendering of the PDF.
Individual pages inside a multi-page PDF can be accessed by using a URI fragment in the following form: #page= Example: http://localhost/mydoc.pdf#page=7 Note: this only works on URIs, not plain file names in which case you'll get an error. Plain file names are illegal in XSL-FO anyway, strictly speaking.
If you enable PDF/A or PDF/X functionality, the resulting PDF may not be a compliant file since the code isn't sophisticated enough to ensure that the rules of PDF/A and PDF/X are respected when the PDF file is embedded. So if you enable PDF/A and/or PDF/X, you should refrain from using this package.
If the PDF you want to embed has annotations, be prepared that they may not be transferred correctly.
Apache FOP currently generates PDF 1.4. If you include a PDF with a higher PDF version, the results may be unpredictable.
This package does not work with FOP 0.93, 0.94 or any earlier version. You will need a later release or the code from FOP Trunk.
Some PDF may not be processed correctly with FOP 0.95 due to bugs in its PDF library. You may need to upgrade Apache FOP in this case.
Using PDF files is NOT supported inside SVG, only in XSL-FO.
This plug-in has the following requirements:
Note: for some problems related to the PDF plug-in, Apache FOP 2.10 or later is required. A number of bugs had to be fixed in FOP's PDF library.
This package is published under the Apache License version 2.0. For the license text, please see the following files:
Legal information on third-party libraries used by this plug-in can be found in the "lib/README.txt" file.
See: http://xmlgraphics.apache.org/fop/gethelp.html
Just add the fop-pdf-images.jar and lib/pdfbox-*.jar (including the other minimal dependencies for PDFBox) to the classpath on the same classpath level as you put fop.jar.
You can then use URIs referring to PDF files inside fo:external-graphic and fox:external-document elements.
Please note that this plug-in was written mostly for PDF production. For other FOP output formats, the PDF is converted to a vector or bitmap image using Apache PDFBox which is not yet a full-fledged PDF viewer. There may be limitations concerning the quality. If you run into a problem displaying PDF for any output format other than PDF, you will need to ask the PDFBox community for help. Or you can help the Apache PDFBox project to improve their PDF interpreter.
The Apache PDFBox website: http://pdfbox.apache.org/
If Acrobat fails to open the generated PDF, it maybe be due to a bug in FOP that was fixed in revision 833375.
When importing multiple pages from the same PDF, the same PDF objects from the original may be imported anew for each page. There is currently no easy way to avoid this.
Versions prior to 2.1 (i.e. prior to the move to the Apache XML Graphics project) can be downloaded from here: http://www.jeremias-maerki.ch/development/fop/index.html
Changes: FOP-3149: Don't merge fonts when ascent is different FOP-3155: Use format 12 for unicode cmap FOP-3158: Switch to spotbugs FOP-3183: Disable pattern modification using xobjforms FOP-3200: Correct end of start code for merging ttf cmap
Changes: FOP-3107: Update to PDFBox 2.0.27 FOP-3108: Gradient component not displayed correctly after scaling FOP-3112: Rotate annotations FOP-3123: Modified stream should be used in the cache key FOP-3124: Subrs data missing from font merging FOP-3136: Softmask dictionary preserved FOP-3138: NPE when no fields FOP-3140: Merge form fields
Changes: FOP-3051: Upgrade to Commons IO 2.11 FOP-3073: Preserve bytes when cloning string FOP-3089: Switch cmap format to support iPhone FOP-3102: Move composite glyphs to the end
Changes: FOP-3034: Update PDFBox to 2.0.24 FOP-3032: Allow to embed native PDF in AFP FOP-3020: Add space to standard position for font merge FOP-3009: Avoid merging fonts with different number of cmap formats FOP-3001: Deduplicate streams in arrays
Changes: FOP-2951: Add uniquename to xobj form FOP-2965: Keep streams with DCT compression FOP-2971: Update unique name inside patterns FOP-2974: Handle space in COSName FOP-2979: Update PDFBox to 2.0.19
Changes: FOP-2904: Handle object for boundingbox FOP-2922: Syntax error after writing content stream FOP-2933: PDF to PDF checkbox missing
Changes: FOP-2802: Java 10 PDF/SVG to Image box not shown FOP-2812: Update PDFBox to 2.0.11 FOP-2836: Update PDFBox to 2.0.13 FOP-2840: Image mask in PDF not rendered to PS FOP-2841: PDF to PDF with merge-fonts checkbox misaligned FOP-2856: Support compile on Java 12 FOP-2873: Update to PDFBox 2.0.16 FOP-2879: Add caching to avoid parsing content stream FOP-2882: Allow PDFFormXObject to improve performance
Changes: FOP-2251: PDF to Postscript not showing transparency FOP-2715: Optimise PDFWriter writing out floats FOP-2719: PDF to PS NPE when encode param not set FOP-2720: PDF to PCL exception on clipping FOP-2723: PDF to PDF deduplicate more types of streams FOP-2739: Upgrade to PDFBox 2.0.7 FOP-2739: Avoid rastering PDF with Smask to image FOP-2746: PDF to PDF NPE during structuretree merge FOP-2750: Use streams for OTF subsetting FOP-2753: PDF to PS allow fop fonts as fallback FOP-2754: Error when merging True Type font with CFF PDF font
Changes:
Changes:
Changes:
Changes:
Changes:
Changes:
Note: This version will only work with FOP Trunk (revision 611768 or later) or with FOP 0.95 when it is released.
This is the initial release. Feedback is welcome as this is very new code.
Note: Version 1.0 contains a modified version of PDFBox! I'll send a patch with the change to the PDFBox project so hopefully the next version of PDFBox will not need such a modification.
Note: Version 1.0 contains a development version of Apache FOP from the following branch: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_PDF_in_PDF/ As soon as the code is stabilized this will be merged into the Trunk.