public class PDDocumentHandler extends Object implements Closeable
PDDocument
.Constructor and Description |
---|
PDDocumentHandler()
Creates a new handler with an empty underlying
PDDocument . |
PDDocumentHandler(org.apache.pdfbox.pdmodel.PDDocument document,
String password)
Creates a new handler using the given document as underlying
PDDocument . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
compressXrefStream(boolean compress)
Set compression of the XRef table on underlying
PDDocument . |
int |
getNumberOfPages() |
org.apache.pdfbox.pdmodel.PDPage |
getPage(int pageNumber) |
PDDocumentAccessPermission |
getPermissions() |
org.apache.pdfbox.pdmodel.PDDocument |
getUnderlyingPDDocument() |
org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences |
getViewerPreferences() |
void |
importPage(org.apache.pdfbox.pdmodel.PDPage page)
Import an existing page to the underlying
PDDocument |
void |
saveDecryptedPDDocument(File file)
Saves the underlying
PDDocument removing security from it. |
void |
savePDDocument(File file)
Saves the underlying
PDDocument to the given file. |
void |
setCreatorOnPDDocument()
set the creator on the underlying
PDDocument |
void |
setDocumentInformation(org.apache.pdfbox.pdmodel.PDDocumentInformation info)
Set the document information on the underlying
PDDocument |
void |
setPageLayoutOnDocument(PdfPageLayout layout)
Sets the given page layout on the underlying
PDDocument . |
void |
setPageModeOnDocument(PdfPageMode mode)
Sets the given page mode on the underlying
PDDocument . |
void |
setVersionOnPDDocument(PdfVersion version)
Sets the version on the underlying
PDDocument . |
void |
setViewerPreferences(org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences preferences) |
public PDDocumentHandler(org.apache.pdfbox.pdmodel.PDDocument document, String password) throws TaskIOException
PDDocument
.document
- password
- TaskIOException
public PDDocumentHandler()
PDDocument
.TaskIOException
public void setCreatorOnPDDocument()
PDDocument
public void setDocumentInformation(org.apache.pdfbox.pdmodel.PDDocumentInformation info)
PDDocument
info
- public PDDocumentAccessPermission getPermissions()
public void setPageLayoutOnDocument(PdfPageLayout layout)
PDDocument
.layout
- public void setPageModeOnDocument(PdfPageMode mode)
PDDocument
.mode
- public void setVersionOnPDDocument(PdfVersion version)
PDDocument
.version
- public void compressXrefStream(boolean compress)
PDDocument
.compress
- public org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences getViewerPreferences()
PDDocument
.public void setViewerPreferences(org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences preferences)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void saveDecryptedPDDocument(File file) throws TaskException
PDDocument
removing security from it.file
- TaskException
public void savePDDocument(File file) throws TaskException
PDDocument
to the given file.file
- TaskException
public int getNumberOfPages()
public org.apache.pdfbox.pdmodel.PDDocument getUnderlyingPDDocument()
public void importPage(org.apache.pdfbox.pdmodel.PDPage page) throws TaskIOException
PDDocument
page
- TaskIOException
public org.apache.pdfbox.pdmodel.PDPage getPage(int pageNumber)
Copyright © 2015. All Rights Reserved.