I am generating a pdf using Aspose words. There is a slight difference in the vertical spacing of text while a when an entire line in a column in bold. The difference is subtle but evident. PFA the generated pdf.
aspose-generated.pdf (28.0 KB)
The code required to reproduce this issue is given below:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.moveToDocumentStart();
builder.insertCell();
Table table = builder.startTable();
table.setAlignment(TableAlignment.CENTER);
table.setBorders(LineStyle.EMBOSS_3_D, 2.0, Color.BLACK);
builder.insertHtml("<b><font size=\"5\">Lorem Ipsum</font></b>");
builder.endTable();
String finalClauseText = "<table style=\"width:100%;\"><tr><td valign=\"top\" style=\"width:48%\"><p style=\"font-family:Arial;font-size:12px;text-align:justify;page-break-after:avoid;page-break-inside:avoid;\"><b><u>Article 2</u> - texte en gras</b><span style=\"white-space:pre-line;\"></span></p></td><td style=\"width:4%\"></td><td valign=\"top\" style=\"width:48%\"><p style=\"font-family:Arial;font-size:12px;text-align:justify;page-break-after:avoid;page-break-inside:avoid;\"><b><u>Article 2</u> - bold text</b><span style=\"white-space:pre-line;\"></span></p></td></tr></table><table style=\"width:100%\"><tr><td valign=\"top\" style=\"width:48%\"><div style=\"font-family:Arial;font-size:12px;text-align:justify\"><strong>Contrairement à la croyance populaire, le Lorem</strong> Ipsum n'est pas un simple texte aléatoire. Il trouve ses racines dans un morceau <span style=\"text-decoration: underline;\">de littérature latine</span> classique datant de 45 avant J.-C., ce qui lui donne plus de 2000 ans. Richard McClintock, professeur de latin au Hampden-Sydney College en Virginie, a recherché l'un des mots latins les plus obscurs, consectetur, dans un passage du Lorem Ipsum, et en parcourant les citations du mot dans la littérature classique, <strong>il a découvert</strong> la source incontestable. Le Lorem Ipsum provient des sections 1.10.32 et 1.10.33 du \"de Finibus Bonorum et Malorum\" (Les extrêmes du bien et du mal) de Cicéron, écrit en 45 avant J.-C. Ce livre est un traité sur la théorie de l'éthique, très populaire pendant la Renaissance. La première ligne de Lorem Ipsum, \"Lorem ipsum dolor sit amet...\", <strong>provient d'une ligne de</strong> la section 1.10.32.</div></td><td style=\"width:4%\"></td><td valign=\"top\" style=\"width:48%\"><div style=\"font-family:Arial;font-size:12px;text-align:justify\"><strong>Contrary to popular</strong> belief, Lorem Ipsum is not simply random text. It has roots in a piece<strong> of classical Latin literature from 45</strong> BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extrem<strong>es of Good and Evi</strong>l) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.</div></td></tr></table>\r\n";
builder.insertHtml("<br>" + finalClauseText);
String tempFileAbsolutePath = "/some/path/file.pdf";
doc.save(tempFileAbsolutePath, SaveFormat.PDF);