public class PDFPreflight extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PDFPreflight.KeyInfoPreflight
This is the Main-Class for the jPDFPreflight.jar that can generate server
key requests, validate a key, and display server information.
|
Constructor and Description |
---|
PDFPreflight(InputStream inStream,
IPassword password)
Loads a PDF document from an InputStream.
|
PDFPreflight(PDFSource source,
IPassword password)
Loads a PDF document from a PDFSource object.
|
PDFPreflight(String fileName,
IPassword password)
Loads a PDF document from a file.
|
PDFPreflight(URL url,
IPassword password)
Loads a PDF document from a URL.
|
Modifier and Type | Method and Description |
---|---|
void |
addResultAnnotations(PreflightResults results)
Adds the ResultRecords as Annotations to the document that was preflighted.
|
void |
appendPreflightReport(PreflightResults results,
int pageWidth,
int pageHeight)
Deprecated.
- use PDFPreflight.appendPreflightReport(PreflightResults, int, int, PreflightReportOptions)
|
void |
appendPreflightReport(PreflightResults results,
int pageWidth,
int pageHeight,
PreflightReportOptions reportOptions)
Appends the Preflight report to the document that was preflighted.
|
void |
close()
Close / release all resources held by this document.
|
PreflightResults |
convertDocument(ConversionProfile profile,
ProgressListener progress)
This method converts this document to make it compliant with the given profile.
|
DocumentInfo |
getDocumentInfo()
Gets the information for the document that was preflighted.
|
int |
getPageCount()
Get the number of pages in the document.
|
static String |
getVersion()
Returns version string for jPDFProcess.
|
static void |
loadLicense(InputStream licenseStream)
Method to load a license file from an inputstream.
|
static void |
loadLicense(String licenseFile)
Method to load a license file.
|
void |
saveDocument(OutputStream outStream)
Saves this document to an output stream.
|
void |
saveDocument(String fileName)
Saves this document to a file.
|
static boolean |
setKey(String key)
Method to unlock the production version of the library.
|
PreflightResults |
verifyDocument(VerificationProfile profile,
ProgressListener progress)
This method runs this document through a preflight profile and returns the results.
|
public PDFPreflight(String fileName, IPassword password) throws PDFException
fileName
- Name of the PDF file.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
public PDFPreflight(InputStream inStream, IPassword password) throws PDFException
inStream
- InputStream to read the PDF document.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
public PDFPreflight(URL url, IPassword password) throws PDFException
url
- Location of the PDF document.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
public PDFPreflight(PDFSource source, IPassword password) throws PDFException
source
- Source of the PDF document.password
- An object that provides passwords to open the document, leave null if not needed.
When working with documents that have no passwords, the host application should pass null for the
value of this parameter. When documents are known to have passwords, the host application should
pass an instance of the PDFPassword
class that can hold a single
password or a list of passwords.PDFException
public void close()
public PreflightResults verifyDocument(VerificationProfile profile, ProgressListener progress) throws PDFException, IOException
profile
- The profile to run.progress
- A progress listener that gets notified of the process progress. This is
an optional parameter and may be left nullIOException
PDFException
public PreflightResults convertDocument(ConversionProfile profile, ProgressListener progress) throws PDFException, IOException
profile
- The conversion profile to use in the conversion.progress
- An optional progress listener that gets notified of the process progress. This is
an optional parameter and may be left nullIOException
PDFException
public void addResultAnnotations(PreflightResults results) throws PDFException
results
- PreflightResults results object obtained by verifying (see verifyDocument(VerificationProfile, ProgressListener)
)
or converting (see convertDocument(ConversionProfile, ProgressListener)
) this document.PDFException
public void appendPreflightReport(PreflightResults results, int pageWidth, int pageHeight) throws PDFException, IOException
results
- PreflightResults results object obtained by verifying (see verifyDocument(VerificationProfile, ProgressListener)
)
or converting (see convertDocument(ConversionProfile, ProgressListener)
) this document.pageWidth
- Width of the report pages, in points. Points are defined to be 72 DPI so an 8.5 in x 11 in standard US Letter page
would have a width of 612, and a 210 mm x 297 mm standard European A4 page would have a width of 595.pageHeight
- Height of the report pages, in points. Points are defined to be 72 DPI so an 8.5 in x 11 in standard US Letter page
would have a height of 792, and a 210 mm x 297 mm standard European A4 page would have a height of 842.IOException
PDFException
public void appendPreflightReport(PreflightResults results, int pageWidth, int pageHeight, PreflightReportOptions reportOptions) throws PDFException, IOException
results
- PreflightResults results object obtained by verifying (see verifyDocument(VerificationProfile, ProgressListener)
)
or converting (see convertDocument(ConversionProfile, ProgressListener)
) this document.pageWidth
- Width of the report pages, in points. Points are defined to be 72 DPI so an 8.5 in x 11 in standard US Letter page
would have a width of 612, and a 210 mm x 297 mm standard European A4 page would have a width of 595.pageHeight
- Height of the report pages, in points. Points are defined to be 72 DPI so an 8.5 in x 11 in standard US Letter page
would have a height of 792, and a 210 mm x 297 mm standard European A4 page would have a height of 842.reportOptions
- PreflightReportOptions that determine the format of what to include in the reportIOException
PDFException
public void saveDocument(String fileName) throws IOException, PDFException
fileName
- Name of the file to save the document.IOException
PDFException
public void saveDocument(OutputStream outStream) throws IOException, PDFException
outStream
- OutputStream where the document will be written to.IOException
PDFException
public DocumentInfo getDocumentInfo()
public int getPageCount()
public static String getVersion()
public static boolean setKey(String key)
key
- Production key.public static void loadLicense(InputStream licenseStream) throws LicenseException
licenseStream
- The input stream for the license file contents.LicenseException
- If there are any problems with the license filepublic static void loadLicense(String licenseFile) throws LicenseException, IOException
licenseFile
- The full path to the license file.LicenseException
- If there are any problems with the license fileIOException