I already know how to get a field's positions, name, font/size and horiz
alignment.
I need to get a field's internal text margins (left, right, top, bottom) and
vertical alignment. Is this possible?
I am replacing a field which may have kerning/spacing applied to it from an
outside source, so I need to flatten it and then use this method to show it:
* canvas.showTextAlignedKerned(0, "replaced text goes here",
pos.position.getLeft(????),
pos.position.getBottom(????),pos.position.getRotation());*
Here is my complete section of code:
*PdfReader pdfi=new PdfReader(filein);*
*PdfStamper stamper=new PdfStamper(pdfi,new FileOutputStream(fileout));*
*AcroFields flds=stamper.getAcroFields();*
*if (flds.getFields().size()>0){*
* **flds.setField("Name", "");** /// blank it out. In the future will just
remove this widget. *
* **FieldPosition pos=flds.getFieldPositions("Name").get(0);** ** *
* **BaseFont bf1 = BaseFont.createFont(*
* **BaseFont.TIMES_ITALIC, BaseFont.WINANSI, BaseFont.EMBEDDED);*
* *
* **PdfContentByte canvas = stamper.getOverContent(1);*
* **stamper.setFormFlattening(true);*
* **canvas.beginText();*
* **canvas.setFontAndSize(bf1, 12);*
* **canvas.setCharacterSpacing(5);*
*
*
* **canvas.showTextAlignedKerned(0, "replaced text goes here",
pos.position.getLeft(2),
pos.position.getBottom(4),pos.position.getRotation());*
*
*
* **canvas.endText();*
*}*
*stamper.close(); *
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php