Search code examples
pdfghostscriptxfa

How to create a pdf with tiff or png images with ghostscript?


The use of xfa inside pdf isn’t only for creating forms Short : I need valid test cases for a new xfa ᴘᴅꜰ reader, but couldn’t found anyone nor I could find how to use ghostscript in order to create such test cases in batch.

The point is I don’t know how to build the extra information ghostscript should handle without an hex editor.


Solution

  • Ghostscript doesn't handle XFA at all, neither on input nor in output, you cannot use Ghostscript to create XFA files.

    Nor does Ghostscript (currently) create PDF files which solely consist of an image. Even if it did, these wouldn't be PNG or TIFF images, as those file formats are not directly supported by PDF. The next release of Ghostscript will contain devices which produce PDF files where the content is a rendered bitmap image created from the input. But they won't be either PNG or TIFF file format.

    Note that XFA has been removed from the PDF 2.0 specification (hardly surprising as its XML not PDF format).