Free Support Forum - aspose.com

[Urgent] Checkboxes appearing only in first page footer and not in rest of the pages

We are using the FormField to generate checkbox and add it to the footer section.

But the chckbox is appreasing only for the first page, checkbox is not getting visible for the rest of the pages.

Code snippet we are suing is as follows:

Section sec1 = new Section();

Aspose.Pdf.Generator.HeaderFooter footer = new Aspose.Pdf.Generator.HeaderFooter(sec1);

// set the Odd footer of the PDF file

sec1.OddFooter = footer;

// set the Even footer of the PDF file

sec1.EvenFooter = footer;

footer.IsLastPageOnly = false;

Table tabMain = new Table();

tabMain.ColumnWidths = "100%";

//PdfUtils.SetColumnWidth(request.Pdf, tabMain, 0, 100);

tabMain.DefaultCellPadding = new MarginInfo() { Bottom = 3F };

Row rowSign = tabMain.Rows.Add();

Cell cellSign = rowSign.Cells.Add();

cellSign.Alignment = AlignmentType.Left;

Text txtcellChkMD = new Aspose.Pdf.Generator.Text();

txtcellChkMD.TextInfo = tf1;

cellSign.Paragraphs.Add(txtcellChkMD);

Aspose.Pdf.Generator.Segment seg2 = txtcellChkMD.Segments.Add();

FormField chk1 = new FormField();

chk1.FormFieldType = FormFieldType.CheckBox;

chk1.FieldName = "MD" ;

chk1.FormHeight = 10;

chk1.FormWidth = 10;

//chk1.CheckBoxIsChecked = false;

chk1.IsBordered = true;

seg2.InlineParagraph = chk1;

txtcellChkMD.Segments.Add(" MD");

Is there a way to display the ceckbox in footer for all the pages.

THanks,

Saikat

Hi Saikat,


Thanks for using our products.

I have tested the scenario and I am able to
notice the same problem. For the sake of correction, I have logged this issue
as PDFNEWNET-35175 in our issue tracking system. We will
further look into the details of this problem and will keep you updated on the
status of correction. Please be patient and spare us little time. We are sorry
for this inconvenience.


PS, The Checkbox is being added in footer of subsequent pages but it’s not properly visible. If you place mouse over the place where Checkbox should be, the mouse pointer is changed.

Hi Saikat,


Thanks for your patience.

I have further discussed with development team and as per our estimations, we can get this problem resolved in next release version of Aspose.Pdf fro .NET 8.0.0 which is planned to release in May-2013. However if you require some immediate solution, you may consider opting Enterprise Support or Priority Support models and the development team can look over this issue on priority basis and can prepare a hotfix.

Thanks for your patience and comprehension in this regard.

Hi Saikat,


Thanks for your patience.

In order to resolve the issue reported earlier, please try using the following code snippet.

[C#]

Document doc = new
Document();<o:p></o:p>

Page page = doc.Pages.Add();

Aspose.Pdf.HeaderFooter footer = new Aspose.Pdf.HeaderFooter();

page.Footer = footer;

Aspose.Pdf.Table tabMain = new Aspose.Pdf.Table();

tabMain.ColumnWidths = "10 30";

Aspose.Pdf.MarginInfo margin = new Aspose.Pdf.MarginInfo();

margin.Bottom = 3;

// add table to paragraphs collection of Footer object

footer.Paragraphs.Add(tabMain);

Aspose.Pdf.Row rowSign = tabMain.Rows.Add();

Aspose.Pdf.Cell cellSign = rowSign.Cells.Add();

cellSign.Alignment = Aspose.Pdf.HorizontalAlignment.Left;

CheckboxField chk1 = new CheckboxField();

chk1.Height = 10;

chk1.Width = 10;

cellSign.Paragraphs.Add(chk1);

Aspose.Pdf.Cell cellCaption = rowSign.Cells.Add();

TextFragment txtcellChkMD = new TextFragment();

TextSegment segment = new TextSegment(" MD");

TextState state = new TextState();

state.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Red);

state.FontSize = 14;

segment.TextState = state;

txtcellChkMD.Segments.Add(segment);

cellCaption.Paragraphs.Add(txtcellChkMD);

// add dummp paragraphs to PDF file

for (int i = 1; i < 10; i++)

{

NewParagraphPlacementInfo placementInfo = new NewParagraphPlacementInfo();

placementInfo.StartNewPage = true;

page.Paragraphs.Add(new TextFragment("Sample Paragraph - " + i.ToString()), placementInfo);

}

doc.Save(“c:/pdftest/CheckBoxIssue.pdf”);

The issues you have found earlier (filed as PDFNEWNET-35175) have been fixed in Aspose.Pdf for .NET 8.0.0.


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

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan