iOS local encrypted > "Error loading document: Invalid XOD file: Zip end header data is wrong size"

288 views
Skip to first unread message

Michael Lee

unread,
Jun 20, 2016, 1:07:49 PM6/20/16
to PDFTron WebViewer
Hi,

On iOS, we get the error above when viewing local encrypted documents.

We successfully use Cordova file to view local unencrypted documents in iOS.

In Android, using our same Cordova file codebase, we successfully view local encrypted documents in Android.

Q. Has anyone successfully implemented this before ?

Mike

Matt Parizeau

unread,
Jun 22, 2016, 6:38:31 PM6/22/16
to PDFTron WebViewer
Hi Mike,

Can you try this build which contains a fix for viewing documents with Cordova http://www.pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_2.2.0.46241.zip. Also make sure that if you're setting the "encryption" option in the PDFTron.WebViewer constructor that you also set the option mobileRedirect: false otherwise the encryption parameters won't be able to be applied to the viewer after it redirects.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Michael Lee

unread,
Jun 27, 2016, 12:32:27 PM6/27/16
to PDFTron WebViewer
Thanks Matt,

Thanks for the response, will try shortly.

We are using HttpPartRetriever().

For the interim and FYI: Encrypted JPG documents initialise (from iOS Cordova File) with StreamingPartRetriever(), but no other formats do.

Mike

Michael Lee

unread,
Jun 27, 2016, 12:32:27 PM6/27/16
to PDFTron WebViewer
Hi Matt,

Still not successful with that build sorry. Will let you know if we have further progress.

I subscribed to the PDFTron Cordova Beta, however Ryan Barr advises nothing for me to see at this present time;

It would be great to see an example of PDFTron initializing encrypted XOD from Cordova File on iOS.

Regards

Mike

Matt Parizeau

unread,
Jun 27, 2016, 8:47:41 PM6/27/16
to PDFTron WebViewer
Hi Mike,

Before preparing that build we tested it by going through the steps in the Cordova sample included with WebViewer. For the encryption specific changes we only changed index.html so that the WebViewer options included the following:

mobileRedirect: false,
encryption
: {
  type
: 'aes',
  p
: 'pass'
}

If you follow these steps are you able to get it to work?

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Michael Lee

unread,
Jun 27, 2016, 8:58:35 PM6/27/16
to PDFTron WebViewer on behalf of Matt Parizeau
Hi Matt,

We have that configuration currently. I'll take a look at your cordova example, thanks.

Mike

--
You received this message because you are subscribed to a topic in the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pdfnet-webviewer/uiWnCUPhwkY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pdfnet-webview...@googlegroups.com.
To post to this group, send email to pdfnet-w...@googlegroups.com.
Visit this group at https://groups.google.com/group/pdfnet-webviewer.
For more options, visit https://groups.google.com/d/optout.

Michael Lee

unread,
Jul 18, 2016, 12:51:59 PM7/18/16
to PDFTron WebViewer
Hi Matt,

Can you please provide a private email so we can send you our Cordova implementation; It works on Android, but not iOS.

Regards

Mike

On Tuesday, June 28, 2016 at 12:58:35 PM UTC+12, Michael Lee wrote:
Hi Matt,

We have that configuration currently. I'll take a look at your cordova example, thanks.

Mike
To unsubscribe from this group and all its topics, send an email to pdfnet-webviewer+unsubscribe@googlegroups.com.
To post to this group, send email to pdfnet-webviewer@googlegroups.com.

Matt Parizeau

unread,
Jul 18, 2016, 6:17:08 PM7/18/16
to PDFTron WebViewer
Hi Mike,

You can send to mpar...@pdftron.com, and cc sup...@pdftron.com.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Michael Lee

unread,
Jul 21, 2016, 12:52:12 PM7/21/16
to PDFTron WebViewer
Thanks for the solution Matt, below.

>>

So to have this working on iOS you should use this build http://www.pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_2.2.0.47449.zip and in your config file switch to use the StreamingPartRetriever and change the line that sets "decrypt" to: decrypt = window.CoreControls.Encryption.decryptSynchronous;

Mike
To unsubscribe from this group and all its topics, send an email to pdfnet-webview...@googlegroups.com.
To post to this group, send email to pdfnet-w...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages