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

automatic page breaks
https://forum.pdfsharp.net/viewtopic.php?f=2&t=484
Page 1 of 1

Author:  trimpy [ Fri Sep 19, 2008 5:42 pm ]
Post subject:  automatic page breaks

I am looking to duplicate how programs, like Word, handle automatic page breaks. I have a string of unknown length and would like to generate a PDF of that text and have it automatically add page breaks to generate n pages of a fixed page size.

Any help would be most appreciated.

Thanks

Author:  stardust [ Fri Sep 19, 2008 5:50 pm ]
Post subject: 

I belive if you use MigraDoc API that comes with PdfSharp to construct you document then automatic paging is done for you automatically when you render the document.

What you need is create a doucment, add a Section to the document, then from the Section object you can create a Paragraph object and assign your unknown length of text as the content. Then all you need to do is render the document and you have your pdf document with the text flowed over multiple pages.

The examples from the download package should be sufficient to show you how you can do all these.

Hope this helps.

Paul

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