Either just draw the box there, or include it in the appearance stream of the field, see the first three lines here:

0 G
0.5 0.5 149 55.692 re
s
/Tx BMC
q
  1 1 148 54.692 re
  W
  n
  BT
    /Arial 8 Tf
    2 44.0475 Td
    (Lorem ) Tj
    24.896 0 Td
    (ipsum ) Tj

(...)

ET
Q
EMC


However this requires some understanding about the PDF specifications... the best is to look at the examples that create a PDF and write to the content stream.

Tilman


Am 05.08.2015 um 20:05 schrieb Kevin Ternes:
Right.  But that works only if the Highlight Existing Fields option on Adobe 
Reader is selected.
It seems like I could put a colored box around the field that would appear on 
the screen independent of the field.


-----Original Message-----
From: Tilman Hausherr [mailto:thaush...@t-online.de]
Sent: Wednesday, August 05, 2015 12:20 PM
To: users@pdfbox.apache.org
Subject: Re: Draw a colored box around a PDField?

Am 05.08.2015 um 18:00 schrieb Kevin Ternes:
For a given document and field name, it seems like a simple matter to draw a 
colored box around the contents of the field.  But I cannot figure out how to 
do it.  So far, I have the following.  But where do I go from here?

PDDocumentCatalog catalog = pdDocument.getDocumentCatalog();
PDAcroForm pdAcroForm = catalog.getAcroForm(); PDField pdField =
pdAcroForm.getField(fieldName); COSDictionary pdFieldDictionary =
pdField.getDictionary();

PDAnnotationTextMarkup pdatMarkup = new
PDAnnotationTextMarkup(PDAnnotationSquareCircle.SUB_TYPE_SQUARE);
pdatMarkup.setColour(borderPdGamma);

see the reply here:
http://qnalist.com/questions/4842300/form-elements-not-visible



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to