We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Formatting error: word spacing different in converted PDF

Hello. We use Aspose.Words to convert Word files to PDF. With some files, the word spacing in the converted PDF file is inconsistent with the Word file, resulting in in appropriate line breaks. For instance, in the linked files, the second line of the paragraph and the first line of the signature block appear differently in the PDF than in the Word file.


Word: https://s3.amazonaws.com/uploads.hipchat.com/83727/604193/Yc2N5gRVA5sFPxq/Sig%20Block%20Formatting.DOC
PDF: https://s3.amazonaws.com/uploads.hipchat.com/83727/604193/Det7V4CuEYL1yEu/Sig%20Block%20Formatting.pdf

Hi Gordon,

Thanks for your inquiry.

We have tested the scenario using latest version of Aspose.Words for Java 15.12.0 and have not found the shared issue. Please use Aspose.Words for Java 15.12.0. We have attached the output Pdf with this post for your kind reference.

Hi Tahir,


We upgraded to the latest version (15.12) and are still having the same error. Strangely, the conversion works well on our OSX deployments, but not on our Ubuntu deployments. We are not sure why the fidelity of the conversion is dependent on the environment. Are you able to test the conversion on a linux deployment?

Thanks,
Gordon

Hi Gordon,


Thanks for sharing the detail. We have tested the scenario at Ubuntu and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-1266. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Gordon,


Thanks for your patience. Please note that Aspose.Words requires TrueType fonts when rendering documents to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts on the machine where you’re converting documents to Pdf. Please refer to the following articles:

How Aspose.Words Uses True Type Fonts
How to Specify True Type Fonts Location
How to Receive Notification of Missing Fonts and Font Substitution during Rendering

We have tested the scenario using latest version of Aspose.Words for Java 15.12.0 with following code example and have not found the shared issue. We have attached the output Pdf with this post for your kind reference.

try<o:p></o:p>

{

String dir = "/home/pavel/aspose/tmp/1266/";

FontSettings.setFontsSources(

new FontSourceBase[]

{

new SystemFontSource(),

new FileFontSource(dir + "Calibri/calibri.ttf"),

new FileFontSource(dir + "Calibri/calibrib.ttf"),

});

Document doc = new Document(dir + "Sig Block Formatting.doc");

doc.save(dir + "output_ubuntu.pdf");

}

finally

{

FontSettings.resetFontSources();

}