PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 7:03 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PdfSharp / MigraDoc help
PostPosted: Fri Jun 27, 2008 2:53 pm 
Offline

Joined: Fri Jun 27, 2008 2:45 pm
Posts: 2
I am new to PdfSharp, but its busy driving me nuts. I have gone throught the forum and can't find ansers to my questions

Q1: Automatic Pagebreaks
If I understand it correctly, MigraDoc Lite can do that and PdfSharp cannot. Can someone please give me a simple example how to do this?

I just want to add paragraphs and images (both of which the count/length I don't know) and want the code to sort out the pagebreaks itself.

Q2: Wordwrap
If I add a paragraph/text to the the document/page I want it to automatically use carrige return. Can someone please show me how to do this? Is there a setting or technique?

Help would be much appreciated!
Andre


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 28, 2008 1:45 pm 
Offline

Joined: Fri Jun 27, 2008 2:45 pm
Posts: 2
Well, I'll help myself then. This is for anyone else having the same problem.

I just used a Migradoc table. If a paragraph in a cell is too long, it will wrap it and start it on the next line.

As for the multiple pages, just continue adding stuff in cells and rows. Then do this after the renderer's PrepareDocument() method.

Code:
rend.PrepareDocument();
         
for(int i = 1; i <= rend.FormattedDocument.PageCount; i++)
{
   PdfPage page = doc.AddPage();         
   XGraphics gfx = XGraphics.FromPdfPage(page);
   rend.RenderPage(gfx,i);            
}


i = 1 because the numbering doesn't start at the conventional, but 1, which makes sense, sortoff.


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 417 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