Desktop Application - Odd behavior in preview window at bottom in taskbar

0
0

We are using the pdf.js component in our application. The strange thing is that when you hover over the icon to get the preview window – it retrieves the document again – you can see the progress bar going in the preview window. I think this is not good as some of the documents are large and its making another trip to the server to get it. Why does it need to refresh the window again – I was under the assumption that the preview window was just a “screen capture” static image of the window.

  • You must to post comments
0
0

Pdf files may be web optimized and loaded in ranges. Meaning that the viewer only loads the first page and then loads the pages as requested by the viewer.

The native pdf viewer (Adobe) supports and it appears to be supported by pdfjs too. It requires some extra work in the handler in case your app serves the content. Otherwise IIS handles range requests for you if you serve the web optimized pdf file as a full URL.

Another solution may be to hide the pdf viewer when minimized and replace with an image of your choosing – I haven’t tried it.

See:

 

Easy Handling of Http Range Requests in ASP.NET

https://github.com/mozilla/pdf.js/issues/8422

 

  • You must to post comments
0
0

It’s normal behavior. The preview windows is a deep clone of dom elements, scaled down using css. The dom elements are rendered by the browser and the cache, etc.

Screen grabbing doesn’t exist in any browser. You either clone the elements or rebuild each one on a html5 canvas element usign drawing calls.

 

  • edmond girardi
    I though there was a sample that showed how to capture a screenshot of a window in the WiseJ App and send to the server. Cant that be used to show the window upon the hover action instead of rebuilding the entire form ?
  • Luca (ITG)
    The sample uses the Html2Canvas extension which doesn’t capture a screenshot (there is no capturing feature supported by any browser). It literally redraws (emulates) every single element into an html5 canvas. The preview that we use in Wisej doesn’t rebuild nor redraws the elements, it clones the dom. Using the html to canvas technique wouldn’t work in your case since instead of the pdf it would show just a blank space because it cannot draw the pdf content (native or not) and cannot access iframes.
  • edmond girardi
    I see. So is there any way to prevent the pdf viewer from retrieving the document again – some are very large -100+ Meg as I don’t see the point in it unnecessarily using server resources. Besides – it takes a good 15-20 seconds to retrieve the PDf – which is of no use with the preview if you have to wait that long.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.