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

PrepareDocument() for particular pages?
https://forum.pdfsharp.net/viewtopic.php?f=2&t=951
Page 1 of 1

Author:  mikesowerbutts [ Tue Nov 24, 2009 2:19 pm ]
Post subject:  PrepareDocument() for particular pages?

Hi,

Each time I add a page and tables etc. to that page, i call my RenderPgs() function, which calls renderer.PrepareDocument(). This ends up getting called lots of times and since it prepares the whole document everytime, the longer the number of pages, the longer PrepareDocument() takes to process.

I realise my code is fundamentally wrong in the way it works now (i presume i should only render pages once ALL pages have been added, but applying this to my existing code would cause it to really mess up when it comes to the PDFSHarp drawing bits) is there a way to:
Code:
int start = PdfDocument.PageCount();
renderer.PrepareDocument(start);

where it will start at the start page and ignore previous pages (as they are already rendered) and prepare until the end?

Mike

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