Giter VIP home page Giter VIP logo

xojopdfjs's Introduction

XojoPdfJs

Running pdfjs inside a Xojo HTMLViewer

Example of integration of pdf.js into Xojo Desktop

Viewing PDFs is a common requirement for desktop applications, but reliance on plug-ins is always tricky in cross-platform environments.

This project integrates the fantastic pdf.js from Mozilla Project to enable rendering and navigation of PDF files within a desktop application with an HTMLViewer.

Behind the scenes, the HTMLViewer is loading each PDF through pdf.js (it's using the default PDFViewer including with the package, but a custom one can easily be prepared as necessary) and a couple of buttons included demonstrate loading different files and calling either a given page or an anchor inside the PDF document.

File "File 1" has an anchor called "appendix-a" Files "File 1" and "File 2" have more than one page, so a specific page can be called and navigated to. File "File 3" is a single page PDF and should ignore the requests for anchors or pages. Below the PDF viewer a quick link should open the corresponding viewer in a web browser (local restrictions may prevent the local web browser from loading)

xojopdfjs's People

Contributors

eduo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nkne

xojopdfjs's Issues

Does this run on windows?

I am running the sample code on Windows. I verified proper path is being sent to the "PDFViewerApplication.open..." call. Is there encoding or formatting that I need to do to the path to make it work on a window deployment? The file is a local file. Does that matter?

Thank you in advance for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.