Wrong DecodedFontName in some embedded fonts

Hello,

I have an issue with this pdf. There are 6 embedded fonts and 2 of them give wrong information about DecodedFontName.

testfont.pdf (373.4 KB)

Using this code snippet :

public static void ReadFonts()
    {
        Document pdf = new Document(@"testfont.pdf");
        Aspose.Pdf.Text.Font[] fonts = pdf.FontUtilities.GetAllFonts();
        foreach (Aspose.Pdf.Text.Font font in fonts)
        {
            Console.WriteLine($"font name : {font.FontName} DecodedFontName : {font.DecodedFontName}" );
        }
        pdf.Dispose();
    }

it produce this output :

font name : Calibri DecodedFontName : BCDEEE+Calibri
font name : Calibri-Bold DecodedFontName : BCDFEE+Calibri-Bold
font name : Calibri-LightItalic DecodedFontName :
font name : Calibri-LightItalic DecodedFontName : BCDHEE+Calibri-LightItalic
font name : Calibri-BoldItalic DecodedFontName : BCDIEE+Calibri-BoldItalic
font name : Calibri DecodedFontName :  

I was expecting this :
asposebaddecodedfontname.JPG (40.6 KB)

for the thirdone : instead of “\0\0\0\0\0\0\0\0\0\0\0\0\0” i need BCDGEE+Calibri-LightItalic (like in the screenshot private value)

asposebaddecodedfontname2.JPG (26.7 KB)

for the sixth : instead of “\0\0\0\0\0\0\0” i need BCDJEE+Calibri (like in the screenshot private value)

It looks like there are doubles names (Calibri and Calibri-LightItalic) in the fonts, maybe this is the source of the bug.

I really need this fix as soon as possible, please do something quick…

Thanks

@tfipsrd

We tested the scenario in our environment and were able replicate the issue. Therefore, have logged it as PDFNET-49496 in our issue tracking system for the sake of further investigation. However, please note that the issue is logged under free support model where issues are resolved on first come first serve basis. We have logged your concerns along with the ticket as well and will surely inform you as soon as we have further updates regarding its resolution. Please be patient and give us some time.

We apologize for the inconvenience.

The issues you have found earlier (filed as PDFNET-49496) have been fixed in Aspose.PDF for .NET 21.4.

Hello,

Thanks, I tried Aspose PDF.net 21.4 but I don’t get what I expect.

Now i gotrthis :
font name : Calibri DecodedFontName : Calibri
font name : Calibri-Bold DecodedFontName : Calibri-Bold
font name : Calibri-LightItalic DecodedFontName : Calibri-LightItalic
font name : Calibri-LightItalic DecodedFontName : Calibri-LightItalic
font name : Calibri-BoldItalic DecodedFontName : Calibri-BoldItalic
font name : Calibri DecodedFontName : Calibri

Now I get only the font name in the decoded font name and i need the full DecodedFontName with the prefix (example : BCDEEE+) like here :

font name : Calibri DecodedFontName : BCDEEE+Calibri
font name : Calibri-Bold DecodedFontName : BCDFEE+Calibri-Bold
font name : Calibri-LightItalic DecodedFontName : BCDGEE+Calibri-LightItalic
font name : Calibri-LightItalic DecodedFontName : BCDHEE+Calibri-LightItalic
font name : Calibri-BoldItalic DecodedFontName : BCDIEE+Calibri-BoldItalic
font name : Calibri DecodedFontName : BCDJEE+Calibri

So this fix is useless to me :frowning:
Can you check and fix it again in this direction ?
Thanks

@tfipsrd

Thanks for sharing your feedback.

We have recorded it and will further look into the details of the ticket accordingly. We will inform you once we have additional updates in this regard.

We apologize for the inconvenience.

Thanks, it is a blocker issue in our project, so please consider it as urgent :slight_smile:

@tfipsrd

The point is that value of DecodedFontName property does not mean “the full font name with the prefix” (like BCDEEE+…).

DecodedFontName Property Description:

Sometimes PDF fonts (usually Chinese/Japanese/Korean fonts) could have specific font name. This name is the value of PDF font property BaseFont and sometimes this property could be represented in hexadecimal form. If read this name directly it could be represented in non-readable form. To get readable form it is necessary to decode the font name by rules specific for this font.

This property returns decoded font name, so use it for cases when you meet with a non-readable FontName.

If property FontName has readable form, this property will be the same as FontName, so you can use this property for any cases when you need to get font name in a readable form.

Previously DecodedFontName sometimes returned full name. But that was a side effect of previous incorrect implementation: attempting of decoding internal BaseFont value when its actually not encoded.

The full name (aka BaseFont value, aka “PostScript name” according to p. 9.6.3 of PDF Specification) currently is not available from API of Font class. We have created PDFNET-49791 to make it available for users. ETA is Aspose.PDF 21.5.

Is it possible to get a preview “nightly build” with this fix as soon as it is fixed ? Just to validate before the official release.
Thanks

@tfipsrd

We are afraid that we cannot offer build preview before. The next version is scheduled to be released in the first week of next month i.e. May 2021. We will surely inform you as soon as the release is out.

We apologize for the inconvenience.

The issues you have found earlier (filed as PDFNET-49791) have been fixed in Aspose.PDF for .NET 21.5.

Hello,
With the latest 21.5, now the property BaseFont contain what I need.
Thanks a lot

1 Like