Cannot create TrueType font type from FontFile3 with Type1C subtype!

0 Answers 162 Views
PdfProcessing
Marco
Top achievements
Rank 1
Iron
Iron
Iron
Marco asked on 06 Oct 2021, 09:06 AM

I try to import a pdf file from a external source. This contains a Typ3 font but I cannot import it.

My telerik version is 2021.2 so it should work. 

PdfViewer: Add support for Type 3 fonts (telerik.com) is completet in R1 2021.

I try to Import the file like this:

                var provider = new PdfFormatProvider();
                var document = provider.Import(File.ReadAllBytes(dokument.Hyperlink));

And I get this Exception: Cannot create TrueType font type from FontFile3 with Type1C subtype!

 

   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.FontFile3Stream.CreateOpenTypeFontSource(FontType fontType)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.FontFile3Stream.ToFontSource(FontType fontType)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.TrueTypeFontObject.TryCreateSimpleFontFromFontFile(SimpleFont& font)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.SimpleFontObject.TryCreateFontFromFontFile(FontBase& font)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Fonts.FontObject.ToFont(PostScriptReader reader, IRadFixedDocumentImportContext context)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Import.RadFixedDocumentImportContext.GetFont(PostScriptReader reader, FontObject font)

 

 

How can I import them correctly?

Tanya
Telerik team
commented on 08 Oct 2021, 01:46 PM

Hi Marko,

According to the specification of the PDF file format, a FontFile3 with subtype Type1C represents a Type1 font program in the Compact Font Format (CFF). The TrueType fonts are defined using a FontFile2 object. With that said, I can suppose that there is something getting wrong during the parsing of the document, or the document is invalid. However, to confirm that, I will need to inspect the specific PDF file with its definitions inside. Would it be possible to share it?

Marco
Top achievements
Rank 1
Iron
Iron
Iron
commented on 11 Oct 2021, 05:09 AM

Hi Tanya,

Thanks for your help. Sadly not, because it is from a customer, so I cannot share it. What can I inspect by myself?

Tanya
Telerik team
commented on 13 Oct 2021, 11:04 AM

Hi Marco,

My idea was to inspect the objects that are defined inside the PDF using a text editor (Notepad++, for example). I wanted to check whether the font is incorrectly defined or there is something wrong with the import logic of PdfProcessing.

If you would like, you can open a support ticket, where all the communication is private and all files are treated in a strictly confidential manner. I can assure you that we use them for testing purposes only and don't share them with third parties. This is also defined in our End User License Agreement, Section 1.11 Confidentiality.

No answers yet. Maybe you can help?

Tags
PdfProcessing
Asked by
Marco
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or