PdfAnnotation Underline

28 views Asked by At

I have completed highlight and reduction using itext library so now what i want is underline using itext library how to achieve this functionality can anyone help out from this.

In PdfAnnotation.java class i have seen this code in PdfAnnotation.java class,

public static final PdfName STYLE_UNDERLINE = PdfName.U;

public static final PdfName Underline = createDirectName("Underline");

case XfdfConstants.UNDERLINE:
                    PdfTextMarkupAnnotation pdfUnderlineAnnotation = new PdfTextMarkupAnnotation(XfdfObjectUtils.convertRectFromString(annotObject.getAttributeValue(XfdfConstants.RECT)),
                            PdfName.Underline, XfdfObjectUtils.convertQuadPointsFromCoordsString(annotObject.getAttributeValue(XfdfConstants.COORDS)));

                    addCommonAnnotationAttributes(pdfUnderlineAnnotation, annotObject);
                    addMarkupAnnotationAttributes(pdfUnderlineAnnotation, annotObject);

                    pdfDocument.getPage(Integer.parseInt(annotObject.getAttribute(XfdfConstants.PAGE).getValue()))
                            .addAnnotation(pdfUnderlineAnnotation);
                    break;     

so from this how to achieve underline functionalities.

0

There are 0 answers