We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem about converting ppt/pptx file to pdf

I have an android project to convert ppt or pptx file to pdf file. I develop my project in eclipse environment. While I am developing the project, I find some problems. Could you help me for these problems?

Problem1: When I try to convert ppt file to pdf, aspose api function produces an empty pdf file. (saveToPdf function)
I use following function to test this feature. Path and files in function can be accessible. There is no security issue.

public void powerPointActionInEclipse()
{
String path = Environment.getExternalStorageDirectory().getAbsolutePath() ;

String sourceFileName = path+"/p1.ppt";
String dstFileName = path+“p1_new.ppt”;
String dstFileNamePDF = path+“p1pdf.pdf”;
try
{
Presentation p = new Presentation(sourceFileName);
p.save(dstFileName, SaveFormat.Ppt);
p.saveToPdf(dstFileNamePDF);
}
catch( Exception e){
Log.d(“SlideTest”, e.getMessage() );
}
}

Problem2: When I try to convert pptx file to pdf, aspose api function produces a “out of memory” error. Following two lines give same error.

PresentationEx p = new PresentationEx(sourceFileName);
or
PresentationEx p = new PresentationEx(); // or empty presentation

Error Log:

07-30 13:48:25.854: W/dalvikvm(18544): Exception Ljava/lang/OutOfMemoryError; thrown while initializing Lcom/aspose/slides/bdl;
07-30 13:48:26.555: I/dalvikvm-heap(18544): Clamp target GC heap from 49.934MB to 48.000MB
07-30 13:49:47.073: W/dalvikvm(18544): threadid=1: thread exiting with uncaught exception (group=0x40d8b300)
07-30 13:49:47.173: E/AndroidRuntime(18544): FATAL EXCEPTION: main
07-30 13:49:47.173: E/AndroidRuntime(18544): java.lang.ExceptionInInitializerError
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.PresentationEx.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.PresentationEx.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.example.deneme345test.MainActivity.powerPointAction(MainActivity.java:333)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.example.deneme345test.MainActivity.onCreate(MainActivity.java:134)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.Activity.performCreate(Activity.java:5008)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.ActivityThread.access$600(ActivityThread.java:130)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.os.Handler.dispatchMessage(Handler.java:99)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.os.Looper.loop(Looper.java:137)
07-30 13:49:47.173: E/AndroidRuntime(18544): at android.app.ActivityThread.main(ActivityThread.java:4745)
07-30 13:49:47.173: E/AndroidRuntime(18544): at java.lang.reflect.Method.invokeNative(Native Method)
07-30 13:49:47.173: E/AndroidRuntime(18544): at java.lang.reflect.Method.invoke(Method.java:511)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-30 13:49:47.173: E/AndroidRuntime(18544): at dalvik.system.NativeStart.main(Native Method)
07-30 13:49:47.173: E/AndroidRuntime(18544): Caused by: java.lang.OutOfMemoryError
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.fj.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.nj.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.ma.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.ma.(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.ra.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.px.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.rc.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.tf.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.tc.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.if(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.sy.else(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.pf4dd765c.pbdb106a0.p9f36407e.pu.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.bdl.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.bdl.do(Unknown Source)
07-30 13:49:47.173: E/AndroidRuntime(18544): at com.aspose.slides.bdl.(Unknown Source)

Hi Ozan,

Thanks for inquiring Aspose.Slides.

I have observed the issue shared by you and regret to share that at present the rendering support is unavailable in Aspose.Slides for Android and for this reason you are unable export the presentation to PDF using Aspose.Slides for Android. An issue with ID SLIDESANDROID-18 has already been added in our issue tracking system to provide the rendering support in Aspose.Slides for Android. We will share the good news with you as soon as rendering support will be made available in API.

For the time being, I suggest you to please try using our cloud API that may serve the purpose on your end. We have SDK for available for android as well in this regard.

Many Thanks,

Hi Mudassir,

Thanks for reply.

Do you have any time schedule to release api that supports pdf rendering?
I will buy a “slides product” licence if it is available.
Cloud api is not suitable for me.

In my first post, I have another problem.
Problem2: When I try to convert pptx file to pdf, aspose api function
produces a “out of memory” error. Following two lines give same error.

Dou you have any comment about this problem?
Thanks for help.



Hi Ozan,

I like to share that at present the rendering support is unavailable in Aspose.Slides for Android and there is limited functionality support in this version. I am unable to share any time frame for availability of rendering support in Aspose.Slides for Android as it is one complex implementation that will take much time. Therefore, I suggested you to try exploring Aspose.Slides for Cloud that will support the requirements from you.

As far as the problem 2 is concerned, I suggest you to please increase the heap size on your end.

Many Thanks,

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