datalogics / adobe-pdf-library-samples

Sample code for the Datalogics C++, Java, and .NET interfaces of the Adobe PDF Library
https://www.datalogics.com/adobe-pdf-library/
80 stars 62 forks source link

Multiline Text #27

Closed PouriaAmid closed 5 years ago

PouriaAmid commented 5 years ago

Hi, is there any simple way to create multiline text objects without breaking down the string into chars and create multiple text objects for each line?

Using .net framework and APFL 15.

datalogics-pgallot commented 5 years ago

@PouriaAmid you might want to take a look at this blog article, particularly the practiceLayout and layoutTOC routines.

PouriaAmid commented 5 years ago

Thanks for reply. The solution is to split the text in lines and add a new TextRun for each line. foreach (var line in lines){ Text.AddRun(new TextRun(line, font, gs, ts, matrix.Translate(x, y))); y -= ts.FontSize; }