public interface MutableDocument
Modifier and Type | Method and Description |
---|---|
void |
deletePage(int pageIndex)
Delete a page in the document.
|
void |
deletePages(int startIndex,
int endIndex)
Deletes a range of pages in the document.
|
void |
exportAnnotsAsFDF(OutputStream outStream,
String pathToPDFFile,
Set<Annotation> annotSet)
Export the set of annotation comments to an output stream in FDF format.
|
void |
exportAnnotsAsFDF(String fileName,
Set<Annotation> annotSet)
Exports annotation comments in FDF format.
|
void |
exportAnnotsAsXFDF(OutputStream outStream,
String pathToPDFFile,
Set<Annotation> annotSet)
Export annotations comments to an output stream in XFDF format.
|
void |
exportAnnotsAsXFDF(String fileName,
Set<Annotation> annotSet)
Exports annotations comments in XFDF format to a file.
|
void |
extractPages(int startIndex,
int endIndex,
OutputStream outStream)
Creates and saves a new PDF document that contains a range of pages from this document.
|
void |
extractPages(int startIndex,
int endIndex,
String outputFile)
Creates and saves a new PDF document that contains a range of pages from this document.
|
void |
flattenAnnotation(Annotation annot,
int pageIndex)
Flattens a single annotation into the content layer.
|
void |
flattenAnnotations()
Flatten the annotations on this document into the content layer.
|
void |
flattenAnnotations(int pageIndex)
Flatten the annotations on a page into the content layer.
|
void |
flattenFields(boolean paintButtons,
boolean paintNonPrintableFields)
Flattens all the fields in a document.
|
IAnnotationFactory |
getAnnotationFactory()
Returns the AnnotationFactory for this document.
|
int |
getPageRotation(int pageIndex)
Gets the page rotation value, in degrees.
|
void |
importAnnotsFromFDF(InputStream inStream)
Import annotations comments from an input stream in FDF format.
|
void |
importAnnotsFromFDF(String fileName)
Import annotations comments from a file in XFDF Format.
|
void |
importAnnotsFromXFDF(InputStream inStream)
Import annotations comments from an input stream in XFDF format.
|
void |
importAnnotsFromXFDF(String fileName)
Import annotations comments from a file in FDF Format.
|
void |
insertPage(String inputFile,
int targetIndex)
Insert all pages into this document from another document.
|
void |
insertPages(String inputFile,
int srcStartIndex,
int srcEndIndex,
int targetIndex)
Insert pages into this document from another document.
|
void |
movePage(int fromIndex,
int toIndex)
Moves a page in a document.
|
void |
setPageRotation(int pageIndex,
int degrees)
Sets the page rotation value for a page.
|
void deletePage(int pageIndex) throws PDFException
pageIndex
- The page of interest.PDFException
void deletePages(int startIndex, int endIndex) throws PDFException
startIndex
- The first page to delete.endIndex
- The last page to delete, inclusive.PDFException
void setPageRotation(int pageIndex, int degrees) throws PDFException
pageIndex
- The index of the page to modify.degrees
- The new rotation for the page, in degrees.PDFException
int getPageRotation(int pageIndex) throws PDFException
pageIndex
- The page of interest.PDFException
void movePage(int fromIndex, int toIndex) throws PDFException
fromIndex
- The index of the page to move.toIndex
- The index of the new location of the pagePDFException
void extractPages(int startIndex, int endIndex, String outputFile) throws IOException, PDFException
startIndex
- The first page to include in the new document.endIndex
- The last page to include in the new document.outputFile
- The path to the file to save the PDF document in.IOException
- Any errors writing the filePDFException
- Any errors extracting the pagesvoid extractPages(int startIndex, int endIndex, OutputStream outStream) throws IOException, PDFException
startIndex
- The first page to include in the new document.endIndex
- The last page to include in the new document.outStream
- The output stream to write the resulting PDF to.IOException
- Any errors writing the filePDFException
- Any errors extracting the pagesvoid insertPages(String inputFile, int srcStartIndex, int srcEndIndex, int targetIndex) throws PDFException
inputFile
- The path to the PDF file to get pages from.srcStartIndex
- The first page from the input file to insert, inclusive.srcEndIndex
- The last page from the input file to insert, inclusive.targetIndex
- The location on the current document where the pages will be inserted.PDFException
void insertPage(String inputFile, int targetIndex) throws PDFException
inputFile
- The path to the PDF file to get pages from.targetIndex
- The location on the current document where the pages will be inserted.PDFException
void flattenAnnotations() throws PDFException
PDFException
void flattenAnnotations(int pageIndex) throws PDFException
pageIndex
- The index of the page (0 based) on which to flatten the annotations.PDFException
void flattenAnnotation(Annotation annot, int pageIndex) throws PDFException
annot
- The annotation to flatten.pageIndex
- The index of the page (0 based) on which the annotation is located.PDFException
void flattenFields(boolean paintButtons, boolean paintNonPrintableFields) throws PDFException
paintButtons
- Flag to indicate whether buttons should be flattened into the content. If false,
buttons will be removed. If true, buttons will become part of the content.paintNonPrintableFields
- Flag to indicate whether fields flagged as non-printable should be
flattened or removed.PDFException
void exportAnnotsAsXFDF(OutputStream outStream, String pathToPDFFile, Set<Annotation> annotSet) throws PDFException, IOException
outStream
- The output stream to write the data to.pathToPDFFile
- is the relative path from the xfdf file to the pdf file name.
This parameter can be left null. This parameter is used to
fill the pdf file name entry in the XFDF file, the file entry
will be set to pathToPDFFile + fileName The file entry is used
when you open an xfdf file to be able to locate the
corresponding pdf file. Example of pathToPDFFile
../qoppa/mydirannotSet
- The set of annotations to export. If annotSet is not null,
only the annotations contained in the set will be exported.
Otherwise, all annotations will be exported.PDFException
IOException
void exportAnnotsAsFDF(String fileName, Set<Annotation> annotSet) throws PDFException
fileName
- The name of the file to export the data to.annotSet
- The set of annotations to export. If annotSet is not null,
only the annotations contained in the set will be exported.
Otherwise, all annotations will be exported.PDFException
void exportAnnotsAsXFDF(String fileName, Set<Annotation> annotSet) throws PDFException
fileName
- The name of the file to export the data to.annotSet
- The set of annotations to export. If annotSet is not null,
only the annotations contained in the set will be exported.
Otherwise, all annotations will be exported.PDFException
void exportAnnotsAsFDF(OutputStream outStream, String pathToPDFFile, Set<Annotation> annotSet) throws PDFException, IOException
outStream
- The output stream to write the data to.pathToPDFFile
- is the relative path from the FDF file to the PDF file name.
This parameter can be left null. This parameter is used to
fill the PDF file name entry in the FDF file, the file entry
will be set to pathToPDFFile + fileName. The file entry is
used when you open an FDF file to be able to locate the
corresponding PDF file. Example of pathToPDFFile
../qoppa/mydirannotSet
- The set of annotations to export. If annotSet is not null,
only the annotations contained in the set will be exported.
Otherwise, all annotations will be exported.PDFException
IOException
void importAnnotsFromXFDF(String fileName) throws PDFException
fileName
- The name of the FDF file to import the data from.PDFException
void importAnnotsFromXFDF(InputStream inStream) throws PDFException
inStream
- The input stream in XFDF format to read the data from.PDFException
void importAnnotsFromFDF(String fileName) throws PDFException
fileName
- The name of the XFDF file to import the data from.PDFException
void importAnnotsFromFDF(InputStream inStream) throws PDFException
inStream
- The input stream in FDF format to read the data from.PDFException
IAnnotationFactory getAnnotationFactory()