Save word as PDF. Can't find the font which has a "postfix" in name

Hello, I get strange issue with converting Word to PDF.

I got documents with text with “Times New Roman CYR” font. This documents need to be converted to PDF.

And Aspose can’t find this font. I’ve tried to use Font Substituion to replace “Times New Roman CYR” with “Times New Roman”. But it doesn’t work well. PDF is different. At least I can see that line word wrapping is different in PDF and original docx. By some reason in PDF it wrap the word at the middle of the word.

Also what I see. If in docx file I will replace fonts with stabdard “Times New Roman” - it looks exactly the same in Word as with “Times New Roman CYR”. And in PDF it also looks good.

Also If I try to convert original docx with “Times New Roman CYR” to PDF using Word -> it produces correct PDF, and also I can see "“Times New Roman CYR” in the list of embedded fonts. But when I covert to PDF using Aspose -> it embeds TimesNewRomanPSMT. While in PDF generated by Word I see “ABCDEE+Times New Roman CYR” in embedded fonts list.

I can’t figure out how to make it work right. Also I don’t understand what this “CYR” postfix means. And why it has such impact on PDF generation. For it looks like that it’s still exactly the same Times New Roman font.

But as I feel it’s the same as “Times New Roman” (I can’t find any other font on the system except standard Times New Roman.
And I also see that this “Times New Roman CYR” font is missing in Word list box, but I can type it manually and it will be applied.

@vabrutski Could you please attach your input and output documents here for testing? we will check the issue and provide you more information. Unfortunately, it is difficult to say what the problem is without a real document.

Hi Alexey, it tooks time to create an example with minimum set of data to reproduce. In the attached word file you will see the word “kkkkkkkkkkkkkk” which is incorrectly split to 2 words when converted to PDF(and looks like extra space added in this case.

What I also noticed.

  • Looks like it’s not related to this Times New Roman Cyr font, because if I will change it manually to classic TNR and then back. Issue dissapeared.
  • I don’t know what is the special in this kkkkkk word, I could get using original document and editing original words. But when I type words from screacth using same text area - it works as expecrted.
  • So my assumption there is some formatting specific in the original text. And it brokes the export. Also I suppose that when I change the font back and forth -> it resets this formatiing specific.
  • Keep in mind that only work kkkkkkkk in the docx has this issue

destination_bad.pdf (31.0 KB)
source.docx (23.5 KB)

@vabrutski
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25643

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thanks Alexey, looks like I see where is an issue and I can create workaround.
But now I have a new question. Is it possible to manipulate with RunFonts in Word Document via Aspose?

I couldn’t find that. I need to delete some special entries

@vabrutski You can modify run font using Run.Font property. Could you please let us know what exactly it is required to change?

I need to impact on <w:rFonts w:hint="eastAsia"/>
It producess bad pdf as result
I want to remove it

I need to reproduce something that described here
https://www.cyberforum.ru/ms-word/thread3085505.html

@vabrutski I am afraid, there is no way to reset this options using Aspose.Words. It is read and stored internally, but there is no access to it in Aspose.Words Public API.

Got it. Thanks Alexey

1 Like

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