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

Export to PDF ignores accents in Spanish.

5 Answers 87 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Joselaks
Top achievements
Rank 1
Joselaks asked on 02 Aug 2014, 02:58 PM
Export to PDF ignores accents in Spanish. 
Attached is a screenshot of the demo example payroll, which I modified the first two records to add accents. And herewith the screenshot of the pdf file (ExampleDemoPdf.png) where you can see the accents are ignored. 
How can I fix this problem?
Best regards,
Jose

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 04 Aug 2014, 08:35 AM
Hello Jose,

Thank you for contacting us.

Currently the PDF export in Silverlight works with 14 standart fonts. All other fonts should be registered in your project so that they are embedded in the PDF file and viewed correctly. To get more detailed information on how to register fonts using the FontsRepository you may follow this link to Telerik's forum post about registering custom fonts in PDF export.

I hope this is helpful. If you have any other questions or concerns do not hesitate to contact us again.

Regards,
Deyan
the Telerik team
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Joselaks
Top achievements
Rank 1
answered on 05 Aug 2014, 01:45 PM
I want to set the spreeadsheet with one of the 14 standard fonts.
I used the following code:

ActiveWorksheet.Cells[0, 0].SetFontFamily(new ThemableFontFamily("Courier"));

but it did not work.
On the menu ribbon demo font selector does not include any of the 14 standard fonts that supports exporting to PDF format (attached screenshot).
How I can set the template the spreeadsheet  in any of the 14 standarrt fonts for displaying accents in expotación to PDF format?
Best regards,
José
0
Deyan
Telerik team
answered on 06 Aug 2014, 04:27 PM
Hello Jose,

You could register missing PDF fonts before export by getting the fonts data from a web service. I am attaching a sample solution showing how to achieve this. A few words about the solution:
  • The solution contains two projects - Silverlight project and ASP web project.
  • The web project provides service that gives you the fonts data by given fontFamilyName, isItalic and isBold parameters.
  • The Silverlight project generates sample spreadsheet data, using the first 10 font families from the RadSpreadsheet's FontsProvider. This may be seen in the GenerateSampleWorksheet method.
  • When you click on the Export PDF button the ​RegisterMissingPdfFontsBeforeExport goes through all used fonts and checks if they are already registered. If some fonts are missing from the FontsRepository we use the web service to get their font data and then register them. 
  • After all fonts are registered the ExportPdf method is called and the PDF is created successfully.
  • You may additionally notice that some of the exported fonts (Aharoni and Andy) are still missing the special character. That happens because this fonts does not support this symbol. This may be seen when running the Silverlight demo as well. There you will be able to see that the special symbol for this fonts is drawn differently from the other symbols in the same font (Silverlight uses fallback mechanism for finding the symbol in some of the other standart fonts).

I hope this is helpful. I you have further questions do not hesitate to write again.

Regards,
Deyan
the Telerik team
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Joselaks
Top achievements
Rank 1
answered on 07 Aug 2014, 01:42 PM
Hello Deylan,
Thanks for the example, very didactic !!!
But the problem remains, because when I export to PDF, the accented characters no appear. 
Attached screenshot of the spreadsheet in run mode, and the result when I export to PDF. 
I'm forgetting to do something more than just run the example?
Best regards,
Jose
0
Anna
Telerik team
answered on 08 Aug 2014, 02:03 PM
Hello Jose,

We have tried to reproduce the issue without any success. I am attaching the expected result for the PDF export of this demo. Could you please check the following:
  • The StartUp project for your solution should be the web project (not the Silverlight project).
  • Could you please make sure the service is running successfully. Are there any exceptions debugging GetFontData method in FontService.svc.cs? Do you hit a breakpoint inside the if statement of this method for some of the requested fonts?
  • When debugging the GetFontDataCompleted method in MainPage.xaml.cs do you hit a breakpoint inside the if statement of this method?

I am looking forward to hearing from you again.

Regards,
Anna
the Telerik team
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Spreadsheet
Asked by
Joselaks
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Joselaks
Top achievements
Rank 1
Anna
Telerik team
Share this question
or