Handling missing fonts in PPT(X) -> PDF conversion

I’m running Aspose.Slides 2.9.4 on Sun’s JDK7 under Fedora 13.
When I try to convert to PDF a PowerPoint file containing fonts that are not installed on the system, I receive:
com.aspose.slides.PptException: com.aspose.slides.obfuscated.bri: java.lang.UnsupportedOperationException: Cannot find the required font. Name:“Dialog.plain”, Style:0, IsExactStyle:false.

I do understand this means that the required font is not installed, but I’m not sure why it reports incorrect font name (“Dialog.plain” instead of “Arial”). My best guess is that Slides uses one of Java’s standard logical font names as a default replacement for the missing font, but that’s still not quite right, since the “Dialog” font is actually defined in fontconfig.properties (other apps in the JVM find it just fine).

So,
1) is there something I need to do (code-wise or cnfiguration-wise) to get Slides to use the fontconfig.properties (and in general fonts in $JRE_PATH/lib/fonts, for that matter) ?
2) is there another way to force slides to use a fallback font?

Thanks.

Hi Tom,


Thanks for inquiring Aspose.Slides.

I have tried to observe the issue shared by you but have not been able to completely understand your requirements. If you want to load fonts from custom location, please visit this thread link for your kind reference.

If the issue still persist on your end then please share the sample presentation along with the code snippet used. The font exception is usually generated when you have missing font in your environment. Also please try Aspose.Slides for Java 2.9.4, if you are not already using the same.

Many Thanks,

Thank you Mudassir, the post which you’re referencing helped me understand the issue better, but the feature that I’m really looking for is some kind of mechanism that will allow Slides to fall back automatically to some default font whenever the font used in a PPT file is not available on the host.

My observation was that Slides seems to incorporate such concept already, but it either hasn’t been fully implemented, or I haven’t been able to enable/configure it properly.

I do use Aspose.Slides for Java 2.9.4. Here’s the code I use:
License license = new License();
license.setLicense(new FileInputStream(new File(“Aspose.Slides.lic”)));
PresentationEx pres1 = new PresentationEx(new FileInputStream(inFile));
pres1.save(new FileOutputStream(outFile), SaveFormat.PDF);


Thanks again.

Hi Tom,


I like to share that Aspose.Slides for .NET/Java use Arial as default font if the used font in presentation is missing. If the Arial font is not being installed or accessed then exception will be thrown. Secondly, an issue with ID SLIDESJAVA-33257 has already been added in our issue tracking system as new feature request to provide support for setting default font for application. This feature is expected to provided by end of Q3 of 2012.

We will share the further updates with you as soon as they will be shared by our development team.

Many Thanks,

Hi Tom,


I like to share that we have introduced the support for setting the default rendering font in Aspose.Slides for Java 7.2.0. I will share the product release notification with you shortly. Please use the following sample code to serve the purpose.

LoadOptions lo = new LoadOptions(LoadFormat.Auto);
lo.setDefaultRegularFont(“DejaVu Serif”);
lo.setDefaultAsianFont(“DejaVu Serif”);

PresentationEx pres = new PresentationEx(“test.pptx”) ;
ImageIO.write(pres.getSlides().get_Item(0).getThumbnail(1, 1), “PNG”, new java.io.File(“testOut.png”));
pres.save(“testOut.pdf”,com.aspose.slides.SaveFormat.Pdf);
pres.save(“testOut.xps”,com.aspose.slides.SaveFormat.Xps);


Many Thanks,

The issues you have found earlier (filed as SLIDESJAVA-33257) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(3)