| Modifier and Type | Field and Description |
|---|---|
| private final PDFCloneUtility | |
| private static final boolean | |
| private static final Log | |
| private static final Set | |
| private final PDDocument |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public PDOptionalContentGroup | Returns: the optional content group that was generated for the form usagethe target page targetPage, PDFormXObject the form to place form, AffineTransform the transformation matrix that controls the placement of your form. You'll
need this if your page has a crop box different than the media box, or if these have negative
coordinates, or if you want to scale or adjust your form. transform, String the name for the layer/OCG to produce layerName)Places the given form over the existing content of the indicated page (like an overlay). |
| public PDDocument | |
| private void | importOcProperties(PDDocument
The source PDF document that contains the /OCProperties to be copied. srcDoc)Imports OCProperties from source document to target document so hidden layers can still be hidden after import. |
| public PDFormXObject | Returns: a Form XObject containing the original page's contentthe source PDF document that contains the page to be copied sourceDoc, int the 0-based page number of the page to be copied pageNumber)Imports a page from some PDF file as a Form XObject so it can be placed on another page in the target document. |
| public PDFormXObject | Returns: a Form XObject containing the original page's contentthe source PDF document that contains the page to be copied sourceDoc, PDPage the page in the source PDF document to be copied page)Imports a page from some PDF file as a Form XObject so it can be placed on another page in the target document. |
| private void | |
| public void | wrapInSaveRestore(PDPage
the page page)Some applications may not wrap their page content in a save/restore (q/Q) pair which can lead to problems with coordinate system transformations when content is appended. |
| cloner | back to summary |
|---|---|
| private final PDFCloneUtility cloner | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| PAGE_TO_FORM_FILTER | back to summary |
|---|---|
| private static final Set<String> PAGE_TO_FORM_FILTER | |
| targetDoc | back to summary |
|---|---|
| private final PDDocument targetDoc | |
| LayerUtility | back to summary |
|---|---|
| public LayerUtility(PDDocument targetDoc) Creates a new instance.
| |
| appendFormAsLayer | back to summary |
|---|---|
| public PDOptionalContentGroup appendFormAsLayer(PDPage targetPage, PDFormXObject form, AffineTransform transform, String layerName) throws IOException Places the given form over the existing content of the indicated page (like an overlay).
The form is enveloped in a marked content section to indicate that it's part of an
optional content group (OCG), here used as a layer. This optional group is returned and
can be enabled and disabled through methods on
You may want to call
| |
| getDocument | back to summary |
|---|---|
| public PDDocument getDocument() Returns the PDF document we work on.
| |
| importOcProperties | back to summary |
|---|---|
| private void importOcProperties(PDDocument srcDoc) throws IOException Imports OCProperties from source document to target document so hidden layers can still be hidden after import.
| |
| importPageAsForm | back to summary |
|---|---|
| public PDFormXObject importPageAsForm(PDDocument sourceDoc, int pageNumber) throws IOException Imports a page from some PDF file as a Form XObject so it can be placed on another page in the target document.
You may want to call
| |
| importPageAsForm | back to summary |
|---|---|
| public PDFormXObject importPageAsForm(PDDocument sourceDoc, PDPage page) throws IOException Imports a page from some PDF file as a Form XObject so it can be placed on another page in the target document.
You may want to call
| |
| transferDict | back to summary |
|---|---|
| private void transferDict(COSDictionary orgDict, COSDictionary targetDict, Set<String> filter) throws IOException | |
| wrapInSaveRestore | back to summary |
|---|---|
| public void wrapInSaveRestore(PDPage page) throws IOException Some applications may not wrap their page content in a save/restore (q/Q) pair which can lead to problems with coordinate system transformations when content is appended. This method lets you add a q/Q pair around the existing page's content.
| |