public class PDFreactor extends Object
PDFreactor
converts HTML and XML documents into PDF or image.
This sample demonstrates the use of PDFreactor:
PDFreactor
pdfReactor = new PDFreactor
();
Configuration
config = new Configuration
();
config.setDocument("http://www.realobjects.com/");
config.setAddBookmarks(true);
config.setAddLinks(true);
Result
result = pdfReactor.convert(config);
byte[] pdf = result.getDocument();
Please note: A new instance of PDFreactor
should be created for every conversion.
Important: On a system without a graphical environment you have to enable the headless mode by setting the appropriate system property. Please see the manual for details.
For more information please have a look at the PDFreactor manual.
Constructor and Description |
---|
PDFreactor() |
Modifier and Type | Method and Description |
---|---|
Result |
convert(Configuration configuration)
Converts the specified
Configuration into PDF or image. |
Result |
convert(Configuration configuration,
OutputStream os)
Converts the specified
Configuration into PDF or image and writes it directly
in the supplied OutputStream . |
byte[] |
convertAsBinary(Configuration configuration)
Converts the specified
Configuration into PDF or image. |
public static final Version VERSION
public Result convert(Configuration configuration) throws SAXException, IOException, TransformerException
Configuration
into PDF or image.configuration
- The Configuration
.Result
.com.realobjects.pdfreactor.Exceptions.PDFreactorException
SAXException
IOException
TransformerException
public byte[] convertAsBinary(Configuration configuration) throws SAXException, IOException, TransformerException
Configuration
into PDF or image.configuration
- The Configuration
.com.realobjects.pdfreactor.Exceptions.PDFreactorException
SAXException
IOException
TransformerException
public Result convert(Configuration configuration, OutputStream os) throws SAXException, IOException, TransformerException
Converts the specified Configuration
into PDF or image and writes it directly
in the supplied OutputStream
.
Note that the Result.getDocument()
and the Result.getDocumentArray()
methods will always
return null
.
configuration
- The Configuration
.Result
.com.realobjects.pdfreactor.Exceptions.PDFreactorException
SAXException
IOException
TransformerException
This doc was generated on 2017-05-17. Copyright © 2002-2017 RealObjects GmbH. All Rights Reserved.