public class PdfDocument extends Object implements Validatable
PdfDocument(InputStream)| Constructor and Description |
|---|
PdfDocument(InputStream inputStream)
Creates PDF document from
InputStream |
| Modifier and Type | Method and Description |
|---|---|
PdfBasicSignature |
addSignature()
Adds a new signature to the document with default properties.
|
PdfBasicSignature |
addSignature(Map<String,String> map)
Adds a new signature to the document with specified properties.
|
void |
close()
Cleans all temporary files and frees resources.
|
int |
getPageCount()
Returns the number of pages in this PDF document.
|
List<PdfPageProperties> |
getPageProperties()
Returns the properties of all of the pages in this PDF document.
|
PdfPageProperties |
getPageProperties(int index)
Returns the properties of the given page in this PDF document.
|
PdfDocumentProperties |
getProperties()
Returns the properties of this PDF document.
|
int |
getSignatureCount()
Returns count of signatures of the document.
|
List<PdfSignature> |
getSignatures()
Returns the signatures in this PDF document.
|
float |
getVersion()
Returns the PDF specification version this document conforms to.
|
File |
getWorkingFile()
Returns a File for reading working data from this PdfDocument.
|
void |
removeSignature(PdfSignature signature)
Removes last signature from the document.
|
ValidationResult |
validate()
Validates this object.
|
ValidationResult |
validate(ValidationPolicy validationPolicy) |
void |
writeTo(File file)
Writes the document content to the given output file.
|
void |
writeTo(OutputStream out)
Writes the document content to the given output stream.
|
public PdfDocument(InputStream inputStream) throws PdfException
InputStreaminputStream - PDF documentPdfExceptionpublic float getVersion()
public PdfDocumentProperties getProperties()
public int getPageCount()
public List<PdfPageProperties> getPageProperties() throws PdfException
PdfExceptionpublic PdfPageProperties getPageProperties(int index) throws PdfException
PdfExceptionpublic int getSignatureCount()
throws PdfException
PdfExceptionpublic List<PdfSignature> getSignatures() throws PdfException
PdfExceptionpublic PdfBasicSignature addSignature() throws PdfException
PdfExceptionpublic PdfBasicSignature addSignature(Map<String,String> map) throws PdfException
map - properties.PdfExceptionpublic void removeSignature(PdfSignature signature) throws PdfException
PdfExceptionpublic void writeTo(OutputStream out) throws PdfException
out - output stream.PdfExceptionpublic void writeTo(File file) throws PdfException
file - output file.PdfExceptionpublic void close()
throws PdfException
PdfExceptionpublic ValidationResult validate()
Validatablevalidate in interface Validatablepublic ValidationResult validate(ValidationPolicy validationPolicy)
validate in interface Validatablepublic File getWorkingFile()
NOTE: Do not modify the underlying file, as it will corrupt the PDF integrity!