Package org.jpedal.io.annotation
Class ImageAnnotation
java.lang.Object
org.jpedal.io.annotation.WritableAnnotation
org.jpedal.io.annotation.ImageAnnotation
Class generates Image Annotations
Note: there is no such thing as an image annotation in the PDF spec, so this class generates a Rubber Stamp annotation with a custom AP stream containing the image.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jpedal.io.annotation.WritableAnnotation
WritableAnnotation.AnnotationType -
Constructor Summary
ConstructorsConstructorDescriptionImageAnnotation(int page, float x0, float y0, float x1, float y1, BufferedImage image) Image Annotation -
Method Summary
Modifier and TypeMethodDescriptiongetAPString(int parentObj) Returns the appearance stream object to write for this annotation.byte[][]getResources(int parentObj) Returns any extra objects, such as images, that this annotation's appearance needs.Methods inherited from class org.jpedal.io.annotation.WritableAnnotation
getFormObject, getNonStrokeColor, getPage, getPopupString, getStrokeColor, setNonStrokeColor, setStrokeColor, setTextSize
-
Constructor Details
-
ImageAnnotation
Image Annotation- Parameters:
page- the page number where annotation to be appeared (starting from 0)x0- pdf based min x pointy0- pdf based min y pointx1- pdf based max x pointy1- pdf based max y pointimage- the image to display
-
-
Method Details
-
getDictString
- Overrides:
getDictStringin classWritableAnnotation- Returns:
- Pdf specified dictionary string
-
getAPString
Description copied from class:WritableAnnotationReturns the appearance stream object to write for this annotation. Subclasses that have one reference it fromWritableAnnotation.getDictString(), so this must be called first. This implementation records the object number and returns null.- Overrides:
getAPStringin classWritableAnnotation- Parameters:
parentObj- object number the appearance stream will be written as- Returns:
- Pdf specified appearance stream object string, or null if there is none
-
getResources
public byte[][] getResources(int parentObj) Description copied from class:WritableAnnotationReturns any extra objects, such as images, that this annotation's appearance needs. They are written before the appearance stream, one object number each. This implementation records the object number and returns an empty array.- Overrides:
getResourcesin classWritableAnnotation- Parameters:
parentObj- object number the first resource will be written as- Returns:
- the resource objects to write, which may be empty
-