Code with Finding: |
class PdfAnnotation {
/**
* Add some free text to the document.
* @param writer
* @param rect
* @param contents
* @param defaultAppearance
* @return A PdfAnnotation
*/
public static PdfAnnotation createFreeText(PdfWriter writer, Rectangle rect, String contents, PdfContentByte defaultAppearance) {
PdfAnnotation annot = new PdfAnnotation(writer, rect);
annot.put(PdfName.SUBTYPE, PdfName.FREETEXT);
annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE));
annot.setDefaultAppearanceString(defaultAppearance);
return annot;
}
}
|