Hello milan,
When you want to use the method: pdf.getTextInfo().setLineSpacing(<my value>), you have to call this method before any Section has been added to the document. As the pdf.getTextInfo().setLineSpacing(<my value>) functions in the entire document, If you call this method later, it's hard to adjust all the objects which have been added to the document to the linespacing you specified. Here is some demonstrating method.
Pdf pdf = new Pdf();
pdf.getTextInfo().setLineSpacing(10F);
Section sec1 = pdf.getSections().add();
Text text1 = new Text(sec1," first line \n second line");
sec1.getParagraphs().add(text1);I hope this will help. Thank you for using our product!
Sandy.Zhang
Product Developer
Aspose Changsha Team
About UsContact Us