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 Group
copyFromPage(Document targetDocument, Page page, PageCopyOptions options)
Create a group object from a page.static Group
create(Document targetDocument, Size size)
Create an empty group object.Content
getContent()
the group content.boolean
getIsolated()
the transparency isolation behavior (Getter)boolean
getKnockout()
the transparency knockout behavior (Getter)Size
getSize()
the size of the group.void
setIsolated(boolean value)
the transparency isolation behavior (Setter)void
setKnockout(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 thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifsize
isnull
-
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.getCopyLogicalStructure
is not set.java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if thepage
object is not associated with an input documentjava.lang.IllegalArgumentException
- if the document associated with thepage
object has already been closedjava.lang.IllegalArgumentException
- if the argumentoptions
hastoolbox.pdf.PageCopyOptions.getFormFields
set totoolbox.pdf.forms.FormFieldCopyStrategy.COPY
and thetargetDocument
contains form fields that have either been copied explicitly withtoolbox.pdf.forms.FieldNode.copy
or 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 argumentoptions
hastoolbox.pdf.PageCopyOptions.getUnsignedSignatures
set totoolbox.pdf.CopyStrategy.COPY
and thetargetDocument
contains form fields that have either been copied explicitly withtoolbox.pdf.forms.FieldNode.copy
or 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
- ifoptions
hastoolbox.pdf.PageCopyOptions.getCopyOutlineItems
set totrue
and thetargetDocument
contains outline items that have been copied explicitly withtoolbox.pdf.navigation.OutlineItem.copy
.java.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifpage
isnull
-
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
-
-