Pdfjs PDFViewer not render all pages in dom - pdf.js

I am using the PDFViewer from pdfjs-dist in react app to render the pdf. Pdf is getting render and I can see all pages in DOM but some pages are loaded as we scroll down page is set with data-loaded="true".
How can we load all pages without loader and data-loaded="true"?

Related

How to load iframes faster?

I have a banner which is rendering through iframe. But it is taking time to load. I want to load the iframe parrallel to the css and javascript on the page.

PDf.js canvas scroll bar missing

I am using PDF.js to display PDF documents in my JSF page. My input is a blob which I pass to pdf.js . It works fine for documents with single pages but if a document has more than 1 page I see only the first page and I am unable to scroll. I tried encapsulating it with a <div> with overflow:scroll; property but I cannot navigate to the next page.
<div id="the-container" style="width:1000px;height:600px;overflow-y:scroll;">
<canvas id="the-canvas"></canvas>
</div>
A sample link for what I have used is below. Please help !
https://jsfiddle.net/qj9tau8e/
The sample document has 2 pages but only 1 is displayed

PDF inside iframe no back button when full screen

I'm developing an ionic app in iOS, I placed the pdf inside an iframe just by simply doing the following:
<iframe src="https://docs.google.com/gview?embedded=true&url=http://example.com/resources/myfile.pdf" mozallowfullscreen marginwidth="2" marginheight="2" width="90%" scrolling="auto"></iframe>
I didn't used cordovaInAppBrowser because I ran a lot of problem like after clicking the button the InAppBrowser doesn't open unless I don't minimize the app. So I just used iframe as the workaround. But the problem now is that, after the pdf being loaded, and the user clicks on the full screen of pdf, there's no back button. Is there a way I can remove the full screen button from the pdf or add a back button on full screen mode of pdf? I tried removing the mozallowfullscreen but doesn't work since it's for the iframe not for the pdf.
P.S.
I tried accessing the div inside the iframe that holds the button for full screen, but no good, it doesn't get the div, it's probably because I'm violating the Same Origin Policy.
Here's the code on how I tried to access the div:
$('#myframe').each(function(){
console.log($("div[role='toolbar']"));
});

UIWebview rendering iOS 7

Could you explain the behavior of UIWebView -loadHTMLString:baseURL:?
For example I've got a simple html, which i want to render:
<html>
<body>
Test message <br>
<img src="%http_path_for_unreachable_resource%" />
</body>
</html>
In previous versions of SDK (equal or less then 6.x) UIWebView renders this html and shows 'Test message' without waiting for complete loading of all resources in html.
In 7.0 beta SDK behavior has been changed. Now where is no way to show any content in UIWebView without full loading of all resources. So I see a blank white screen without 'Test message'. Some time later then request for unreachable resource fails with timeout, UIWebview show its content.
I have already tried to force show content by using javascript in -stringByEvaluatingJavascriptFromString, by calling -setNeedsDisplay for all subviews of UIWebView.
Is possible to get an old rendering behavior of UIWebView?

Blank page on back-button (jQuery Mobile)

I have the following problem: When I use either the jQuery Mobile back-button or the changePage function of jQuery Mobile to return to the previous page it doesn't show any data on the page. All javascript gets executed but page remains empty..
Any ideas?
This was a problem I faced when I was removing pages from the DOM via javascript to prevent the first page from sticking into the DOM. All it would show was a blank page when clicking the back button.
Are you removing previous pages from the DOM in your javascript?
And when you say the page "remains empty", is it just the data within the content tags, or is nothing appearing on the page at all (including jquery mobile enhancement markup)?
You should post your changePage function here so that I and others can help you out.

Resources