File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,22 @@ Include `viewer.html` using [SSI](http://httpd.apache.org/docs/2.4/howto/ssi.htm
35
35
</div >
36
36
37
37
<script >
38
- PDFJS .webViewerLoad (' some-document.pdf' );
38
+ // note that the file can also be a Uint8Array if you want to serve binary data
39
+ var file = ' some-document.pdf' ;
40
+
41
+ // This initializes the webviewer, the file may be passed in to it to initialize the viewer with a pdf directly
42
+ window .PDFJS .webViewerLoad ();
43
+
44
+ // open a file in the viewer
45
+ window .PDFViewerApplication .open (file);
39
46
</script >
40
47
</body >
41
48
</html >
42
49
```
43
50
44
51
## Upgrading the source
45
52
46
- Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it
53
+ Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it
47
54
within a page.
48
55
49
56
To update this version, get the patched pdf.js source code and build the project
Original file line number Diff line number Diff line change @@ -19443,8 +19443,7 @@ if (document.readyState === 'interactive' || document.readyState === 'complete')
19443
19443
webViewerLoad();
19444
19444
} else {
19445
19445
PDFJS.webViewerLoad = function (src) {
19446
- if (src)
19447
- DEFAULT_URL = src;
19446
+ DEFAULT_URL = src;
19448
19447
webViewerLoad();
19449
19448
};
19450
19449
}
You can’t perform that action at this time.
0 commit comments