XSL-FO Font Naming Issue

Hi,

I have been using the Aspose.PDF library to render XSL-FO as a PDF but have encountered a Font Naming issue where the font cannot be found when printing. In working with through the issue it was found that the /BaseFont value being stored in the PDF does not follow the PostScript naming schema.

Here is the documentation I found from the Adobe site: http://partners.adobe.com/public/developer/en/font/5088.FontNames.pdf

Sec 2.2 mentions that the FontName generally consists of the family name followed by a hyphen and then styling attributes.

Given that info, if my XSL-FO element had a font-family=“Arial” and a font-weight=“bold” then the /BaseFont value in the PDF would be “Arial-Bold” (which works correctly) but when using the Aspose.Pdf.Generator.PDF::BindFO function the /BaseFont written out to the PDF is “ArialBold” which fails the font look up.

Here is the code i used to generate the PDF and attached is a sample xml:

global::Aspose.Pdf.Generator.Pdf oPdf = new global::Aspose.Pdf.Generator.Pdf();

oPdf.BindFO(“Font.xml”);

oPdf.Save(“output.pdf”);

This will create the following object in the PDF file:

<</Type/Font

/Subtype/TrueType

/FirstChar 0

/LastChar 255

/Widths[…]

/Encoding/WinAnsiEncoding

/BaseFont/ArialBoldItalic

/Name/ArialBoldItalic

/FontDescriptor 12 0 R

If that value is updated to the following, then everything works correctly:

<</Type/Font

/Subtype/TrueType

/FirstChar 0

/LastChar 255

/Widths[…]

/Encoding/WinAnsiEncoding

/BaseFont/Arial-BoldItalic

/Name/ArialBoldItalic

/FontDescriptor 12 0 R

Is there a way to change the value that is being stored in the /BaseFont field?

Hi Rene,


Thanks for your inquiry. After initial investigation, we have logged an investigation ticket PDFNEWNET-37125 for further investigation and resolution in our issue tracking system. We will keep you updated about the issue resolution progress via this forum thread.

We are sorry for the inconvenience caused.

Best Regards,

Thanks.


If you need any further information please let me know.

Jeff

Hi Jeff,


Thanks for your feedback. Sure we will request you if need any further information for the issue resolution. We will keep you updated about the issue resolution progress via this forum thread.

Best Regards,

Hi,


Just checking to see what the status of this issue is.

Please let me know if you need any further information.

Thanks
Jeff

Hi Jeff,


Thanks for your inquiry. I am afraid your reported issue is still not investigation due to other priority issues. However we have requested our development team to complete the issue investigation at their earliest and share an ETA. We will update you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

Hi Rene,


Thanks for your patience.

The development team has further investigated the issue reported earlier and as per our current estimates, we plan to get this problem fixed in next release of Aspose.Pdf for .NET 9.8.0, which is planned to release in early November-2014 (but still its not a promise. We will try our level best to get this problem fixed by said time). Please be patient and wait for the resolution.

Hi Jeff,


Thanks for your patience.

The development team has further investigated the issue reported earlier and in order to resolve the issue, we suggest you to please try using the Document Object Model (DOM) of Aspose.Pdf namespace. This approach do not have any issues with Postscript font names or font search. When using this approach, fonts are already embedded. Please try using following code snippet.

[C#]

XslFoLoadOptions xsl = new XslFoLoadOptions();<o:p></o:p>

xsl.UseOldXslFoEngine = false;

Document doc = new Document("c:/pdftest/font.xml", xsl);

doc.Save("c:/pdftest/font)_output.pdf");


In fact we have fixed postscript names for TrueType fonts in DOM, but in reallity, DOM generates CIDFonts and they should not have such naming issues. In case you still face similar issue, we will further investigate the problem and require little mroe time because another implementation (disable CIDFonts, generate TrueFype fonts with Postscript naming) will take additional time.

The issues you have found earlier (filed as PDFNEWNET-37125) have been fixed in Aspose.Pdf for .NET 9.9.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.