PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 6:06 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Sep 02, 2014 8:51 pm 
Offline

Joined: Tue Sep 02, 2014 8:50 pm
Posts: 2
Please, Help!
How I can get number of pages before rendering?

I've read, that i can query the renderer to get number.

I need to write number as words in my document.
Our standarts are forced to write number of pages as words on the title page.
I create technical report consisting more than 500 pages.
With tables and charts, calculating values etc, document render about 15 minutes...

Sorry for my English.

Regards,
Egor


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 03, 2014 7:59 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

Also see answer here:
http://stackoverflow.com/a/25639027/162529

Adding the number as a word to the title page using PDFsharp should be no problem.
Render the PDF with MigraDoc and you will know how many pages there are, then open the PDF file with PDFsharp and add one line of text with the page number as a word.

Is the position fixed?
If not, add a method "GetRenderInfoFromPage(int page)" to MigraDoc to get the position of a placeholder on the title page.
viewtopic.php?p=1960#p1960

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 03, 2014 8:44 am 
Offline

Joined: Tue Sep 02, 2014 8:50 pm
Posts: 2
Ok. I have class which rewrite numbers as words.
I need to get some int value as number of pages to convert it to words.

I realized that I have to render the document in a stream of MigraDoс, received at the same time the number of pages to execute a method in my class, and then open the document from a stream in PDFSharp and add a single line?

Sorry for English


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group