|
PDFsharp - moved to http://forum.pdfsharp.net/ Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
|
Important Notice:
We regret to inform you that our free phpBB forum hosting service will be discontinued by the end of June 30, 2024.
If you wish to migrate to our paid hosting service, please contact billing@hostonnet.com.
View previous topic :: View next topic |
Author |
Message |
AViD
Joined: 27 Jun 2008 Posts: 2
|
Posted: Fri Jun 27, 2008 2:53 pm Post subject: PdfSharp / MigraDoc help |
|
|
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 |
|
Back to top |
|
|
AViD
Joined: 27 Jun 2008 Posts: 2
|
Posted: Sat Jun 28, 2008 1:45 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
|
|
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 vote in polls in this forum
|
|