acrofields

PDFBox how to import acrofield from another pdf

血红的双手。 提交于 2019-12-02 07:49:09
问题 I have a problem with import exist acrofield from a pdf into another pdf. The two pdf are similar. I tried to import and save the file (code below). if I open it from the file system I do not see the changes, but if I open it with pdfbox I see the acrofiles inserted earlier. I notice that the file size has increased, but when I open it I do not see the fields fillable. Thank you in advance PDDocument documentSrc = PDDocument.load(new File(SRC)); PDAcroForm acroFormSrc = documentSrc

Arabic Data disappears on Form flattening in iText

被刻印的时光 ゝ 提交于 2019-12-01 13:48:24
I have populated an acrofield with some Arabic data using PDFStamper. The text disappears when I flatten the form while it is working fine for English. Please guide. BaseFont unicode = null; unicode = BaseFont.createFont("D:/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); form.setGenerateAppearances(true); form.addSubstitutionFont(unicode); form.setField("TextBox","اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب"); stamper.setFormFlattening(true); It's probably an encoding problem when you save, compile or execute your code (which means your problem is not related to iText). This is

Arabic Data disappears on Form flattening in iText

折月煮酒 提交于 2019-12-01 12:48:29
问题 I have populated an acrofield with some Arabic data using PDFStamper. The text disappears when I flatten the form while it is working fine for English. Please guide. BaseFont unicode = null; unicode = BaseFont.createFont("D:/arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); form.setGenerateAppearances(true); form.addSubstitutionFont(unicode); form.setField("TextBox","اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب اب"); stamper.setFormFlattening(true); 回答1: It's probably an encoding

Set AcroField Text Size to Auto

ε祈祈猫儿з 提交于 2019-11-30 23:46:30
Using itextsharp , I'm attempting to set the font size of my form's text fields to auto . I'm currently doing something like this: Object d = 0.0; PdfReader reader = new PdfReader(path); byte [] pdf; using (var ms = new MemoryStream()) { PdfStamper stamper = new PdfStamper(reader, ms); AcroFields fields = stamper.AcroFields; foreach (var f in fields.Fields.Keys) { fields.SetFieldProperty(f, "textsize", d, null); } } But I'm getting the following error: System.InvalidCastException: Specified cast is not valid. at iTextSharp.text.pdf.AcroFields.SetFieldProperty(String field, String name, Object

How to insert image programmatically in to AcroForm field using java PDFBox?

筅森魡賤 提交于 2019-11-30 18:36:08
问题 I have created simple PDF document with 3 labels: First Name, Last Name and Photo. Then I added AcroForm layer with 2 'Text Fields' and one 'Image Field' using Adobe Acrobat PRO DC. So if I want to fill up the form I can open this PDF file in regular Acrobat Reader and fill up by typing First Name, Last Name and in order to insert Photo I click on image placeholder and select photo in opened Dialog Window. But how can I do same thing programmatically? Created simple Java Application that uses

ITextSharp 4.1.6 - Remove existing line from PDF Template

不羁的心 提交于 2019-11-29 16:30:51
I have a PDF template created in LibreOffice and I'm filling it in using AcroFields. In some rare cases I'd like to hide a particular field, thus I remove it using RemoveField method. It's border however stays in there. From what I've googled it seems it's probably the way LibreOffice creates the forms. What I've came up with so far was to get the rectangle of the field and cover it with white image. Problem however is, customer plans creating templates using background image and/or other background color than white making my current solution almost unusable The question therefore is - is

PDF hostContainer callback

和自甴很熟 提交于 2019-11-29 09:41:47
Following this SO solution here to notify clients of a click event in a PDF document, how is it possible to notify the client when the PDF gets submitted by the client using this.myPDF.submitForm("localhost/Handler.ashx?r=2) function? The PDF File is created inside a user control then rendered into a HTML object: string container = ("<object data='/myfile.pdf' type='application/pdf'></object>"); The JS file attached to the PDF is done like this: var webClient = new WebClient(); string htmlContent = webClient.DownloadString(fileurl + "pdf_script.js"); PdfAction action = PdfAction.JavaScript

PDFBox API: How to change font to handle Cyrillic values in an AcroForm field

烈酒焚心 提交于 2019-11-28 14:08:33
I need help with adding Cyrillic value to a field using the PDFBox API . Here is what I have so far: PDDocument document = PDDocument.load(file); PDDocumentCatalog dc = document.getDocumentCatalog(); PDAcroForm acroForm = dc.getAcroForm(); PDField naziv = acroForm.getField("naziv"); naziv.setValue("Наслов"); // this part right here naziv.setValue("Naslov"); // it works like this It works perfect when my input is in Latin Alphabet. But I need to handle Cyrillic inputs as well. How can I do it? p.s. this is the exception I get: Caused by: java.lang.IllegalArgumentException: U+043D ('afii10079')

How to get the names of AcroField revisions in iText?

孤人 提交于 2019-11-28 13:47:54
I'm currently working on a tool for applying and verifying digital signatures on pdf documents. I understand that each signature in a pdf document is applied to a certain revision of the AcroFields. Each time the user changes some input (i.e. by filling out a pdf form), a new revision is created. My question is: how can I retrieve all revisions from an AcroFields object? I know how to get a single revision if I have its name like this: AcroFields fields = ...; fields.getRevision("revision1"); But how can I retrieve all revisions (or their names, at least)? I haven't found anything in the iText

ITextSharp 4.1.6 - Remove existing line from PDF Template

会有一股神秘感。 提交于 2019-11-28 11:07:01
问题 I have a PDF template created in LibreOffice and I'm filling it in using AcroFields. In some rare cases I'd like to hide a particular field, thus I remove it using RemoveField method. It's border however stays in there. From what I've googled it seems it's probably the way LibreOffice creates the forms. What I've came up with so far was to get the rectangle of the field and cover it with white image. Problem however is, customer plans creating templates using background image and/or other