Generate not Editable PDF after FillFields

I used Adobe Designer 7.0 to produce a Form (pdf) with Text and Image Fields e CodBar Field.



Using the DemoWebForm supplied, I modified the FillFields call to use my Form.



#1 - How I can obtain a PDF not Editable after use FORM.Save() ?



I Marked Text fields as Read Only - OK, but the ImageField cannot be marked as ReadOnly and continue alow editing.



#2 - The CodBar field, after marked as ReadOnly, don’t show bars. Why?



#3 - Is the Adobe Designer best choice to produce Forms ?





Hello Luiz Fernando,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for considering Aspose.

#1) How to obtain Pdf not editable, you can set Privileges over Pdf document. Please visit Set Privileges on PDF Document

#2) after the CodaBar marked as read only, don’t show Bars, I am not sure why you are facing this problem. Could you please elaborate it, how you are making it read only, through Adobe Designer or using code snippet.

#3) We have a component named Aspose.Pdf which can be used to generate Pdf forms. For more information please visit Manipulating Form Fields. You can also use Aspose.Pdf.Kit to create Pdf forms. For more information please visit How to Create and Decorate Form Fields With API?.

Please also visit Change Form Field Attributes it contains information on how to set the form field attributes to prevent the user from changing the value of the field.

Please visit Aspose.Pdf vs. Aspose.Pdf.Kit in order to have clear understating of both the products.

Dear Fernando,

Thanks for considering Aspose.Pdf.Kit. I would like to add some more comments about your questions.

For #1, you can invoke Form.FlattenField(String fieldName) to make specific field un-editable, or Form.FlattenAllFields() to make all fields un-editable.

For #2, I am not sure about the "Codbar Field", is it the mis-spelling of "Codabar Field"? If so, what's the operation to get it un-editable? If possible, please provide the code as well as resources.

For #3, as codewarior said, Aspose.Pdf can generate PDF documents containing forms from scratch, while Aspose.Pdf.Kit can modify/add fields on the basic of existing PDF templates.

Best regards.

for #2 - The field is typed as ‘BarCode’ in Adobe Design.

- When I use Form.FlattenAllFields() the image of BarCode does not show - only the numbers are showed.

- But, if I don’t use Form.FlattenAllFields(), the image is showed.



For my application, I need use Form.FlattenAllFields().



Following the Form ‘test.pdf’ I used.

Dear Fernando,

Thanks for sharing the resource pdf file.

In order for us to test the issue, we need to fill in the form fields, but before we proceed with this operation, we must know the form field names. Currently I am not sure, what name you have used for the form fields. Please share to project that you are using, so that we can test the issue at our end.



public static void FillFields(string path, string templatePdf, System.IO.Stream outputStream)

{

Form form = new Form(templatePdf, outputStream);

form.FillField(“Inscricao”,“910029992”);

form.FillField(“Nat”,“2”);

form.FillField(“Valor”,“8277673.45”);

form.FillField(“texto”,“41, Lily Street, Hurstville, NSW, 2220 Australia \nNova linha de texto contento nova linha de texto\n\nnova linha”);

form.FillBarcodeField(“form1[0].sub1[0].codBarra[0]”, “1234567890”);

form.FillImageField(“LogoPM”,path + @".\Resources\lovely.jpg");



form.FlattenAllFields();



form.Save();



}

Dear Fernando,

I have tested the issue and I am able to notice the same problems. We are looking into the detail of this issue and soon you will be updated with the status of correction.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.

Dear Fernando,

Thanks for your resources.

I am sorry to inform you that Aspose.Pdf.Kit cannot flatten barcode fields in XfaForm correctly. The appearance of barcode fields are generated by PDF Reader automatically, which is not embeded in the document.

A workround solution is to set the field as ReadOnly, which can also turn it un-editable. If you can accept this alternative, we will add the feature into our product.

Hope for your message & Best regards.

The issues you have found earlier (filed as 6419) have been fixed in [this update](http://www.aspose.com/community/files/51/file-format-components/aspose.pdf.kit-for-.net-and-java/entry171362.aspx).