This is a migrated thread and some comments may be shown as answers.

Why is the font changing?

3 Answers 266 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
Андрей
Top achievements
Rank 1
Андрей asked on 16 Aug 2019, 04:05 PM

Hi!

I am using RadWordsProcessing  and load Word`s file.

RadFlowDocument document;
DocxFormatProvider fileFormatProvider = new DocxFormatProvider();
string fileName = Server.MapPath("./Data/Document.docx");
using (FileStream input = new FileStream(fileName, FileMode.Open))
{
            document = fileFormatProvider.Import(input);
}
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

 

Text in the file is written in Times New Roman font.

But when exporting to pdf, the font changes to Segoe UI font.

Why?

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 21 Aug 2019, 01:40 PM
Hi Андрей,

The code seems all right. I tried to reproduce the issue described, but in my example, I haven't noticed such behavior. Could I ask you to send me the document so I can test it locally and try to find the reason for the issue you are experiencing?

Regards,
Martin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Tommee
Top achievements
Rank 1
answered on 29 Aug 2020, 01:08 AM

any updates on this? i'm encountering the same issue.

01.DocxFormatProvider DocxProvider = new DocxFormatProvider();
02.RadFlowDocument DocX = new RadFlowDocument();
03.string TemplatePath = Path.Combine(Environment.CurrentDirectory, @"..\CRS\wwwroot\LetterTemplates\VictimNotification.docx");
04. 
05.    using (Stream input = File.OpenRead(TemplatePath))
06.    {
07.        DocX = DocxProvider.Import(input);
08.    }           
09. 
10.PdfFormatProvider provider = new PdfFormatProvider();
11.byte[] renderedBytes = null;
12. 
13.    using (MemoryStream ms = new MemoryStream())
14.    {
15.        RadFixedDocument fixedDocument = provider.ExportToFixedDocument(DocX);
16.        provider.Export(DocX, ms);
17.        renderedBytes = ms.ToArray();
18.    }
19. 
20.return File(renderedBytes, "application/pdf", "Sample.pdf");

 

0
Martin
Telerik team
answered on 31 Aug 2020, 06:59 AM

Hello Tommee,

I am attaching a sample project converting a DOCX document with Times New Roman font set to a PDF document and the font is imported and exported as expected. Please, feel free to modify it in a way closer to your scenario.

In order to deeper investigate this case, I would like to ask you to open a new support ticket and send us the document causing this behavior. I must assure you we treat all client files in a strictly confidential manner and for testing purposes only.

Looking forward to hearing from you.

Regards,
Martin
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Cory
Top achievements
Rank 1
commented on 25 Aug 2023, 08:38 PM | edited

We are experiencing this same issue when importing from HtmlFormatProvider to RadFlowDocument and then exporting to PdfFormatProvider. Please advise. I can see the Times Roman font in the end pdf document's html, but the content in the pdf is rendering as a standard system sans-serif font.
Yoan
Telerik team
commented on 30 Aug 2023, 08:55 AM

Hello Cory,

In order to be able to investigate the case further and continue the conversation in a more private thread, I would like to ask you to open a new support ticket regarding the issue you are facing. If possible please share for inspection the sample HTML document that reproduces the behavior. I can assure you that anything shared by our clients is treated with strict confidentiality and is used for testing purposes only (as per our EULA section 11).

Thank you in advance.

Yoan

Tags
WordsProcessing
Asked by
Андрей
Top achievements
Rank 1
Answers by
Martin
Telerik team
Tommee
Top achievements
Rank 1
Share this question
or