Bug: Aspose.Pdf.Net v11.7.0.0 - CheckBoxField


This bugreport consists of 3 issues:

1. The CheckBoxField does not create correct borders.

2.When modifying an existing checkbox in a document, and setting border, the 'checkmark' gets wrong size. When clicking the checkbox on/off, the 'checkmark' has alternating size

3. Setting Style of Checkbox does not work.
I.E: Make the checkbox have a cross instead of a checkmark


Demo-code :

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 r1 = tbl.Rows.Add();
var cell1 = r1.Cells.Add();
var cell2 = r1.Cells.Add();
p1.Paragraphs.Add(tbl);

//1. Create checkbox, set style & border, set it checked
CheckboxField cbf1=new CheckboxField(p1,new Aspose.Pdf.Rectangle(0,0,0,0));

//does not work to make the checkbox have a cross instead of a checkmark
cbf1.Style = BoxStyle.Square;
cbf1.Style = BoxStyle.Cross;

cbf1.PartialName = "cbf_1";
cbf1.Width = 20;
cbf1.Height = 20;
cbf1.Border=new Border(cbf1);
cbf1.Border.Width = 2;
cbf1.Border.Style= BorderStyle.Solid;

cbf1.Checked = true;
cell1.Paragraphs.Add(cbf1);
//1.Create checkbox, set style & border, set it checked
//2.Emulate a save
//3.Modify border
CheckboxField cbf2 = new CheckboxField(p1, new Aspose.Pdf.Rectangle(0, 0, 0, 0));
cbf2.Style = BoxStyle.Square;
cbf2.Style = BoxStyle.Cross;
cbf2.PartialName = "cbf_2";
cbf2.Width = 20;
cbf2.Height = 20;
cbf2.Border = new Border(cbf2);
cbf2.Border.Width = 2;
cbf2.Border.Style = BorderStyle.Solid;
cbf2.Checked = true;
cell2.Paragraphs.Add(cbf2);

//Emulate save
using (MemoryStream ms = new MemoryStream())
{
doc.Save(ms);
}
//Change border width
doc.Form["cbf_2"].Border.Width = 4;

//Does not work correctly, causes checkbox to alternate between cross and checkmark
cbf2.Style = BoxStyle.Square;
cbf2.Style = BoxStyle.Cross;


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


See attached image in order to see the appearance of the checkboxes in different states

Hi there,


Thanks for your inquiry. I am looking into the issue and will update you soon.

Best Regards,
Hi there,

NelfoIso:
1. The CheckBoxField does not create correct borders.

We are sorry for the delayed response. I have tested the scenario and noticed the border issue, so logged a ticket PDFNET-41166 in our issue tracking system for further investigation and rectification.

NelfoIso:

2.When modifying an existing checkbox in a document, and setting border, the 'checkmark' gets wrong size. When clicking the checkbox on/off, the 'checkmark' has alternating size


I have also noticed the checkmark size issue after modification of Checkbox and logged another ticket PDFNET-41168 in our issue tracking system for further investigation and rectification.

NelfoIso:

3. Setting Style of Checkbox does not work.
I.E: Make the checkbox have a cross instead of a checkmark


I have logged PDFNET-41167 ticket for Checkbox styling issue. We will notify you as soon as these issues are resolved.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as PDFNET-41166) have been fixed in Aspose.Pdf for .NET 16.10.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as PDFNET-41167) have been fixed in Aspose.PDF for .NET 22.2.