section template issue

section template issue

Forum member · May 8, 2009
I want to use the section templates. But I notice that its not working correctly. When I add any pages to the document, it should use the last template that was set to begin(). But instead, it always uses the first template that was set to begin() - even after setting the first template, it did not add any pages. -Piyush ------------------------ Document pdfDoc = new Document(); Template template = new Template(); template.Elements.Add(new Label("Template 1", 100, 100, 100, 100)); Template template2 = new Template(); template2.Elements.Add(new Label("Template 2", 100, 100, 100, 100)); Template template3 = new Template(); template3.Elements.Add(new Label("Template 3", 100, 100, 100, 100)); pdfDoc.Sections.Begin(template); pdfDoc.Sections.Begin(template2); pdfDoc.Pages.Add(new Page()); pdfDoc.Pages.Add(new Page()); pdfDoc.Sections.Begin(template2); pdfDoc.Pages.Add(new Page()); pdfDoc.Pages.Add(new Page()); pdfDoc.Sections.Begin(template3); pdfDoc.Pages.Add(new Page()); pdfDoc.Pages.Add(new Page()); pdfDoc.Draw(@"C:\test.pdf");

Re: section template issue

Support · May 9, 2009
Hello Piyush, We are able to see the behavior you are telling by running the code you have given. We will forward this issue over to the developers to look into it further. We will post a message as soon as we hear something from them. Thanks, ceTe Software Support Team.

Re: section template issue

Support · Jun 23, 2009
Hello Piyush, We just heard back from the developers. This is not a bug. The way to do this is first add all the pages to the PDF document and the decide what page falls under what section. A section cannot be empty. Thanks, ceTe Software Support Team