Multiple documents (CoreControls.DocumentViewer controls) displayed in one page

117 views
Skip to first unread message

Michael Dudek

unread,
Apr 30, 2014, 2:09:04 AM4/30/14
to pdfnet-w...@googlegroups.com
Hello,
we are working on SPA html5 project based on angularJS that needs to visualize multiple documents in one page(without IFrames). I have tested your DocumentViewer control for rendering page canvases and its great, but I have found  issues when there are used multiple DocumentViewer instances in one page.

There are two issues i have found when multiple instances are placed in page:

1. Images used in documents are mixed (picture from one document is displayed instead of different one in second document)
2. Sometimes LoadCanvasAsyc method dont create page canvas without any information or error (drawComplete callback is not called)

You you help me to solve this issues please? I shortly tried to find whats the problem, but orientation in uglyfied corecontrols.js code is not easy ;-)

I have created sample application(with my reduced component) to reproduce this issues. Its simple page with 3 XOD documents visualized in one page. Sample files are attached to this message and is also available on http://blog.wujigrid.com/pdfTest/pdftest.html.  
Just refresh page several times and you will see the results. Tested on IE11 && latest Chrome.

Thanks for info
Michael Dudek
pdfTest.zip

Matt Parizeau

unread,
May 1, 2014, 5:06:27 PM5/1/14
to pdfnet-w...@googlegroups.com
Hi Michael,

Thanks for the sample project! Unfortunately the issue here is that there is information stored on the window by the Document that is used when the pages are being rendered. When you have multiple Document instances inside the same window at the same time they will conflict with each other, producing the behavior you're seeing. If you want to view multiple documents at the same time then the solution would be to show them in separate iframes. This would be the same behavior as if you used WebViewer.js directly since for each instance it will create an iframe with the document viewer inside.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages