public class PrinceControl extends Prince
mBaseURL, mCompress, mDisallowAnnotate, mDisallowCopy, mDisallowModify, mDisallowPrint, mEmbedFonts, mEncrypt, mFallbackCMYKProfile, mFileRoot, mForceIdentityEncoding, mInputType, mJavaScript, mKeyBits, mOwnerPassword, mPDFOutputIntent, mPDFProfile, mPDFXMP, mScripts, mStyleSheets, mSubsetFonts, mUserPassword, mXInclude
Constructor and Description |
---|
PrinceControl(String exePath)
Constructor for PrinceControl.
|
PrinceControl(String exePath,
PrinceEvents events)
Constructor for PrinceControl.
|
Modifier and Type | Method and Description |
---|---|
boolean |
convert(byte[] xmlInput,
OutputStream pdfOutput)
Convert an XML or HTML file to a PDF file.
|
boolean |
convert(InputStream xmlInput,
OutputStream pdfOutput)
Convert an XML or HTML file to a PDF file.
|
String |
getVersion()
Get the version string for the running Prince process.
|
void |
start()
Start a Prince control process that can be used for multiple
consecutive document conversions.
|
void |
stop() |
addScript, addStyleSheet, clearScripts, clearStyleSheets, convert, convert, convert, convertMultiple, convertString, convertString, getBaseCommandLine, getJobCommandLine, readMessages, setBaseURL, setCompress, setDebug, setEmbedFonts, setEncrypt, setEncryptInfo, setFallbackCMYKProfile, setFileRoot, setForceIdentityEncoding, setHTML, setHttpPassword, setHttpProxy, setHttpUsername, setInputType, setJavaScript, setLog, setNetwork, setOptions, setOptions, setPDFOutputIntent, setPDFProfile, setPDFXMP, setSubsetFonts, setVerbose, setXInclude
public PrinceControl(String exePath)
exePath
- The path of the Prince executable. (For example, this
may be C:\Program Files\Prince\engine\bin\prince.exe
on Windows or /usr/bin/prince
on Linux).public PrinceControl(String exePath, PrinceEvents events)
exePath
- The path of the Prince executable. (For example, this
may be C:\Program Files\Prince\engine\bin\prince.exe
on Windows or /usr/bin/prince
on Linux).events
- An instance of the PrinceEvents interface that will
receive error/warning messages returned from Prince.public String getVersion()
public void start() throws IOException
IOException
public void stop() throws IOException
IOException
public boolean convert(InputStream xmlInput, OutputStream pdfOutput) throws IOException
Note that it may be helpful to specify a base URL or path for the input document using the setBaseURL() method. This allows relative URLs and paths in the document (eg. for images) to be resolved correctly.
public boolean convert(byte[] xmlInput, OutputStream pdfOutput) throws IOException
Note that it may be helpful to specify a base URL or path for the input document using the setBaseURL() method. This allows relative URLs and paths in the document (eg. for images) to be resolved correctly.
xmlInput
- The byte array from which Prince will read the XML or
HTML document.pdfOutput
- The OutputStream to which Prince will write the PDF
output.IOException