Class Group
- java.lang.Object
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeBase
-
- com.pdf_tools.fourheights.pdftoolbox.internal.NativeObject
-
- com.pdf_tools.fourheights.pdftoolbox.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.pdf_tools.fourheights.pdftoolbox.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 (pdftoolbox.pdf.Conformance.PDF_A1_A
,pdftoolbox.pdf.Conformance.PDF_A2_A
, orpdftoolbox.pdf.Conformance.PDF_A3_A
) and the copy optionpdftoolbox.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
haspdftoolbox.pdf.PageCopyOptions.getFormFields
set topdftoolbox.pdf.forms.FormFieldCopyStrategy.COPY
and thetargetDocument
contains form fields that have either been copied explicitly withpdftoolbox.pdf.forms.FieldNode.copy
or created withpdftoolbox.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
, orpdftoolbox.pdf.forms.SubForm.create
.java.lang.IllegalArgumentException
- if the argumentoptions
haspdftoolbox.pdf.PageCopyOptions.getUnsignedSignatures
set topdftoolbox.pdf.CopyStrategy.COPY
and thetargetDocument
contains form fields that have either been copied explicitly withpdftoolbox.pdf.forms.FieldNode.copy
or created withpdftoolbox.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
, orpdftoolbox.pdf.forms.SubForm.create
.java.lang.IllegalArgumentException
- ifoptions
haspdftoolbox.pdf.PageCopyOptions.getCopyOutlineItems
set totrue
and thetargetDocument
contains outline items that have been copied explicitly withpdftoolbox.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
-
-