Skip to main content
Skip table of contents

How to use the IDistilller class in the Mako DOM


The IDistiller input was created to convert PostScript files to PDF, bypassing intermediate conversion to Mako DOM (Document Object Model), thereby improving conversion performance.

IDistiller has parameters that are not available to IPSInput, but may be useful when converting to Mako DOM. One example is IDistiller::setHiResBox(), which uses the HiResBoundingBox defined in the PostScript input file to more accurately determine page size.

A simple way of using the IDistiller input in this way is to use a Mako temporary reader writer to create a PDF and then pass this to the Mako DOM. Below is sample code which achieves this.

IDistiller to Mako DOM

CPP
 // Create an input stream.
 IInputStreamPtr inputStream = IInputStream::createFromFile(jawsMako, makoParams.m_inputFilePath);

 IDistillerPtr distiller = IDistiller::create(jawsMako);

 distiller->setTrimToBBox(true);
 distiller->setHiResBBox(true);

 // Create a temporary stream to write the PDF to.
 IRAInputStreamPtr reader;
 IRAOutputStreamPtr writer;
 jawsMako->getTempStore()->createTemporaryReaderWriterPair(reader, writer);

 // Convert!
 distiller->distill(inputStream, writer, progressMonitor);

 if (writer)
 {
        writer->close();
 }

 input = IPDFInput::create(jawsMako);
 assembly = input->open(reader);



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.