Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading the webviewer with empty src #16

Merged
merged 1 commit into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,22 @@ Include `viewer.html` using [SSI](http://httpd.apache.org/docs/2.4/howto/ssi.htm
</div>

<script>
PDFJS.webViewerLoad('some-document.pdf');
// note that the file can also be a Uint8Array if you want to serve binary data
var file = 'some-document.pdf';

// This initializes the webviewer, the file may be passed in to it to initialize the viewer with a pdf directly
window.PDFJS.webViewerLoad();

// open a file in the viewer
window.PDFViewerApplication.open(file);
</script>
</body>
</html>
```

## Upgrading the source

Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it
Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it
within a page.

To update this version, get the patched pdf.js source code and build the project
Expand Down
3 changes: 1 addition & 2 deletions pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -19443,8 +19443,7 @@ if (document.readyState === 'interactive' || document.readyState === 'complete')
webViewerLoad();
} else {
PDFJS.webViewerLoad = function (src) {
if (src)
DEFAULT_URL = src;
DEFAULT_URL = src;
webViewerLoad();
};
}
Expand Down