public class PDFreactor
extends java.lang.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
();
//required
config.setDocument("http://www.realobjects.com/");
// optional
config.setAddBookmarks(true);
config.setAddLinks(true);
Result
result = pdfReactor.convert(config);
byte[] pdf = result.getDocument();
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,
java.io.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 org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
Configuration
into PDF or image.configuration
- The Configuration
.Result
.com.realobjects.pdfreactor.Exceptions.PDFreactorException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public byte[] convertAsBinary(Configuration configuration) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
Configuration
into PDF or image.configuration
- The Configuration
.com.realobjects.pdfreactor.Exceptions.PDFreactorException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public Result convert(Configuration configuration, java.io.OutputStream os) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.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
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
This doc was generated on 2018-08-13. Copyright © 2002-2018 RealObjects GmbH. All Rights Reserved.