In Method: | createLine(PdfWriter, Rectangle, String, float, float, float, float) |
Code with Finding: |
class PdfAnnotation {
/**
* Adds a line to the document. Move over the line and a tooltip is shown.
* @param writer
* @param rect
* @param contents
* @param x1
* @param y1
* @param x2
* @param y2
* @return A PdfAnnotation
*/
public static PdfAnnotation createLine(PdfWriter writer, Rectangle rect, String contents, float x1, float y1, float x2, float y2) {
PdfAnnotation annot = new PdfAnnotation(writer, rect);
annot.put(PdfName.SUBTYPE, PdfName.LINE);
annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE));
PdfArray array = new PdfArray(new PdfNumber(x1));
array.add(new PdfNumber(y1));
array.add(new PdfNumber(x2));
array.add(new PdfNumber(y2));
annot.put(PdfName.L, array);
return annot;
}
}
|