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 Annotationcopy(Document targetDocument, Annotation annotation)Copy an annotationRectanglegetBoundingBox()The location on the page (Getter)booleangetHidden()The annotation's visibility (Getter)java.lang.StringgetId()The annotation identifier (Getter)booleangetNoPrint()The annotation's visibility when printing (Getter)booleangetNoRotate()The annotation's rotation behavior (Getter)booleangetNoZoom()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 thetargetDocumenthas already been closedjava.lang.IllegalArgumentException- if thetargetDocumentis read-onlyjava.lang.IllegalArgumentException- if theannotationis not associated with an input documentjava.lang.IllegalArgumentException- if the document associated with theannotationobject 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- iftargetDocumentisnulljava.lang.IllegalArgumentException- ifannotationisnull
-
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)
Iftruethen 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)
Iftruethen 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)
Iftruethen 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)
Iftruethen 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
-
-