Aspose.Words. Word font style differs from PDF

Hi Aspose Team,

During using the pdf converter tool (Aspose.Words) we noticed that font in PDF document differs from source Word document (the letters spacing is noticeably wider). We compared document with the result of native Word conversion (via Save as PDF) and did not observe this problem.

The code snippet we use to convert it is:

static void ConverttoPdf()
{
    string dataDir = "D:\\Aspose.Font\\";
    Document doc = new Document(dataDir + "Template.docx");
    dataDir = dataDir + "Template_out.pdf";
    var saveOptions = (PdfSaveOptions)SaveOptions.CreateSaveOptions(SaveFormat.Pdf);

    saveOptions.Compliance = PdfCompliance.PdfA1b;
    doc.Save(dataDir, saveOptions);
}

The version of Aspose.Words we use in our project is 17.6, but we used also the trial version of 19.3, to check whether problem is solved in latest version.

We attached follow the files (source word doc and the PDF conversion result) where you can find the difference.

We wanted to know, whether this problem is fixable, because it’s critical to our project.

Thanks,

Lidia

Examples.zip (111.4 KB)

@directum

We have not found any issue with font styles in the output PDF. Could you please share some more detail about the issue you are facing along with screenshot of problematic sections in output document?

It seems that your query is related to hyphenation of words. We suggest you please read the following article. You need to register Russian hyphenation dictionary.
How to Hyphenate Words of Specified Languages

Thank you for your response. Please find attached the sample files with details below. I underlined the problematic section. There are two screenshots: first one is the difference between source Word document and output PDF, and the second one – the same document but with the automatic hyphenation option. As you can see, in the second case there is no issue with letters spacing but the hyphenation in source and output doesn’t match.
Also, we checked the advice from the article. Unfortunately, converting result is the same.
Code snippet with loading of hyphenation dictionary:

static void ConvertTOPDFWithHyphen()
{
    string dataDir = "D:\\Aspose.Font\\1\\";
    Document doc1 = new Document(dataDir + "Template.docx");
    Hyphenation.RegisterDictionary("ru-RU", dataDir + @"hyph_ru_RU.dic");
    dataDir = dataDir + "Template.pdf";
    doc1.Save(dataDir);
}

The screenshot of the converting with hyphenation dictionary is also attached.
Would to know, is it somehow connected with fonts? Is there the opportunity to get the normal chars spacing without auto hyphenation option of Word?

Thanks,
Lidia

3 Withou_ auto_hyphenation_and_with_dictionary.png (60.9 KB)
2_With_auto_hyphenation.png (98.1 KB)
1_Without_hyphenation.png (99.5 KB)

@directum

Please ZIP and attach hyph_ru_RU.dic here for testing. We will investigate the issue and provide you more information on this issue.

Attached hyph_ru_RU.dic
hyph_ru_RU.zip (10.7 KB)

@directum

We have tested the scenario 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 WORDSNET-18373. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18373) have been fixed in this Aspose.Words for .NET 22.9 update also available on NuGet.