We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

BUG: AsposePDF.NET : RadiobuttonField causes error when opened in AdobeAcrobat for Android

When creating a PDF document containing a RadiobuttonField, and then opening this document on an Android device using Adobe Acrobats official Android application, the document cannot be opened.
Message: File is damaged or corrupt.


Reproduce:
1.Create a pdf containing a RadioButtonField
2.Open this document on an Android device using Adobe Acrobat on Android (Not Adobe Reader for windows)
3.Click on one of the options
4. The application displays errormessage “File is corrupt or damaged”. Application exits

SampleCode:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Page p1 = doc.Pages.Add();

//tbl to keep the checkboxes in
Table tbl = new Table();
tbl.ColumnWidths = "100";
var tbl_r1 = tbl.Rows.Add();
var tbl_r1_cell1 = tbl_r1.Cells.Add();
var tbl_r1_cell2 = tbl_r1.Cells.Add();
p1.Paragraphs.Add(tbl);

RadioButtonField radio = new RadioButtonField(p1);
radio.PartialName = "opt";

RadioButtonOptionField opt1 = new RadioButtonOptionField(p1,new Aspose.Pdf.Rectangle(0,0,0,0));
opt1.OptionName = "Test1";
radio.Add(opt1);
opt1.Width = 20;
opt1.Height = 20;

RadioButtonOptionField opt2 = new RadioButtonOptionField(p1, new Aspose.Pdf.Rectangle(0, 0, 0, 0));
opt2.OptionName = "Test2";
radio.Add(opt2);
opt2.Width = 20;
opt2.Height = 20;

doc.Form.Add(radio);
tbl_r1_cell1.Paragraphs.Add(opt1);
tbl_r1_cell2.Paragraphs.Add(opt2);


doc.Save(@"..\..\output\android_formfield.pdf");
System.Diagnostics.Process.Start(@"..\..\output\android_formfield.pdf");

Hi Christian,


Thanks for contacting support.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; -webkit-text-stroke: #000000} span.s1 {font-kerning: none}

I have tested the scenario and have managed to reproduce the problem that generated PDF document is not opening in Adobe Acrobat on Android device. For the sake of correction, I have logged it as PDFNET-42379 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time.


We are sorry for this inconvenience.


Best Regards,

Hello,


I’ve also posted this in the adobe-support forums here:
https://forums.adobe.com/message/9376116#9376116
, as this must somehow also be related to how the Android version of Adobe Acrobat choose to interpret PDF files. It works just fine on the windows version of Acrobat.

Hi Christian,


Once you got some response from Adobe support, you can post it here. It might help our team as well to investigate the issue.

Best Regards,

I have not received any feedback from Adobe on this.



I have found something that might help you debug further:
When opening the document in Adobe Acrobat Pro, I can see that the radiobutton-fields are listed multiple times with the same name.
See attached image for illustration.

When I try to create radiobuttons using Adobe Acrobat Form Tools, radiobutton fields are only added 1 time for each radiobutton.

Hi Christian,


Thanks for sharing further details.

I have recorded your details in ticket PDFNET-42379. We will update you within this forum thread as soon as we have some definite updates from the product team on this issue. Please be patient and spare us little time.

We are sorry for this inconvenience.

Best Regards,