![]() PushbuttonField resetBtn = new PushbuttonField(writer, ![]() createSubmitForm("",null, PdfAction.SUBMIT_HTML_FORMAT)) Ĭell.setCellEvent(new FieldCell(submitField, 35, writer)) PdfFormField submitField = submitBtn.getField() SetBorderStyle(PdfBorderDictionary.STYLE_BEVELED) PushbuttonField submitBtn = new PushbuttonField(writer, "var ageField = this.getField('ageField') " + TextField ageComb = new TextField(writer, new Rectangle(0,ĪtBorderStyle(PdfBorderDictionary.STYLE_SOLID) ĪtAlignment(Element.ALIGN_RIGHT) Ĭell.setCellEvent(new FieldCell(ageComb.getTextField(), "var nameField = this.getField('nameField') " + tOptions(TextField.REQUIRED) Ĭell.setCellEvent(new FieldCell(nameField.getTextField(), tBorderStyle(PdfBorderDictionary.STYLE_SOLID) TextField nameField = new TextField(writer, tHorizontalAlignment(Element.ALIGN_LEFT) Table.getDefaultCell().setPadding(5f) // Code 1 ![]() New FileOutputStream("E:/TextFieldForm.pdf")) PdfWriter writer = PdfWriter.getInstance(document, if the text does not fit inside it will be cropped this are the coordinates where you want to add text PdfContentByte content = stamper.getOverContent(1) ĬolumnText ct = new ColumnText( content ) PdfStamper stamper = new PdfStamper( fondo, response.getOutputStream()) PdfReader fondo = new PdfReader("listaPrecios.pdf") ![]() It depends the amount of text you want to add. There is another solution much simpler, and solves your problem. This does not happen in Chrome or Firefox. If not you are going to see the PDF code in the screen. Note: if you are using IExplorer you must submit a HTTP form with POST method to be able to download the file. I'm using JBoss and this code is inside a JSP file (should work in any JSP webserver). This is the most complicated scenario I can imagine: I have a PDF file created with Ilustrator and modified with Acrobat to have AcroFields (AcroForm) that I'm going to fill with data with this Java code, the result of that PDF file with the data in the fields is modified adding a Document.Īctually in this case I'm dynamically generating a background that is added to a PDF that is also dynamically generated with a Document with an unknown amount of data or pages. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |