Missing fonts problem in aspose slides 6.9.0

I’ve seen this error on the forum before and everyone says it’s because aspose can’t find the default fonts and the solution is to do something like


FontsLoader.loadExternalFonts(new String[] { "/path/to/resources/fonts" });


but how do I get the fonts that aspose is looking for if they are not already loaded on my system?

Hi Jamie,


I have observed your requirement and like to share that in case of used fonts are missing Aspose.Slides use Arial as default font. Unfortinately, there is no mechanism to identify so far in Aspose.Slides to scan that which of fonts are used and that are also not installed as well. Its assumed that since the customer is aware of the fonts used in the presentation so he knows which fonts will be required for rendering. I have logged an issue with ID SLIDESJAVA-33681 in our issue tracking system as new feature request. Our development team will investigate the possibility of implementing the desired feature.

We will share the further feedback with you as soon as the issue will be resolved.

Many Thanks,

Thanks. I’ve been trying to use aspose to take a power point and generate a set of images from it in Java and do this point I have been unsuccessful. What I am currently trying to do is shown below. Should this work? (Note this is with Slides 2.9.6)



File f = new File(“2.ppt”);

FileInputStream fis = new FileInputStream(f);



Presentation p = new Presentation(fis);



Point d = p.getSlideSize();

Slides collection = p.getSlides();

for(int i = 0; i
Slide s = collection.get(i);

try {

BufferedImage img = s.getThumbnail(d.x, d.y);

ImageIO.write(img, “png”, new File("/tmp/file" + i+ “.png”));

} catch(Exception e){

System.out.println(i);

e.printStackTrace();

}



}





the stack I am receiving is



java.lang.NegativeArraySizeException

at java.awt.image.DataBufferInt.(DataBufferInt.java:41)

at java.awt.image.Raster.createPackedRaster(Raster.java:458)

at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)

at java.awt.image.BufferedImage.(BufferedImage.java:315)

at com.aspose.slides.Slide.getThumbnail(Unknown Source)

at com.aspose.slides.Slide.getThumbnail(Unknown Source)

at test.PPTTest.aposeTest(WordTest.java:95)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

also tried with 6.9.0 but I am getting
java.lang.AssertionError: Cannot read a name from the name table in a font after adding

FontsLoader.loadExternalFonts(new String[] { “/System/Library/Fonts” });

This is on a Mac, not sure if there is anything special that needs to happen to make this work in that regard.

Hi,


I have observed the stack trace shared by you. Can you please sahre teh sample presentation with us so that I may try the issue on my end. I also like to add that the issue may be due to some corrupted font loaded. Please also share the fonts used in your presentation. I will try to reproduce the issue on my end to help you further.

Many Thanks,

Here is the code snippet



File f = new File(“test/data/2.ppt”);

FileInputStream fis = new FileInputStream(f);



Presentation p = new Presentation(fis);

Dimension d = p.getSlideSize();



SlideCollection collection = p.getSlides();

for(int i = 0; i
Slide s = collection.get_Item(i);

try {

BufferedImage img = s.getThumbnail(d);

ImageIO.write(img, “png”, new File("/tmp/file" + i+ “.png”));

} catch(Exception e){

System.out.println(i);

e.printStackTrace();

}



}

and the ppt is attached.

Hi Jamie,


I have worked with the presentation in Windows environment and have not been able to reproduce the issue. I have however not been able to verify the issue in MAC Os X environment and an issue with ID SLIDESJAVA-33692 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

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


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

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


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