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,
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,
Hi Tom,
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);
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)