Package com.pdftools.toolbox.pdf.content
Class Group
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.content.Group
-
public class Group extends NativeObject
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GroupcopyFromPage(Document targetDocument, Page page, PageCopyOptions options)Create a group object from a page.static Groupcreate(Document targetDocument, Size size)Create an empty group object.ContentgetContent()the group content.booleangetIsolated()the transparency isolation behavior (Getter)booleangetKnockout()the transparency knockout behavior (Getter)SizegetSize()The size of the group.voidsetIsolated(boolean value)the transparency isolation behavior (Setter)voidsetKnockout(boolean value)the transparency knockout behavior (Setter)-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static Group create(Document targetDocument, Size size)
Create an empty group object.
The returned group object is not yet used on any page, but it is associated with the given target document.- Parameters:
targetDocument- the output document with which the returned object is associatedsize- the size of the group- Returns:
- the newly created group object
- Throws:
java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifsizeisnull
-
copyFromPage
public static Group copyFromPage(Document targetDocument, Page page, PageCopyOptions options) throws java.io.IOException, CorruptException, ConformanceException
Create a group object from a page.
From a given page in an input document, create a group object in the given target document. The returned object is associated with the target document but not yet part of it.
A group that contains interactive elements can be painted once only. Interactive elements are annotations, group fields, outlines or logical structure information. If a group needs to be painted multiple times, interactive elements can be flattened or the group can be copied multiple times from the page.
There are some interactive elements such as form fields or text annotations that cannot be rotated. So if you plan to rotate the group, it is recommended to flatten form fields and annotations.
- Parameters:
targetDocument- the output document with which the returned object is associatedpage- a page of a different documentoptions- the copy options- Returns:
- the copied group, associated with the current document.
- Throws:
java.io.IOException- Error reading from the input document or writing to the output documentCorruptException- The input document is corruptConformanceException- The conformance level of the source document is not compatible with the conformance level of the target document.ConformanceException- The explicitly requested conformance level is PDF/A Level A (toolbox.pdf.Conformance.PDF_A1_A,toolbox.pdf.Conformance.PDF_A2_A, ortoolbox.pdf.Conformance.PDF_A3_A) and the copy optiontoolbox.pdf.PageCopyOptions.getCopyLogicalStructureis not set.java.lang.IllegalArgumentException- if thetargetDocumentargument has already been closedjava.lang.IllegalArgumentException- if thetargetDocumentargument is read-onlyjava.lang.IllegalArgumentException- if thepageobject is not associated with an input documentjava.lang.IllegalArgumentException- if the document associated with thepageobject has already been closedjava.lang.IllegalArgumentException- if the argumentoptionshastoolbox.pdf.PageCopyOptions.getFormFieldsset totoolbox.pdf.forms.FormFieldCopyStrategy.COPYand thetargetDocumentcontains form fields that have either been copied explicitly withtoolbox.pdf.forms.FieldNode.copyor created withtoolbox.pdf.forms.CheckBox.create,toolbox.pdf.forms.ComboBox.create,toolbox.pdf.forms.CombTextField.create,toolbox.pdf.forms.GeneralTextField.create,toolbox.pdf.forms.ListBox.create,toolbox.pdf.forms.RadioButtonGroup.create, ortoolbox.pdf.forms.SubForm.create.java.lang.IllegalArgumentException- if the argumentoptionshastoolbox.pdf.PageCopyOptions.getUnsignedSignaturesset totoolbox.pdf.CopyStrategy.COPYand thetargetDocumentcontains form fields that have either been copied explicitly withtoolbox.pdf.forms.FieldNode.copyor created withtoolbox.pdf.forms.CheckBox.create,toolbox.pdf.forms.ComboBox.create,toolbox.pdf.forms.CombTextField.create,toolbox.pdf.forms.GeneralTextField.create,toolbox.pdf.forms.ListBox.create,toolbox.pdf.forms.RadioButtonGroup.create, ortoolbox.pdf.forms.SubForm.create.java.lang.IllegalArgumentException- ifoptionshastoolbox.pdf.PageCopyOptions.getCopyOutlineItemsset totrueand thetargetDocumentcontains outline items that have been copied explicitly withtoolbox.pdf.navigation.OutlineItem.copy.java.lang.IllegalArgumentException- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifpageisnull
-
getSize
public Size getSize()
The size of the group. (Getter)
- Throws:
java.lang.IllegalStateException- if the group has already been closed
-
getContent
public Content getContent()
the group content. (Getter)
If the group is writable, the content object can be used to apply new content on the group.- Throws:
java.lang.IllegalStateException- if the group has already been closed
-
getIsolated
public boolean getIsolated()
the transparency isolation behavior (Getter)
- Throws:
java.lang.IllegalStateException- if the group has already been closed
-
setIsolated
public void setIsolated(boolean value)
the transparency isolation behavior (Setter)
- Throws:
java.lang.IllegalStateException- if the group has already been closedjava.lang.IllegalStateException- if the group has already been paintedjava.lang.UnsupportedOperationException- The document is read-only
-
getKnockout
public boolean getKnockout()
the transparency knockout behavior (Getter)
- Throws:
java.lang.IllegalStateException- if the group has already been closed
-
setKnockout
public void setKnockout(boolean value)
the transparency knockout behavior (Setter)
- Throws:
java.lang.IllegalStateException- if the group has already been closedjava.lang.IllegalStateException- if the group has already been paintedjava.lang.UnsupportedOperationException- The document is read-only
-
-