java - iText TextField on a Landscape page - Input text not rotated -
After
I am creating a PDF using iText and a blue flames to include form and text fields so that Users wanted to fill the PDF form
I have followed the example here:
And here:
By now, I have a TextField PDF's, and I can click the text.
I have two problems:
- To click on the TextFile Alignment Text field, I will need to place my mouse on the right side of the cell which I have also given to TextField How do I align the TextField with cell?
- Recorded text rotation Once I enter text, it is rotated on the rest page and 90 degrees is displayed. How do I set the rotation of this displayed text?
The rotation of the text entered is that I have the most worms I have tried to set the rotation on the cell and the text field but it has no effect.
Any suggestions?
Thanks
Here is my code:
int rotation = document.getPageSize (). GetRotation (); PdfFormField pdfForm = PdfFormField.createEmpty (docWriter); CoverSheetPdfForm.setFieldName ("form"); CoverSheetPdfForm.setRotate (rotation); ... cell = new PDFPCL (border line ("cell title:", TBL hightening font, "", border color)); Cell.setColspan (1); Cell.setPadding (5F); Cell.setBorderWidth (0f); Cell.setHorizontalAlignment (PdfPCell.ALIGN_LEFT); Cell.setMinimumHeight (100F); Textfield Textfield = New Textfield (Documenter, new rectangle (50, 50, rotation), "cell_text_field"); TextField.setFontSize (12); TextField.setRotation (rotation); TextField.setVisibility (TextField.VISIBLE); TextField.setBorderColor (BorderColor); TextField.setBorderWidth (BORDER_WIDTH); Cell.setCellEvent (New ChildFieldEvent (pdfForm, textField.getTextField (), 1, Rotation)); ..... docWriter.addAnnotation (pdfForm);
And ChildFieldEvent code that I borrowed from the example page, and added an additional parameter for rotation:
/ ** * A ChildFieldEvent makes . * @bottom parent's parents area * @ best child child field * @ ultimate padding a padding * @ ultimate rotation * / public childfill event (pdf formfield maternal, pdf formfield child, float padding, int rotation) {This parent = Child; This.kid = Child; This.padding = padding; this. Rotation = rotation; } / ** * Add parent to parent field and set coordinates of hair area. * @param cell * @param rect * @param cb * @see com.lowagie.text.pdf.PdfPCellEvent # cellLayout (com.lowagie.text.pdf.PdfPCell, * com.lowagie.text.Rectangle, com.lowagie Text.pdf.PdfContentByte []) * / @ Override Public Voice Cell Layout (PDFPCL Cell, Rectangle Rectocal, PDF Contactbit [CB] {{parent.addKid (child)); Child.sec widget (new rectangle (gesture reading), reading, gate, bottom (padding), rect. Meteite (padding), rect., Gate tech (padding), rotation), pdf ennation. } Hold (exception e) {new exception converter (e); }}
I have done some more testing and it looks like Ubuntu PDF fiewer Viewing the same file in Windows Adobe PDF Viewer (document viewer) is not rendering PDF correctly, the form looks okay.
I do more testing and report back.
Comments
Post a Comment