public class Group extends NativeObject
Modifier and Type | Method and 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.
|
static Group |
createDynamicObject(long handle) |
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)
|
equals, hashCode
public static Group createDynamicObject(long handle)
public static Group create(Document targetDocument, Size size)
targetDocument
- the output document with which the returned object is associatedsize
- the size of the groupjava.lang.IllegalArgumentException
- if the targetDocument
argument is null
java.lang.IllegalArgumentException
- if the targetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if the targetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if size
is null
public static Group copyFromPage(Document targetDocument, Page page, PageCopyOptions options) throws java.io.IOException, CorruptException, ConformanceException
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.
targetDocument
- the output document with which the returned object is associatedpage
- a page of a different documentoptions
- the copy optionsjava.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
(pdftoolbox.pdf.Conformance.PDF_A1_A
, pdftoolbox.pdf.Conformance.PDF_A2_A
,
or pdftoolbox.pdf.Conformance.PDF_A3_A
)
and the copy option pdftoolbox.pdf.PageCopyOptions.getCopyLogicalStructure
is not set.java.lang.IllegalArgumentException
- if the targetDocument
argument is null
java.lang.IllegalArgumentException
- if the targetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if the targetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- if the page
object is not associated with an input documentjava.lang.IllegalArgumentException
- if the argument options
has pdftoolbox.pdf.PageCopyOptions.getFormFields
set to pdftoolbox.pdf.forms.FormFieldCopyStrategy.COPY
and the targetDocument
contains form fields that have either been copied explicitly
with pdftoolbox.pdf.forms.FieldNode.copy
or created with pdftoolbox.pdf.forms.CheckBox.create
,
pdftoolbox.pdf.forms.ComboBox.create
, pdftoolbox.pdf.forms.CombTextField.create
,
pdftoolbox.pdf.forms.GeneralTextField.create
, pdftoolbox.pdf.forms.ListBox.create
,
pdftoolbox.pdf.forms.RadioButtonGroup.create
, or pdftoolbox.pdf.forms.SubForm.create
.java.lang.IllegalArgumentException
- if the argument options
has pdftoolbox.pdf.PageCopyOptions.getUnsignedSignatures
set to pdftoolbox.pdf.CopyStrategy.COPY
and the targetDocument
contains form fields that have either been copied explicitly
with pdftoolbox.pdf.forms.FieldNode.copy
or created with pdftoolbox.pdf.forms.CheckBox.create
,
pdftoolbox.pdf.forms.ComboBox.create
, pdftoolbox.pdf.forms.CombTextField.create
,
pdftoolbox.pdf.forms.GeneralTextField.create
, pdftoolbox.pdf.forms.ListBox.create
,
pdftoolbox.pdf.forms.RadioButtonGroup.create
, or pdftoolbox.pdf.forms.SubForm.create
.java.lang.IllegalArgumentException
- if options
has pdftoolbox.pdf.PageCopyOptions.getCopyOutlineItems
set to true
and the targetDocument
contains outline items that have been copied explicitly
with pdftoolbox.pdf.navigation.OutlineItem.copy
.java.lang.IllegalArgumentException
- if the page
argument is null
java.lang.IllegalArgumentException
- if the page
object has already been closedpublic Size getSize()
java.lang.IllegalStateException
- if the group has already been closedpublic Content getContent()
java.lang.IllegalStateException
- if the group has already been closedpublic boolean getIsolated()
java.lang.IllegalStateException
- if the group has already been closedpublic void setIsolated(boolean value)
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-onlypublic boolean getKnockout()
java.lang.IllegalStateException
- if the group has already been closedpublic void setKnockout(boolean value)
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