public TextAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary) { super(ctx, annotDictionary); this.pdText = new PDAnnotationText(annotDictionary); this.pdAnnot = this.pdText; }
/** * Constructor. */ public PDAnnotationText() { getCOSObject().setName(COSName.SUBTYPE, SUB_TYPE); }
private PDRectangle adjustRectAndBBox(PDAnnotationText annotation, float width, float height) { // For /Note (other types have different values): // Adobe takes the left upper bound as anchor, and adjusts the rectangle to 18 x 20. // Observed with files 007071.pdf, 038785.pdf, 038787.pdf, // but not with 047745.pdf p133 and 084374.pdf p48, both have the NoZoom flag. // there the BBox is also set to fixed values, but the rectangle is left untouched. // When no flags are there, Adobe sets /F 24 = NoZoom NoRotate. PDRectangle rect = getRectangle(); PDRectangle bbox; if (!annotation.isNoZoom()) { rect.setUpperRightX(rect.getLowerLeftX() + width); rect.setLowerLeftY(rect.getUpperRightY() - height); annotation.setRectangle(rect); } if (!annotation.getCOSObject().containsKey(COSName.F)) { // We set these flags because Adobe does so, but PDFBox doesn't support them when rendering. annotation.setNoRotate(true); annotation.setNoZoom(true); } bbox = new PDRectangle(width, height); annotation.getNormalAppearanceStream().setBBox(bbox); return bbox; }
if (!SUPPORTED_NAMES.contains(annotation.getName())) setOpacity(contentStream, annotation.getConstantOpacity()); switch (annotation.getName())
/** * This will set the annotation state. * * @param state the annotation state */ public void setState(String state) { this.getCOSObject().setString(COSName.STATE, state); }
annot = new PDAnnotationText(annotDic);
/** * This will retrieve the annotation state model. * * @return the annotation state model */ public String getStateModel() { return this.getCOSObject().getString(COSName.STATE_MODEL); }
public TextAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary) { super(ctx, annotDictionary); this.pdText = new PDAnnotationText(annotDictionary); this.pdAnnot = this.pdText; }
/** * This will retrieve the name (and hence appearance, AP taking precedence) For this annotation. The default is * NOTE. * * @return The name of this annotation, see the NAME_XXX constants. */ public String getName() { return getCOSObject().getNameAsString(COSName.NAME, NAME_NOTE); }
public TextAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary) { super(ctx, annotDictionary); this.pdText = new PDAnnotationText(annotDictionary); this.pdAnnot = this.pdText; }
/** * This will set the annotation state model. Allowed values are "Marked" and "Review" * * @param stateModel the annotation state model */ public void setStateModel(String stateModel) { this.getCOSObject().setString(COSName.STATE_MODEL, stateModel); }
annot = new PDAnnotationText(annotDic);
/** * This will retrieve the annotation state. * * @return the annotation state */ public String getState() { return this.getCOSObject().getString(COSName.STATE); }
annot = new PDAnnotationText(annotDic);
/** * This will set the name (and hence appearance, AP taking precedence) For this annotation. See the NAME_XXX * constants for valid values. * * @param name The name of the annotation */ public void setName(String name) { getCOSObject().setName(COSName.NAME, name); }
/** * This will set initial state of the annotation, open or closed. * * @param open Boolean value, true = open false = closed */ public void setOpen(boolean open) { getCOSObject().setBoolean(COSName.getPDFName("Open"), open); }
/** * This will retrieve the initial state of the annotation, open Or closed (default closed). * * @return The initial state, true = open false = closed */ public boolean getOpen() { return getCOSObject().getBoolean(COSName.getPDFName("Open"), false); }
/** * This will retrieve the annotation state. * * @return the annotation state */ public String getState() { return this.getCOSObject().getString(COSName.STATE); }
/** * This will set the name (and hence appearance, AP taking precedence) For this annotation. See the NAME_XXX * constants for valid values. * * @param name The name of the annotation */ public void setName(String name) { getCOSObject().setName(COSName.NAME, name); }
/** * This will retrieve the annotation state model. * * @return the annotation state model */ public String getStateModel() { return this.getCOSObject().getString(COSName.STATE_MODEL); }