I’m able to open PDF files on Android just fine, but when I try to open docx or pptx files I cannot get them to display correctly. I have used the same files with the sample code, so I know they can be opened by the SDK. I am using PDFViewCtrl’s openUniversalDocument method. I am subscribed as a UniversalDocumentConversionListener and DocumentLoadListener. I see the conversion events all the way up to success and have verified that the DocumentConverter also returns success when I query its status.
I’ve also initialized the PDFNet instance with the pdfnet.res file and have the code copying the plugin files to a temporary directory and set the path with PDFNet.addResourceSearchPath.
The strange thing is that I never get the onDocumentLoaded call.
I’ve combed through the CompleteReader example for Android as it calls both the conversion events and the onDocumentLoaded event but I’ve not been able to determine what it might be doing that I am not. Right now I’m just trying to do a basic open and display of the docx or pptx files so I don’t want to just add in all the sample code without understanding it. Is there some other call that I am missing or should this be enough to do a simple viewing of a non-pdf document? I’ve attached what code I have so far. Its a React Native wrapper for the PDFNet component so it won’t run directly but it should be enough to show what I might be missing.
Hmm, it looks like its something in the way I’m trying to implement it for React Native. If I do something like toggle the view inspector, then the onDocumentLoaded fires and the document is displayed. I’m somehow setting things so that its not getting to run to completion.
I managed to solve the problem and get a full conversion, however on some pretty straight forward PPTX files the conversion doesn’t seem to honor the view size even though I specify the page view mode as PAGE_VIEW_FIT_PAGE. I’ve attached a screen shot showing the issue. Any ideas as to what is happening to cause this?
I’ve sent in the PPTX file to be looked at. To make the conversion work at all I had to use the tryConvert() method of the DocumentConversion class rather than the event callback interface. Here’s what I have right now, but it does have the PPTX conversion issue mentioned above.