Class Annotation
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.annotations.Annotation
-
- Direct Known Subclasses:
MarkupAnnotation
public class Annotation extends NativeObject
A page annotation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Annotation
copy(Document targetDocument, Annotation annotation)
Copy an annotationRectangle
getBoundingBox()
The location on the page (Getter)boolean
getHidden()
The annotation's visibility (Getter)java.lang.String
getId()
The annotation identifier (Getter)boolean
getNoPrint()
The annotation's visibility when printing (Getter)boolean
getNoRotate()
The annotation's rotation behavior (Getter)boolean
getNoZoom()
The annotation's scaling behavior (Getter)-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
copy
public static Annotation copy(Document targetDocument, Annotation annotation) throws java.io.IOException, ConformanceException
Copy an annotation
Copy an annotation object from an input document to the giventargetDocument
. The returned object is associated with the given target document but not yet part of it.- Parameters:
targetDocument
- the output document with which the returned object is associatedannotation
- the annotation to be copied to thetargetDocument
- Returns:
- the copied annotation, associated with the
targetDocument
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
is read-onlyjava.lang.IllegalArgumentException
- if theannotation
is not associated with an input documentjava.lang.IllegalArgumentException
- if the document associated with theannotation
object has already been closedConformanceException
- The conformance level of the input document is not compatible with the conformance level of thetargetDocument
.java.io.IOException
- Error reading from the input document or writing to the output documentjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifannotation
isnull
-
getBoundingBox
public Rectangle getBoundingBox() throws CorruptException
The location on the page (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closedCorruptException
- if the PDF is corrupt
-
getHidden
public boolean getHidden()
The annotation's visibility (Getter)
Iftrue
then the annotation is present, but is invisible and not available for user interaction. Depending on thegetNoPrint()
property it will, however, still be visible when printing.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getNoPrint
public boolean getNoPrint()
The annotation's visibility when printing (Getter)
Iftrue
then the annotation is not present in a print output of the document.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getNoZoom
public boolean getNoZoom()
The annotation's scaling behavior (Getter)
Iftrue
then the annotation's visual appearance does not scale with the zoom factor of a PDF viewer.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getNoRotate
public boolean getNoRotate()
The annotation's rotation behavior (Getter)
Iftrue
then the annotation's visual appearance does not rotate with the rotation set in a PDF viewer.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getId
public java.lang.String getId()
The annotation identifier (Getter)
A text string uniquely identifying it among all the annotations on its page. When creating annotations using the SDK, a unique ID is set automatically.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
-