PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

PDFSharp: How to add pagenumber after the pdf is generated.
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3161
Page 1 of 1

Author:  SumitD [ Thu Aug 06, 2015 7:30 pm ]
Post subject:  PDFSharp: How to add pagenumber after the pdf is generated.

Hi All,

I am a newbie to the PDFSharp. I am using PDFSharp in my project to implement the following scenario:

My project is a web portal which talks with the SSRS reporting server to produce individual ssrs reports in pdf format. There is a master set of 20 reports on the ssrs server.
Any time a user can choose to produce any number of reports out of those 20 master reports.

After the reports are produced, I am using pdfsharp to merge them into one single pdf, which is then mailed to the end user.
Now user is requesting if he can see page numbers in the final pdf.

I searched through the forum and saw some posts with something "gfx". I am not familiar with the pdf structure. Is there any straight forward way using PDFDocument object or do I have to write custom code for this?

Thanks,
Sumit

Author:  TH-Soft [ Sat Aug 08, 2015 6:57 pm ]
Post subject:  Re: PDFSharp: How to add pagenumber after the pdf is generat

Hi!

There are several samples:
http://pdfsharp.net/wiki/PDFsharpSamples.ashx

The Hello World sample shows how to draw text.

It should be rather simple to modify your code with a page counter and then add the page number to each page.
The Watermark sample does it with big, transparent, and rotated text - instead just add normal text.

Either re-open the combined PDF or add the text while combining the PDF files - the latter should be faster, the former might be simpler to implement for a newbie.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/