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

PDF Font Encoding/iPad Display Issue

3 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 19 Sep 2013, 09:27 PM
I have a silverlight/wcf application that uses Telerik reporting. One of the requirements of the app is to be able to combine multiple reports into a single pdf. In order to do this, I have a custom report service class that inherits from ReportServiceBase. The silverlight app passes a list of report names to the wcf service, which loops through the list and calls the report service's Render("PDF", etc...) method. In order to keep the file size small, I set FontEmbedding to None in the Render call's deviceInfo. Using the DocumentBytes from each RenderingResult, I append each pdf into a single pdf using a third party tool (PDFSharp). The bytes of the single pdf are then sent back to the silverlight side, where they're loaded into a RadPdfViewer, where users can then save the pdf (using the method described here: http://www.telerik.com/community/forums/silverlight/pdfviewer/save-pdf-file.aspx)

All of this works as expected, except that the resulting pdf is using Identity-H font encoding and a TrueType (CID) font. If I create (roughly) the same pdf using another tool (PDFXchange), the resulting pdf has WinAnsiEncoding and a TrueType font (not CID). When viewing the resulting pdfs on an iPad, the Telerik rendered pdf doesn't display italics or bold, whereas the non-Telerik pdf does. The font encoding is the only readily apparent difference between the two pdfs, which leads me to believe that's the issue (Note: The issue still occurs if I just render a single report and don't use the third party tool to merge, so it's not an issue with the third party tool).

Is there a way to change the font encoding used by the Telerik report service Render method? Or any other thoughts as to why an iPad can't display bold/italic fonts in a pdf generated in this manner?

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 23 Sep 2013, 04:46 PM
Hello Robert,

If all of the combined PDF files are created from Telerik Reporting documents, you can use a ReportBook to gather all report definitions and preview/export/print them at once as a single document.

About your issue, if fonts are not embedded into the document(FontEmbedding to None) you have to verify that the fonts used in the document are installed on the devices. The used fonts can be checked in the PDF file's Document Properties - Fonts.

If you need further help please send us an exported as PDF report that illustrates the issue.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Robert
Top achievements
Rank 1
answered on 23 Sep 2013, 05:33 PM
The collection of reports to preview/print is chosen in the UI and could be different every time. From what I've read on these forums, it's not possible to create a dynamic report book in silverlight, although if it is I'd love to hear about it.

The font in question is Arial, and the device has it installed. I can't attach PDFs here, do I need to open a support ticket?

Fonts from the Telerik rendered PDF (as seen in Acrobat):
Arial
Type: TrueType (CID)
Encoding: Identity-H
Actual Font: Arial
Actual Font Type: TrueType
Arial,Bold
Type: TrueType (CID)
Encoding: Identity- H
Actual Font: Arial,Bold
Actual Font Type: TrueType
Arial,Italic
Type: TrueType (CID)
Encoding: Identity-H
Actual Font: Arial,Italic
Actual Font Type: TrueType

Fonts from the non-Telerik rendered PDF (as seen in Acrobat):
ArialMT
Type: TrueType
Encoding: Ansi
Actual Font: ArialMT
Actual Font Type: TrueType
Arial-BoldMT
Type: TrueType
Encoding: Ansi
Actual Font: Arial-BoldMT
Actual Font Type: TrueType
Arial-ItalicMT
Type: TrueType
Encoding: Ansi
Actual Font: Arial-ItalicMT
Actual Font Type: TrueType

As I stated, the encoding jumped out at me as being different, unless an "Actual Font" of "Arial" is in fact a different font than "ArialMT." In which case, how do I go about selecting the correct font in the report designer? There's only one Arial, I don't seem to have the choice of selecting ArialMT.
0
Stef
Telerik team
answered on 27 Sep 2013, 09:41 AM
Hello Robert,

It appears the iOS mostly supports postscript fonts which cannot be applied from Windows OS environment. Test using any of the supported by both OS environments font as Verdana or enable the font embedding for the PDF documents.

Let us know if you have any further questions.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Stef
Telerik team
Robert
Top achievements
Rank 1
Share this question
or