Text flow and automatic page breaks
PDFsharp is a .NET library for creating and modifying PDF documents.
Brought to you by:
pdfsharp,
stefan_lange
Hi everybody!
First of all, thank you very much for this wonderful library!
But there are still some things I'd like to do and I don't know if that's possible already. Maybe I just don't know the right command?!
I generate the PDF according to user input.
The user can enter e.g. three form fields (subject, body and signature) and now I want those fields to be rendered in PDF. However, in order to make the text flow smooth I would like to know where the first block of text ended so I can start the next block there and not give a fixed position (which will cause either gaps or overlaps).
I've come across the method "MeasureString" which sounds promising, but for some reason it does not work as intended, i.e. it returns a height that is too small.
Plus I have a problem if the text is longer than the page. I don't know how to slice the text at the right point and then create a new page with the remaining text.
Thanks in advance!