Am 07.02.2016 um 09:45 schrieb Tilman Hausherr:
Am 07.02.2016 um 09:07 schrieb Глеб Г.Г.:
Hello PDFbox Users!
Is it possible to get visible signature position on page of previously
signed PDF file?
I am using version 2.0.0 rc3.
Best Regards.



Go through all fields, find the ones that have the type "Sig", then get the "Rect" element.

To see what I mean, start PDFDebugger, switch to "show internal structure", and enter this:

Root/AcroForm/Fields/[0]/Rect/[0]

This may or may not be a signature field. If it isn't, try the other fields.

Here's some code (error handling omitted):

        PDDocument doc = PDDocument.load(new File("...."));
List<PDField> fields = doc.getDocumentCatalog().getAcroForm().getFields();
        for (PDField field : fields)
        {
            if ("Sig".equals(field.getFieldType()))
            {
System.out.println(field.getWidgets().get(0).getRectangle());
            }
        }
        doc.close();


running it with the file from https://issues.apache.org/jira/browse/PDFBOX-2282 brings this output:


[68.52,567.84,245.64,626.04]
[68.88,391.56,246.12,449.76]
[68.88,186.48,246.12,244.68]
[348.72,187.08,525.84,245.28]
[0.0,0.0,456.0,112.0]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to