PDFsharp & MigraDoc Foundation https://forum.pdfsharp.net/ |
|
Page Count in MigraDoc https://forum.pdfsharp.net/viewtopic.php?f=2&t=1895 |
Page 1 of 1 |
Author: | sumit [ Wed Feb 01, 2012 1:06 pm ] |
Post subject: | Page Count in MigraDoc |
I am using MigraDoc to generate PDF in ASP .net. Is there any way to count total number of pages in MigraDoc document without using PDFSharp? |
Author: | Thomas Hoevel [ Wed Feb 01, 2012 3:22 pm ] |
Post subject: | Re: Page Count in MigraDoc |
To show the page count in the document (e.g. "Page 1 of 4"), use the apropriate fields. To get he page count for your application, query this information from the renderer: Code: // Create a renderer and prepare (=layout) the document
MigraDoc.Rendering.DocumentRenderer docRenderer = new DocumentRenderer(doc); docRenderer.PrepareDocument(); int pageCount = docRenderer.FormattedDocument.PageCount; |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |