Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iTextSharp.text.Document Doc = new iTextSharp.text.Document(PageSize.A4, 50, 50, 50, 50);

HTMLWorker htmlparser1 = new HTMLWorker(Doc);
PdfWriter.GetInstance(Doc, new FileStream(fileName, FileMode.Create));

//Create document header
Phrase p = new Phrase();
p.Add(" ");
p.Add(new Chunk(image, 0, 0));

HeaderFooter header = new HeaderFooter(p,false);
header.Border = 0;

//Create document footer
HeaderFooter footer = new HeaderFooter(new Phrase("Page "), new Phrase(""));
footer.Border = 0;
footer.SetAlignment("RIGHT");

//Write header and footer
Doc.Header = header;
Doc.Footer = footer;
Doc.Open();

for above footer will display "Page 1 " at right bottom of the page.

But i need to show page 1 of PageCount.
Please help me.
Posted

1 solution

May the following program can be used:

<html>
<body>


// content
@RenderBody()



</body>
</html>

@Section customFooter
{
Custom Footer 1

}

@Section customFooter
{
Custom Footer 2

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900