Hi,
How to create Table of Contents in pdf document, how to create/generate tree configuration in pdf doucment and how to check single side double side printing of pdf doucment.
thanks
yashwant
TOC, Tree Configuration, Print PDF
Re: TOC, Tree Configuration, Print PDF
Support · May 29, 2012Hello,
Using DynamicPDF Generator, while generating the PDF you can set the Duplex printing mode using ViewerPreferences
class.
If you need to verify if the Duplex is set or not on an existing PDF, you would need to use the DynamicPDF Merger product to open the PDF and check the above ViewerPreferences.Duplex property.
There is no direct functionality to create a tree configuration. You would have to do it manually using the Rectangle
and Line
classes.
For creating a PDF with table of content, you can use the following sample code.
Document doc = new Document();
Page TOCpage = new Page();
Label label = new Label("TOC Heading", 10, 10, 100, 20);
TOCpage.Elements.Add(label);
Link link;
float y = 30;
int pageNumber = 1;
string[] strHeadingArr = new string[50];
string[] srelabel = new string[50];
for (int i = 0; i <= 10; i++)
{
Page page = new Page();
Label label1 = new Label("Heading" + i.ToString(), 10, 10, 100, 20);
PageNumberingLabel pageNumberlabel = new PageNumberingLabel("%%CP%% of %%TP%%", 100, 600, 200, 30, Font.Helvetica);
page.Elements.Add(pageNumberlabel);
page.Elements.Add(label1);
strHeadingArr[i] = label1.ToString();
doc.Pages.Add(page);
XYDestination act = new XYDestination(pageNumber + 1, 0, 0);
label = new Label(" link for Page" + (pageNumber + 1).ToString(), 20, y, 100, 15);
link = new Link(20, y, 50, 20, act);
Label label2 = new Label("................................................................................" + (pageNumber + 1).ToString(), 120, y, 500, 15);
y = y + 30;
TOCpage.Elements.Add(label);
TOCpage.Elements.Add(link);
TOCpage.Elements.Add(label2);
pageNumber = pageNumber + 1;
}
doc.Pages.Insert(0, TOCpage);
doc.Draw(@"C:\\TOC.pdf");
Thanks,
ceTe Software Support Team.