Font changed when rendering to PDF

Hi Aspose team,


I noticed an issue with rendering a docx file to pdf. The font seems to have changed slightly which causes some words to move into the next line of the document.

In the attached files you can see the original word document, and two pdf files; once rendered with MS Word 2010 and once rendered with Aspose 17.5.0

I have highlighted the last words of a line in red font and the last word of a page with a yellow background. As you see, the pdf rendered with word looks exactly the same but the pdf by aspose doesn´t. Also the font seems a bit different, I guess that may be the reason?

For reproducing it was enough to create a Document object from the docx file and instantly save it as pdf:

var d = new Document(“document.docx”);
d.Save(“rendered_aspose.pdf”);

Kind regards,
Daniel

Hi Daniel,


Thanks for your inquiry. We have tested the scenario with your shared document using Aspose.Words for .NET 17.5 and noticed the reported issue. We have logged a ticket WORDSNET-15393 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

Hi Aspose team,

is there meanwhile a status update to this issue? I also noticed that the attachments seem to got lost during the forumn move, should I reupload them?

Kind regards,
Daniel

@Serraniel,

Thanks for your inquiry. There is no need to share the document. Currently, your issue is under analysis phase. Once our product team completes the analysis of your issue, we will then be able to provide you an estimate.

Thanks for your patience and understanding.

@Serraniel

Thanks for your patience. Our product team has investigated the issue and found it is not a bug. The issue occurs because hyphenation dictionary is not registered in code. Please note the text in the document is formatted as English and French, so both dictionaries en-US and fr-Fr should be registered in order to hyphenate the document. Please check following code snippet for reference, it will help you to resolve the issue. Please also find attached sample output and dictionaries for reference.

15393.AW.Hyphenated.zip (96.7 KB)

Hyphenation.RegisterDictionary("en-US", myDir + "hyph_en_US.dic");
Hyphenation.RegisterDictionary("fr-FR", myDir + "hyph_fr.dic");
try
{
	var doc = new Document(myDir + "document.docx");
	doc.Save(myDir + "document.out.pdf");
}
finally
{
	Hyphenation.UnregisterDictionary("en-US");
	Hyphenation.UnregisterDictionary("fr-FR");
}
1 Like

Hi Tilal,

thanks for your reply. I can confirm that code you porovided solves the issue. May I ask you where I can get the hyphen dictionaries from? With a bit of google I found Text Control: Digital Document Processing Components for Developers of Web, Mobile, Cloud and Desktop Applications which offers dictionaries for a lot of languages as download. But using their dic files I got a different result with some hyphenatings missing. Do you can provide any source for that?

As we offer our product in up to 15 languages I would prefer using the dic files from a source that is quite consistent with the hyphening word itself does.

As Germany is our main area I will do some testing with other documents and the source I posted for the dic files to evaluate at least their German dic files…

Kind regards,
Daniel

@Serraniel

Thanks for your feedback. Please try dictionaries from following OpenOffice link. You may also google and can get number of other options on web.

OpenOffice dictionaries