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();
//required
config.setDocument("https://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,
OutputStream outputStream)
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. |
void |
convertAsBinary(Configuration configuration,
OutputStream outputStream)
Converts the specified
Configuration into PDF or image and writes it directly
in the supplied OutputStream. |
public static final Version VERSION
public Result convert(Configuration configuration)
Converts the specified Configuration into PDF or image.
configuration - The Configuration.Result.com.realobjects.pdfreactor.Exceptions.PDFreactorException - If the conversion could not be completed.public byte[] convertAsBinary(Configuration configuration)
Converts the specified Configuration into PDF or image.
configuration - The Configuration.com.realobjects.pdfreactor.Exceptions.PDFreactorException - If the conversion could not be completed.public void convertAsBinary(Configuration configuration, OutputStream outputStream)
Converts the specified Configuration into PDF or image and writes it directly
in the supplied OutputStream.
configuration - The Configuration.outputStream - The OutputStream to write into.com.realobjects.pdfreactor.Exceptions.PDFreactorException - If the conversion could not be completed.public Result convert(Configuration configuration, OutputStream outputStream)
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.outputStream - The OutputStream to write into.Result.com.realobjects.pdfreactor.Exceptions.PDFreactorException - If the conversion could not be completed.This doc was generated on 2020-09-17. Copyright © 2002-2020 RealObjects GmbH. All Rights Reserved.