How to set the Button Field Property as "Visible but doesn't print"

For a Dynamically Created Button Field, how do I set the Form Field Property as "Visible but doesn't print"

Please help..

Currently I did the following so far:-

form.setField("ZIPEXTN","5678"); // this code will set the fieldname zipextn with value 5678.
form.setFieldAttr("ZIPEXTN", Form.ATTR_READ_ONLY); // this code will set the field readonly.

sks

Dear sks,

Thanks for considering Aspose.Pdf.Kit.

form.setFieldAttr() is only working in Adobe 6.0 and below. The feature of field attributes setting for XFA (Adobe 7.0 +) is on our developing plan, but it won't be available in a month.

Best regards.

we use Adobe professional 7.0 for creating acroform pdf and NOT XFA Pdf.

So,

1). for these field attributes that you are developing, will it work for Acroform PDF???.

2). "VISIBLE BUT NOT PRINTABLE" is an attribute of button/text field just like HIDDEN or VISIBLE or HIDDEN BUT PRINTABLE . Currently defining the attribute of dynamically created button field does not have the attribute "VISIBLE BUT NOT PRINTABLE" . So you need to include that attribute as well in your jar file.

sks

Hi sks,

Thanks for your good suggestion.

We are considering both 'VISIBLE BUT NOT PRINTABLE' and 'HIDDEN BUT PRINTABLE' attributes supporting, which were not defined in old versions. A new hotfix is expected to be released in one week. Please notice our blog.

Best regards.

lukeyoyo:

Dear sks,

Thanks for considering Aspose.Pdf.Kit.

form.setFieldAttr() is only working in Adobe 6.0 and below. The feature of field attributes setting for XFA (Adobe 7.0 +) is on our developing plan, but it won't be available in a month.

Best regards.


There was never any follow-up to this thread. Was this feature ever implemented?

Hi,


Thanks for contacting support.

We are looking into this requirement and will get back to you soon.

karenq:
lukeyoyo:

Dear sks,

Thanks for considering Aspose.Pdf.Kit.

form.setFieldAttr() is only working in Adobe 6.0 and below. The feature of field attributes setting for XFA (Adobe 7.0 +) is on our developing plan, but it won't be available in a month.

Best regards.


There was never any follow-up to this thread. Was this feature ever implemented?
Hi Karen,

Thanks for your patience.

In order to accomplish your requirement, please try using following code snippet. For your reference, I have also attached the output generated over my end.

[C#]

Document doc = new Document();

doc.Pages.Add();

doc.Pages[1].Paragraphs.Add(new TextFragment("Hello World.."));

Aspose.Pdf.Forms.ButtonField button = new ButtonField(doc, new Aspose.Pdf.Rectangle(10,10,50,20));

button.Name = "Sample Button";

button.Value = "Button 1";

button.Flags = AnnotationFlags.Default;

// TextBoxField.Border = new Border(

Border border = new Border(button);

border.Width = 5;

border.Dash = new Dash(1, 1);

button.Border = border;

button.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Green);

// Add field to the document

doc.Form.Add(button, 1);

doc.Save(@"C:\pdftest\DOM_Output.pdf");