Free Support Forum - aspose.com

Help on passing variable at header

hi guys,
i want to display sectionID at header, please help me to passing variable data (like section ‘ID’) at header in pdf doc, i unable to do.

as for examp:

weekly release section ‘A’ page 1



weekly release section ‘B’ page 5



weekly release section ‘F’ page 9



regards,
Sojib

Dear sojib,

Thank you for considering Aspose.

Do you mean your section ID is assigned at run time and you want to display the ID at the header? Here is an example:

[XML]
<?xml version="1.0" encoding="utf-8" ?>




weekly release section

#$TAB#$TAB#$TABPage $p





This is section 1.



[C# code]
Pdf pdf = new Pdf();
pdf.BindXML(@"E:\temp\SectionID.xml",null);
Section sec1 = pdf.Sections[0];

sec1.ID = "A";

Segment seg1 = sec1.GetObjectByID("SectionID") as Segment;
seg1.Content = sec1.ID;

pdf.Save(@"e:\temp\Test.pdf");

[VB code]
Dim pdf As Pdf = New Pdf()
pdf.BindXML("E:\temp\SectionID.xml",Nothing)
Dim sec1 As Section = pdf.Sections(0)

sec1.ID = "A"

Dim seg1 As Segment = sec1.GetObjectByID("SectionID") as Segment
seg1.Content = sec1.ID

pdf.Save("e:\temp\Test.pdf")


I hope this can help you.