Page 1 of 1

How to convert PPTX to image in Android?

PostPosted: Wed May 02, 2012 8:35 pm
by msaifurr
Is it possible to convert PPTX to image in android using PPTX4J? Kindly help me in this regards. I have to develop an application which will convert powerpoint slides into images in Android.

Re: How to convert PPTX to image in Android?

PostPosted: Thu May 10, 2012 12:56 pm
by jason
I am currently working to get docx4j running on Android for a paying customer, so some results should be available in due course.

In the meantime, you might want to ensure your PPTX to image output is satisfactory in an ordinary Java environment.

Re: How to convert PPTX to image in Android?

PostPosted: Fri May 18, 2012 3:37 pm
by jason
https://github.com/plutext/docx4j/tree/android is docx4j working on Android, and tested insofar as it can convert docx to HTML using https://github.com/plutext/docx4j/blob/ ... nXSLT.java

It seems XSLT Xalan extension functions must be avoided on Android, and with that, https://github.com/plutext/docx4j/tree/ ... /svginhtml

Re: How to convert PPTX to image in Android?

PostPosted: Thu Dec 20, 2012 10:21 pm
by ermanishks
I am facing a peculiar type of problem .
i am able to convert pptx file to image as well as into html in java using Docx4j but it is NOT working in android it throwing an error

Could not find method org.pptx4j.convert.out.svginhtml.SvgExporter.setImageDirPath, referenced from method com.example.prototype.pptimageandroid.PPTIamge.pptHTML
i have required jar files in the referenced libraries.
it is throwing a runtime Error.
Please help me on this.

Re: How to convert PPTX to image in Android?

PostPosted: Fri Dec 21, 2012 7:48 am
by jason
I have answered your cross post at http://stackoverflow.com/questions/1397 ... conversion along the same lines as the answer earlier in this thread.

Please mark the question on StackOverflow as answered.

Re: How to convert PPTX to image in Android?

PostPosted: Fri Dec 28, 2012 12:27 am
by ermanishks
I used AndroidDocxToHtml to read Docx as HTML and it is Working absolutely fine on android but when i am trying to use your SVGExporter for PPTX reading as HTML on android it is throwing exception on PresentationMLPackage.load method may be becoz of it is internally using javax api NOT supported by android.
Exception is

12-27 18:48:03.187: E/AndroidRuntime(665): ... 11 more
12-27 18:48:03.187: E/AndroidRuntime(665): Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Error reading from the stream
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:239)
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:195)
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:178)
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.PresentationMLPackage.load(PresentationMLPackage.java:99)
12-27 18:48:03.187: E/AndroidRuntime(665): at com.example.ppt2image.PPTConverter.pptConvertor(PPTConverter.java:51)
12-27 18:48:03.187: E/AndroidRuntime(665): ... 14 more
12-27 18:48:03.187: E/AndroidRuntime(665): Caused by: java.io.IOException: Mark has been invalidated.
12-27 18:48:03.187: E/AndroidRuntime(665): at java.io.BufferedInputStream.reset(BufferedInputStream.java:350)
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:237)
12-27 18:48:03.187: E/AndroidRuntime(665): ... 18 more
12-27 18:48:03.787: I/dalvikvm(665): threadid=3: reacting to signal 3
12-27 18:48:03.797: I/dalvikvm(665): Wrote stack traces to '/data/anr/traces.txt'
12-27 18:48:05.237: I/Process(665): Sending signal. PID: 665 SIG: 9


Please Suggest me a Solution for using PresentationMLPackage Class or any other suitable class if any, to convert PPTX into html.

Thanks in Advance

Re: How to convert PPTX to image in Android?

PostPosted: Fri Dec 28, 2012 10:00 pm
by ermanishks
jason wrote:I have answered your cross post at http://stackoverflow.com/questions/1397 ... conversion along the same lines as the answer earlier in this thread.

Please mark the question on StackOverflow as answered.


PresentationMLPackage class is NOT working with Android hence i am not able to use it for PPTX reading as HTMl

Re: How to convert PPTX to image in Android?

PostPosted: Fri Dec 28, 2012 10:10 pm
by ermanishks
Please suggest me the method through which i can be able to run SvgExporter or even PresentationMLPackage run on android as both are not working on android but they are working fine on Java

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 07, 2013 4:25 pm
by jason
ermanishks wrote:12-27 18:48:03.187: E/AndroidRuntime(665): Caused by: java.io.IOException: Mark has been invalidated.
12-27 18:48:03.187: E/AndroidRuntime(665): at java.io.BufferedInputStream.reset(BufferedInputStream.java:350)
12-27 18:48:03.187: E/AndroidRuntime(665): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:237)


Your stack trace is coming from:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
public static OpcPackage load(final InputStream inputStream, String password) throws Docx4JException {
                //try to detect the type of file using a bufferedinputstream
                final BufferedInputStream bis = new BufferedInputStream(inputStream);
                bis.mark(0);
                final byte[] firstTwobytes=new byte[2];
                int read=0;
                try {
                        read = bis.read(firstTwobytes);
                        bis.reset();
                } catch (final IOException e) {
                        throw new Docx4JException("Error reading from the stream", e);
                }
                if (read!=2){
                        throw new Docx4JException("Error reading from the stream (no bytes available)");
                }
                if (firstTwobytes[0]=='P' && firstTwobytes[1]=='K') { // 50 4B
                        return OpcPackage.load(bis, Filetype.ZippedPackage, null);
                } else if  (firstTwobytes[0]==(byte)0xD0 && firstTwobytes[1]==(byte)0xCF) {
                        // password protected docx is a compound file, with signature D0 CF 11 E0 A1 B1 1A E1
                        log.info("Detected compound file");
                        return OpcPackage.load(bis, Filetype.Compound, password);
                } else {
                        //Assume..
                        log.info("Assuming Flat OPC XML");
                        return OpcPackage.load(bis, Filetype.FlatOPC, null);
                }
        }
 
Parsed in 0.019 seconds, using GeSHi 1.0.8.4


You should work out why you are getting the error java.io.IOException: Mark has been invalidated.

You may be able to work around this by using OpcPackage.load(bis, Filetype.ZippedPackage, null);

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 07, 2013 8:46 pm
by ermanishks
Thanks for the suggestion. I tried by using OpcPackage.load(bis, Filetype.ZippedPackage, null);
Now it is thowing Exception as
01-07 14:19:30.099: I/System.out(29690): 129433 [main] INFO org.docx4j.jaxb.Context - .. others loaded ..
01-07 14:19:30.099: W/System.err(29690): Context init: 130481ms
01-07 14:19:30.206: I/System.out(29690): 129542 [main] INFO org.docx4j.openpackaging.contenttype.ContentTypeManager - Detected PresentationMLPackage package
01-07 14:19:30.215: I/dalvikvm(29690): Could not find method org.pptx4j.model.SlideSizesWellKnown.valueOf, referenced from method org.docx4j.openpackaging.packages.PresentationMLPackage.createPackage
01-07 14:19:30.215: W/dalvikvm(29690): VFY: unable to resolve static method 59487: Lorg/pptx4j/model/SlideSizesWellKnown;.valueOf (Ljava/lang/String;)Lorg/pptx4j/model/SlideSizesWellKnown;
[code][/code]

it is NOT able to find valueOf(String) method of SlideSizesWellKnown Class that is used in createPackage method of PresentationMLPackage.

in the grepCode , Link ... http://grepcode.com/file/repo1.maven.or ... .String%29
it is showing that SlideSizesWellKnown.java class does not contain method as valueOf(String) but in the API doc given @
http://www.jarvana.com/jarvana/view/org ... ang.String)
valueOf(String)method is mentioned.
why this discrepancies although both have same version of doc4xJ i.e 2.7.1 .
I am using docx4J 2.8.1.

Please Help.

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 07, 2013 9:21 pm
by jason
ermanishks wrote:why this discrepancies although both have same version of doc4xJ i.e 2.7.1 .


You'll need to ask the people who run those sites.

The "official" docx4j stuff is found:
(1) https://github.com/plutext/docx4j
(2) on this website, including the old svn repository
(3) in Maven Central

ermanishks wrote:I am using docx4J 2.8.1.


The jar ae-docx4j-2.8.0-SNAPSHOT.jar at https://github.com/plutext/AndroidDocxT ... aster/libs is the one that I got working on Android.

The source code is at https://github.com/plutext/docx4j/tree/android

You can't expect ordinary docx4j to work on Android, until ordinary JAXB does.

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 07, 2013 10:10 pm
by ermanishks
Thanks again,
I am using the same Jar files downloaded from https://github.com/plutext/AndroidDocxT ... aster/libs.
I have also tried your code AndroidDocxToHtml and that is working absoultely fine on android, that's why i asked if i am using the very same lib that u had used then why it is NOT able to processed PresentationMLPackage . ?

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 07, 2013 10:27 pm
by jason
Here is the source code of that class: https://github.com/plutext/docx4j/blob/ ... Known.java

You are probably going to make progress here fastest if you download and work with the source code.

Having just looked at the contents of the jar, I find the pptx4j classes are not there, which explains what you are seeing.

This was probably in order to slip under the Dalvik limit of 65536 method references per dex file .. see http://www.docx4java.org/blog/2012/05/j ... n-android/

So you'll need to compile it yourself.

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 14, 2013 7:54 pm
by ermanishks
I took all the remaining class files (that was there in the contents of the jar eg- pptx4j class files ) and merge with the contents of the jar file now I am not able to re-Jar it. can u please tell me how to make an executable jar file for ae-docx4j-2.8.0-SNAPSHOT folder ?
Explanation :--

ae-docx4j-2.8.0-SNAPSHOT -- this was used for AndroidDocxToHtmlActivity by you. and it didn't have pptx4j class files. I took those required class files and merge with the ae-docx4j-2.8.0-SNAPSHOT. Now I have to make this executable jar file again. I hope u have understood my question.

Thanks.

Re: How to convert PPTX to image in Android?

PostPosted: Mon Jan 14, 2013 10:21 pm
by jason
Easiest to just do it properly: get the Android branch of docx4j from GitHub, then run either ant dist or mvn install (just as you would for docx4j proper)

Re: How to convert PPTX to image in Android?

PostPosted: Tue Jan 15, 2013 6:50 pm
by ermanishks
Can you please give me the link for the Android branch of docx4j from GitHub as i have downloaded the docx4j from Github am i am notsure if it is adroid supported or not.
also give the command to run that .

Thanks

Re: How to convert PPTX to image in Android?

PostPosted: Tue Jan 15, 2013 7:04 pm
by jason
At https://github.com/plutext/docx4j click the branch dropdown, and select branch "Android"

Beyond that, you are asking for more than I have bandwidth to provide by way of free support.

Generic questions relating to git, GitHub, maven and ant should be asked elsewhere.

As per my earlier post, once you have the android branch cloned locally, run either ant dist or mvn install. If you use ant, you'll need to adjust the paths to point to the various dependencies.

Re: How to convert PPTX to image in Android?

PostPosted: Tue Jan 15, 2013 7:07 pm
by ermanishks
Thanks a lot
I will keep note of that what u said.(regarding question like ant and github). :(

Re: How to convert PPTX to image in Android?

PostPosted: Thu Jan 17, 2013 9:00 pm
by ermanishks
I made a jar consisting all the class files for pptx.
When i put that jar file into the libs/ directory apk is fialed to get installed and throwing error as

[2013-01-17 15:29:09 - PPT2HTML] Installation error: INSTALL_FAILED_DEXOPT
[2013-01-17 15:29:09 - PPT2HTML] Please check logcat output for more details.
[2013-01-17 15:29:09 - PPT2HTML] Launch canceled!

When i want to access the file throw referenced lib it is throwin same error as earlier i.e NoClassDef Error.
can there be an issue with the jar file ?
Please help.

Re: How to convert PPTX to image in Android?

PostPosted: Thu Jan 17, 2013 9:10 pm
by jason
Those log messages are from your application PPT2HTML, not from docx4j

Can you post a complete stack trace?

Re: How to convert PPTX to image in Android?

PostPosted: Thu Jan 17, 2013 9:35 pm
by ermanishks
The Complete Log

01-17 16:05:27.213: D/AndroidRuntime(2301): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
01-17 16:05:27.213: D/AndroidRuntime(2301): CheckJNI is ON
01-17 16:05:27.343: D/AndroidRuntime(2301): --- registering native functions ---
01-17 16:05:28.043: D/dalvikvm(266): GC_EXPLICIT freed 165 objects / 11624 bytes in 134ms
01-17 16:05:28.683: D/PackageParser(58): Scanning package: /data/app/vmdl50479.tmp
01-17 16:05:28.823: D/dalvikvm(58): GC_FOR_MALLOC freed 1260 objects / 187496 bytes in 80ms
01-17 16:05:30.654: D/dalvikvm(58): GC_FOR_MALLOC freed 7740 objects / 576984 bytes in 101ms
01-17 16:05:31.233: I/PackageManager(58): Removing non-system package:com.example.ppt2HTML
01-17 16:05:31.233: I/ActivityManager(58): Force stopping package com.example.ppt2HTML uid=10040
01-17 16:05:31.373: D/PackageManager(58): Scanning package com.example.ppt2HTML
01-17 16:05:31.385: I/PackageManager(58): Package com.example.ppt2HTML codePath changed from /data/app/com.example.ppt2HTML-1.apk to /data/app/com.example.ppt2HTML-2.apk; Retaining data and using new
01-17 16:05:31.385: I/PackageManager(58): /data/app/com.example.ppt2HTML-2.apk changed; unpacking
01-17 16:05:31.463: D/installd(34): DexInv: --- BEGIN '/data/app/com.example.ppt2HTML-2.apk' ---
01-17 16:05:34.983: E/dalvikvm(2312): Invalid annotations_directory_item
01-17 16:05:34.983: E/dalvikvm(2312): Trouble with item 3627 @ offset 0x159dcc
01-17 16:05:34.993: E/dalvikvm(2312): Cross-item verify of section type 0006 failed
01-17 16:05:34.993: E/dalvikvm(2312): ERROR: Byte swap + verify failed
01-17 16:05:35.004: E/dalvikvm(2312): Optimization failed
01-17 16:05:35.031: W/installd(34): DexInv: --- END '/data/app/com.example.ppt2HTML-2.apk' --- status=0xff00, process failed
01-17 16:05:35.031: E/installd(34): dexopt failed on '/data/dalvik-cache/data@app@com.example.ppt2HTML-2.apk@classes.dex' res = 65280
01-17 16:05:35.093: W/PackageManager(58): Package couldn't be installed in /data/app/com.example.ppt2HTML-2.apk
01-17 16:05:35.104: D/PackageParser(58): Scanning package: /data/app/com.example.ppt2HTML-1.apk
01-17 16:05:35.123: D/dalvikvm(266): GC_EXPLICIT freed 119 objects / 9312 bytes in 380ms
01-17 16:05:35.134: D/PackageManager(58): Scanning package com.example.ppt2HTML
01-17 16:05:35.143: I/ActivityManager(58): Force stopping package com.example.ppt2HTML uid=10040
01-17 16:05:35.143: D/PackageManager(58): Activities: com.example.ppt2HTML.PPTConverter
01-17 16:05:35.154: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts
01-17 16:05:35.154: W/PackageManager(58): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
01-17 16:05:35.154: W/PackageManager(58): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x1be45)
01-17 16:05:35.173: W/PackageManager(58): Unknown permission com.google.android.gm.permission.WRITE_GMAIL in package com.android.settings
01-17 16:05:35.173: W/PackageManager(58): Unknown permission com.google.android.gm.permission.READ_GMAIL in package com.android.settings
01-17 16:05:35.173: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings
01-17 16:05:35.173: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts
01-17 16:05:35.173: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts
01-17 16:05:35.193: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development
01-17 16:05:35.193: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development
01-17 16:05:35.193: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development
01-17 16:05:35.193: W/PackageManager(58): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development
01-17 16:05:35.324: I/PackageManager(58): Successfully restored package : com.example.ppt2HTML after failed upgrade
01-17 16:05:35.473: D/dalvikvm(58): GC_EXPLICIT freed 12248 objects / 601720 bytes in 131ms
01-17 16:05:35.573: D/AndroidRuntime(2301): Shutting down VM
01-17 16:05:35.573: D/dalvikvm(2301): Debugger has detached; object registry had 1 entries
01-17 16:05:35.593: I/AndroidRuntime(2301): NOTE: attach of thread 'Binder Thread #3' failed


this is generating when I put newly created jar file in the libs/ directory if i remove that jar file App install succesfully.

Re: How to convert PPTX to image in Android?

PostPosted: Thu Jan 17, 2013 10:10 pm
by jason
Google 'E/installd(34): dexopt failed res'

You may be running into the 65K method limit? In which case you'll have to try removing some classes you don't need. In the docx4j jar, you could remove org.xlsx4j for a start.

If Google doesn't answer it for you, I suggest you post your question in some forum where there are more android experts. But please report back when you have something to share.

Re: How to convert PPTX to image in Android?

PostPosted: Thu Jan 17, 2013 10:58 pm
by ermanishks
Thanks for the suggestions.
as per you suggestion i removed xlsx classes and make jar and laod in the lib/ dir.
application started. but it is throwing Exception as

01-17 17:29:16.631: E/AndroidRuntime(360): FATAL EXCEPTION: main
01-17 17:29:16.631: E/AndroidRuntime(360): java.lang.IllegalStateException: Could not execute method of the activity
01-17 17:29:16.631: E/AndroidRuntime(360): at android.view.View$1.onClick(View.java:2072)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.view.View.performClick(View.java:2408)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.view.View$PerformClick.run(View.java:8816)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.os.Handler.handleCallback(Handler.java:587)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.os.Handler.dispatchMessage(Handler.java:92)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.os.Looper.loop(Looper.java:123)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-17 17:29:16.631: E/AndroidRuntime(360): at java.lang.reflect.Method.invokeNative(Native Method)
01-17 17:29:16.631: E/AndroidRuntime(360): at java.lang.reflect.Method.invoke(Method.java:521)
01-17 17:29:16.631: E/AndroidRuntime(360): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-17 17:29:16.631: E/AndroidRuntime(360): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-17 17:29:16.631: E/AndroidRuntime(360): at dalvik.system.NativeStart.main(Native Method)
01-17 17:29:16.631: E/AndroidRuntime(360): Caused by: java.lang.reflect.InvocationTargetException
01-17 17:29:16.631: E/AndroidRuntime(360): at com.example.ppt2image.PPTConverter.changeToHtml(PPTConverter.java:72)
01-17 17:29:16.631: E/AndroidRuntime(360): at java.lang.reflect.Method.invokeNative(Native Method)
01-17 17:29:16.631: E/AndroidRuntime(360): at java.lang.reflect.Method.invoke(Method.java:521)
01-17 17:29:16.631: E/AndroidRuntime(360): at android.view.View$1.onClick(View.java:2067)
01-17 17:29:16.631: E/AndroidRuntime(360): ... 11 more
01-17 17:29:16.631: E/AndroidRuntime(360): Caused by: java.lang.ExceptionInInitializerError
01-17 17:29:16.631: E/AndroidRuntime(360): at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:651)
01-17 17:29:16.631: E/AndroidRuntime(360): at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206)
01-17 17:29:16.631: E/AndroidRuntime(360): at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
01-17 17:29:16.631: E/AndroidRuntime(360): at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
01-17 17:29:16.631: E/AndroidRuntime(360): ... 15 more
01-17 17:29:16.631: E/AndroidRuntime(360): Caused by: java.lang.ExceptionInInitializerError
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassValue(RuntimeInlineAnnotationReader.java:182)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassValue(RuntimeInlineAnnotationReader.java:59)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.isApplicable(PropertyInfoImpl.java:212)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.getApplicableAdapter(PropertyInfoImpl.java:227)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.<init>(PropertyInfoImpl.java:126)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.SingleTypePropertyInfoImpl.<init>(SingleTypePropertyInfoImpl.java:75)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.AttributePropertyInfoImpl.<init>(AttributePropertyInfoImpl.java:63)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeAttributePropertyInfoImpl.<init>(RuntimeAttributePropertyInfoImpl.java:59)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.createAttributeProperty(RuntimeClassInfoImpl.java:166)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ClassInfoImpl.addProperty(ClassInfoImpl.java:877)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java:409)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:312)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:187)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:248)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:105)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:86)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:214)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:86)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:320)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:96)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:73)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:62)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:55)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:79)
01-17 17:29:16.631: E/AndroidRuntime(360): at ae.com.sun.xml.bind.v2.model.impl.ElementPropert
01-17 17:29:16.741: D/dalvikvm(360): GC_FOR_MALLOC freed 2670 objects / 398856 bytes in 73ms

Code :

String inputfilepath = "/mnt/sdcard/NewX.pptx";
try {
InputStream is = new FileInputStream(inputfilepath);
PresentationMLPackage presentationMLPackage = (PresentationMLPackage)OpcPackage.load(is,Filetype.ZippedPackage,null); // Exception @ this Line
}

Re: How to convert PPTX to image in Android?

PostPosted: Fri Jan 18, 2013 7:05 am
by jason
Add an entry to https://github.com/plutext/docx4j/blob/ ... ntext.java for pml.

You can mimic how it is done for wml; see the line org.docx4j.wml.P.class.getPackage()