We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Long text (more pages)

I ve got a long text. How can I divide  my text In multiple pages in automatic? 

3 Replies

PH Praveenkumar H Syncfusion Team October 27, 2015 05:46 AM UTC

Hi Lorenzo,

You can draw long text using “PdfTextElement” class and you can automatically paginate the text to multiple pages, please refer the following code snippet.


PdfDocument doc = new PdfDocument();

PdfPage page = doc.Pages.Add();

PdfTextElement element = new PdfTextElement(longText);

PdfLayoutFormat format = new PdfLayoutFormat();

format.Layout = PdfLayoutType.Paginate;


element.Draw(page, 0, 0,format);

MemoryStream stream = new MemoryStream();


doc.Save(stream);

doc.Close(true);

Please let us know if you need further assistance.

With Regards,
Praveen



LG Lorenzo Giudici October 27, 2015 04:37 PM UTC

It works well! Thanks


KC Karthikeyan Chandrasekar Syncfusion Team October 28, 2015 05:04 AM UTC

Hi Lorenzo,
We are glad to know that your requirement has been fulfilled, please let us know if you need any further assistance.

Regards,
Karthikeyan.C

Loader.
Live Chat Icon For mobile
Up arrow icon