Is there a possiblity to empty formfields without necessary have to write pdfviewer.load(emptydynamicpdf), a little like the empty formfields in the Acrobat Reader Pro. |
We can empty the form fields by importing and exporting the form fields.We need to exportformfields with empty values and save them in a location and after that import the data for the same PDF document. So the value gets saved.
Example:
If the provided details doesn’t matches your criteria. Kindly provide more details about the query. So that would be helpful for us to analysis more and assist you better. | |
Is there a way to check if the pdf have formfields? before doing the object base64Data = await Viewer.ExportFormFieldsAsObject(); to avoid the bellow error if a user join a non dynamic pdf!
|
At present we don’t have support to check the PDF has a form fields. We will implement the usability feature and it will be available in volume 1 SP1 release. |
fieldCollection["NameOfField"].Flatten = true; to avoid looping throw all the fieldcollection to find a specific field
foreach (var field in loadedDocument.Form.Fields) { if (loadedDocument.Form.Fields[i].Name == "NameOfField") { loadedDocument.Form.Fields[i].Flatten = true; } i++; }
//Load the existing PDF form
PdfLoadedFormFieldCollection fields = doc.Form.Fields;
PdfLoadedField field = null;
//Get the specific field by name
fields.TryGetField("FirstName", out field);
//Set text
(field as PdfLoadedTextBoxField).Text = "Modified"; |