acrofields

getting null when call acroform.getFields() using pdfbox

懵懂的女人 提交于 2019-12-10 20:21:58
问题 I tried to get All the fields available in pdf form but I'm encountering a NullPointerException when calling acroform.getFields() using PDFBox. Sample: pdDoc = PDDocument.load(fileName); PDAcroForm form = pdDoc.getDocumentCatalog().getAcroForm(); if(form!=null) { List<PDField> field = form.getFields(); //here I am getting null pointer exception } 回答1: this is because your pdf if not contain any acroform 回答2: form is not null , but that doesn't mean it is not empty . Check this instead: if

AcroField changes made using itext7 in C# do not commit/are not visable due to hybrid AcroForm-XFA issues

北战南征 提交于 2019-12-10 11:47:23
问题 Project is to fill existing forms programmatically from a database/datagridview and allow the user to edit the forms afterwards as the database does not hold all values needed. I am able to get the values, and put them into the form however: Values set using AcroForms do not show/print when viewing form. Background color change does not show when viewing form. Both changes appear when clicking into the field. I understand this is caused by hybrid XFA and AcroForms issues, and that pdfXFA is a

Issue with iText RadioCheckField when displayed on multiple pages

烈酒焚心 提交于 2019-12-07 18:56:52
问题 I am creating a PDF in which the AcroForm fields will be rendered inside a table. I am having issue with RadioButtons when they spread across two pages. I have modified example shown on this link http://itextpdf.com/sandbox/acroforms/CreateRadioInTable . Only the craetePdf method from above example is modified. public void createPdf(String dest) throws IOException, DocumentException { Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document,new FileOutputStream

How to set Check Box Style to “Check” using iText in existing form?

心已入冬 提交于 2019-12-07 13:32:06
问题 I have PDF with acroForm that was created using Adobe Acrobat Standard DC. There is Chekcbox field that I populate using Java iText 5. When I was creating it in Properties I set it up Check Box Style to "Check" so it will put "V" style symbol when it is checked. And it does really work if I open the form in Preview mode and check this CheckBox: But when I set this field to checked state using iText 5 it checks it is Cross: I can't figure out why it is changing style? My code is simple: void

iTextSharp - move Acrofield

空扰寡人 提交于 2019-12-07 11:26:44
问题 I have a process that inserts a table of content into an existing Acroform, and I am able to track where I need to start that content. However, I have existing Acrofields below that point that will need to be moved up or down, based on the height of the tables I insert. With that, how can I change the position of an Acrofield? Below is code that I can use to "get" the position...but now I also need to be able to "set" it. .... // Initialize Stamper ("output" is a MemoryStream object)

Issue with iText RadioCheckField when displayed on multiple pages

穿精又带淫゛_ 提交于 2019-12-06 12:47:21
I am creating a PDF in which the AcroForm fields will be rendered inside a table. I am having issue with RadioButtons when they spread across two pages. I have modified example shown on this link http://itextpdf.com/sandbox/acroforms/CreateRadioInTable . Only the craetePdf method from above example is modified. public void createPdf(String dest) throws IOException, DocumentException { Document document = new Document(); PdfWriter writer = PdfWriter.getInstance(document,new FileOutputStream(dest)); document.open(); PdfFormField radiogroup = PdfFormField.createRadioButton(writer, true);

How to set Check Box Style to “Check” using iText in existing form?

亡梦爱人 提交于 2019-12-05 22:26:59
I have PDF with acroForm that was created using Adobe Acrobat Standard DC. There is Chekcbox field that I populate using Java iText 5. When I was creating it in Properties I set it up Check Box Style to "Check" so it will put "V" style symbol when it is checked. And it does really work if I open the form in Preview mode and check this CheckBox: But when I set this field to checked state using iText 5 it checks it is Cross: I can't figure out why it is changing style? My code is simple: void populateCheckBox(AcroFields form, String searchKey, String value) throws IOException, DocumentException

iTextSharp - move Acrofield

坚强是说给别人听的谎言 提交于 2019-12-05 12:32:10
I have a process that inserts a table of content into an existing Acroform, and I am able to track where I need to start that content. However, I have existing Acrofields below that point that will need to be moved up or down, based on the height of the tables I insert. With that, how can I change the position of an Acrofield? Below is code that I can use to "get" the position...but now I also need to be able to "set" it. .... // Initialize Stamper ("output" is a MemoryStream object) PdfStamper stamper = new PdfStamper(pdf_rdr, output); // Get Reference to PDF Document Fields AcroFields fields

Adding a PDF fillable form (acrofield) using Apache FOP

假如想象 提交于 2019-12-04 11:40:05
I am trying to add a fillable form (so the end-user can insert information into it using acrobat reader and then save it) to a PDF I generate using Apache FOP. I can't seem to find any information on how this is done, if it is possible. Google doesn't give much relevant information, mostly on the fact that it's not possible, but most of that information dates from the early 2000's. Is there a way to add acrofields using FOP? lfurini (disclosure: I'm a FOP developer, though not very active nowadays) The XSL-FO language , which is FOP's input language, does not have formatting objects defining

Put a Button on PDF with PDFBox 2.x

爷,独闯天下 提交于 2019-12-04 04:17:32
问题 I hope somebody can help me with my Problem with Buttons and Textfields on a PDF created with PdfBox 2.x. I tried to put a Button on my Page, which sets a Date in a Textfield with a Javascript function. That works fine. I then tried to put the Textfield and the Button in a Document with more than one page, so that the Textfield and the Button appears on every Page, but in that way, that the Button on the page writes the Date only to the Textfield on the Page where the Button is, I clicked on.