Problem with IsOnOddPage property


#1

I have not been able to sucessfully use the IsOnOddPage property. Here is a code snippet that throws an expception as soon as the paragraph with IsOnOddPage is added to a section.

string strFileName = “c:\TestAsposeReport.pdf”;
FileStream fs = new FileStream(strFileName,FileMode.Create);

pdfDoc = new Pdf(fs);
Section section = pdfDoc.Sections.Add();
section.IsLandscape = true;

//Page 1
Text text1 = new Text(“Page 1”);
text1.IsFirstParagraph = true;
section.AddParagraph(text1);

//Page 2
Text text2 = new Text(“Page 2”);
text2.IsFirstParagraph = true;
section.AddParagraph(text2);

//Page 3
Text text3 = new Text(“Page 3”);
text3.IsFirstParagraph = true;
section.AddParagraph(text3);

//Make another odd page
Text text5 = new Text(“Odd Page 5”);
text5.IsFirstParagraph = true;
text5.IsOnOddPage = true;
section.AddParagraph(text5); //exception is thrown here

pdfDoc.Close();
fs.Close();


#2

Dear gibsoju,

Thank you for considering Aspose.

I have fixed this bug. Please download hot fix here.