Giter VIP home page Giter VIP logo

viewerjs's Introduction

WebODF

WebODF is a ODF JavaScript library originally created by KO GmbH.

It makes it easy to add Open Document Format (ODF) support to your website and to your mobile or desktop application. It uses HTML and CSS to display ODF documents.

License

WebODF is a Free Software project. All code is available under the AGPL.

If you are interested in using WebODF in your commercial product (and do not want to disclose your sources / obey AGPL), get in touch at the license page for a license suited to your needs.

Creating webodf.js...

webodf.js is compiled by using the Closure Compiler. This compiler concatenates and compacts all JavaScript files, so that they are smaller and execute faster. CMake is used to setup the buildsystem, so webodf.js can be created:

git clone https://github.com/kogmbh/WebODF.git webodf
mkdir build
cd build
cmake ../webodf
make webodf.js-target

A successful run will yield the file "webodf.js" in the subfolder "build/webodf/" (among other things), from where you can then copy it and use for your website.

For more details about preparing the build of webodf.js , e.g. on Windows or OSX, please study "README-Building.md".

... and more

This repository not only contains code for the library webodf.js, but also a few products based on it. Here is the complete list:

build target output location (in build/) description download/packages
webodf.js-target webodf/webodf.js the library (see product-library)
product-library webodf.js-x.y.z.zip zip file with library and API docs WebODF homepage
product-wodotexteditor wodotexteditor-x.y.z.zip simple to use editor component WebODF homepage
product-wodocollabtexteditor wodocollabtexteditor-x.y.z.zip collaborative editor component WebODF homepage
product-firefoxextension firefox-extension-odfviewer-x.y.z.xpi ODF viewer Firefox add-on Mozilla's Add-on website

("x.y.z" is a placeholder for the actual version number)

For more details about the different products, please study "README-Products.md".

viewerjs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

viewerjs's Issues

Memory leak

It seems as though Viewer.js creates a memory leak (in Eclipse). When I add it to a web project, Eclipse first sees an error in the javascript, at the same time my Windows task manager shows Eclipse expaniding its working memory use. The errors are found in pdf.js and pdf.worker.js

Description Resource Path Location Type
Internal validation error
java.lang.ArrayIndexOutOfBoundsException: 1
at org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo.markAsDefinitelyNonNull(UnconditionalFlowInfo.java:1193)
at org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference.analyseAssignment(FieldReference.java:80)
at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.analyseCode(Assignment.java:63)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:91)
at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:110)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:74)
at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.analyseCode(Expression.java:184)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:65)
at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:73)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:91)
at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:110)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:74)
at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.analyseCode(Expression.java:184)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:65)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:609)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:355)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:288)
at org.eclipse.wst.jsdt.internal.core.builder.IncrementalImageBuilder.compile(IncrementalImageBuilder.java:306)
at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:227)
at org.eclipse.wst.jsdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:134)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:302)
at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:214)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
pdf.js /TextComparison/WebContent/js/Viewer.js line 0 JavaScript Problem

Pressing "space" key when focus is still on page up/down buttons with broken result

  1. Multislide document, last slide shown
  2. Click the Page-Up button
  3. Press "space" key

Expected:
Last slide is shown

Actual:
Last slide is shown for a short moment, then view returns to second-last slide

Similar effect with Page-down button, just that there the actual result is advance by two slides instead of just one.

Reason is that clicking a button currently leaves the focus on the button (see #38). Just, pressing the "space" key, will now both result in advancing to the next page, but also activate the button.

HTTP Error 404.0 - Not Found error when using it with asp.net webform

Hi guys,
I have tested the application using viewer.js with Visual studio internal web server (IIS Express) and it is working fine.If for instance I try to browse http://localhost:9069/Viewer.JS/index.html/# it works fine
But when i published the application on IIS i am getting 404 error at the address
http://publishedsite/Viewer.JS/index.html/#

it works fine if it is like http://publishedsite/Viewer.JS/index.html but it is of no use as i have to concatenate the url of my pdf file like
http://publishedsite/Viewer.JS/index.html/#http://publishedsite/mytest.pdf

Any particular settings required on IIS?

No About data (name of tool and version)

If seeing a bug in a viewer.js instance it is hard to tell which version it is, and which version of the viewer plugin (pdf.js, webodf.js) is used.

Also there is no indication what tool this is, so people do not know where to get this viewer plugin for their own website.

Please add info somewhere about:

  • name of tool ("Viewer.js")
  • version
  • name of current viewing plugin (WebODF.js, pdfjs)
  • version of current viewing plugin
  • incl. links, copyright, authors

base64 encoded PDF data

Hi,

Is it possible to use base64 encoded PDF data instead of the exact path to the file to display the PDF?

Page doesn't respect @media print

@media print{
*:not(.page){display:none !important;}

}
Should hide everything except the .page content. I still get all the buttons at the top of the page on print. I'd like to reduce client dependency on external viewers, but I'd like to control the printed state of some of my documents.

Scrollbars

When zooming in, the document container (inside #canvasContainer) get scrollbars, but becose of the bottom toolbar, only the scrollbar on the right is usable.

Possible solution could be:

  1. Resize the toolbars in order to let both scrollbars be clickable
  2. Remove the scrollbars and use custom commands to pan the content
  3. Alter the css, giving #canvasContainer.height = clientHeight - (topToolbar.height + bottomToolbar.height) and #canvasContainer.top = topToolbar.height

The last solution would be the more efficient, imho, but the effect will be less 'cool'.

Ability to offer links to the currently selected text

There should be an optional UI element which offers an url which, if a browser opens that url in a new view/window, will result in the currently selected text in the document to be selected and the visible area adapted so the start of the selection and as much as possible of the rest is visible.

Viewer.js for that needs to also offer a method in the API which allows to set/create the link, as the exact link depends on the embedding webpage/website. Another method might be needed to set the selection.

Crash on Chrome 32+

I tried with different PDFs. With FF and Chrome 31- it works. With Chrome 32+, after loading all contents, it crashs and shows the blue screen of error.
senza titolo-1

QUESTION: Copying manually selected content from a PDF file to a custom web application

Description of the Problem I would like to Solve:

Currently, I display a PDF file in my web browser on one monitor and a custom web application on a second monitor so that I can manually select text in the PDF file, copy the text (e.g. Ctrl C), click on a data field within the custom web application, and paste the text (e.g. Ctrl V) into the correct data field within the custom web application. I was just wondering if it is possible to streamline this process with a semi-automated solution as proposed below.

Proposed Possible Solution:

If Viewer.js and a custom web application are both residing on the same server, then is it possible to copy manually selected content from a PDF file displayed in Viewer.js to the custom web application using a custom developed user interface and workflow similar to what is described below:

  1. Manually select content in PDF file which is being displayed in Viewer.js;
  2. Right click on selected content;
  3. A custom developed web based menu appears and displays the names of the data fields available within the custom web application where this content could be saved to; AND
  4. Selecting the desired data field will automatically copy the manually selected content from the PDF file being displayed in Viewer.js to the corresponding data field in the custom web application.

If implementing the solution proposed above is possible, then I would greatly appreciate it if you can please explain how? Alternatively, if not, then I would greatly appreciate it if you can please explain why not.

Thank you.

Viewer.js should not decide itself if on mobile platform

E.g. for me both examples on http://viewerjs.org/ get hard to use with larger zoom because viewerjs decides by the size if it is on a mobile plattform, which here means scrollbars only hidden behind the toolbars.
And the horizontal toolbar is completely unusable.

Idea was to rather have the website owner pass a flag to viewerjs for mobile mode or not, because the website should know best who it is delivering to.

(Moved over from http://www.webodf.org/redmine/issues/87)

set default zoom for pdf

Is there a way to set the default zoom for the pdf? I've tried adding pdf open params to the url, but that has no effect. I need to set the default zoom to be page-width.

Page borders of PDFs are dissolved to full-window

When using WebODF 0.5.0 (8c617949079c258fa7e6bd9798683d74320cf221) the background of the window
with PDFs is all white, the page border is no longer seen (in all modes normal, fullscreen, presentation):
broken pdf page borders

ODT/ODP look alright, page border and dark background.

Changing default buttons

I would like to disable the presentation button, as it is currently not functional in IE 10. Is there a querystring option, without editing the source, to have this button not display, e.g. viewer.js/index.html?nopresentationbutton=1&.... ?

Also, when users click on the download button, the product does not download but instead opens the pdf in the same window with adobe reader, as most users have adobe reader installed. As such, is there a way to specify the target of the download button to be _blank rather than _self, so the adobe reader will open in a new window? Thanks much.

Do a new release?

Hi Guys,

The last release available was in september.
http://viewerjs.org/getit/

Pdf.js has a lot of changes since then, which work with the latest commit you have in github, but not the last released zip. Could you do a new release and update the site.

Also, maybe you could document building the libs? I tried running cmake, but had to give up midway.

Viewer.js source code?

Is normal that this repo does not contain the Viewer.js source file?

It can be downloaded from http://viewerjs.org/instructions/ but im wondering why is missing here (along with ODF plugin)

Also, i cant find anywhere on the web the Viewer.js uncompressed source..

ViewerJS and Cordova

Hi all,

im developing a phone app using Cordova and i need to show a embedded pdf . I've tried with Viewer JS but it doesnt work.

Any idea? , isnt it compatible?

Thanks, Sergio.

pd:(sorry for my English).

Not Supported Document Types

Hi,

First of all, congrats for your great job, viewer.js is a very usefull tool.

Just one question: is it possible, when you try to open an unsupported document type (xlsx, docx, etc) that viewer.js shows a message like "The document you are trying to visualize is not supported, you can download it here"?

Actually, when I try to view an unsupported filetype, the viewer just stay blank, and the download link on the upper right corner doesn't works...

Thanks !!!

Rackspace URLs don't work

Using a Rackspace URL, ViewerJS will not load the resource. Rackspace resource URLs are structured as https://[key].ssl.cf2.rackcdn.com/[filename]_[ext]-[id].

Could the lack of the .[ext] in the URL be throwing off ViewerJS?

Question: browser compatibility?

I don't succeed in finding anything about which browsers are supported by Viewer.JS. I'd love some information about this? Where can I find it?

Custom buttons

Can I create my own buttons for previous and next on the page to control PDF in iframe ?
I dont want to use the overlay ?

IE supported?

Is it supposed to work in IE? For me, it works in chrome. When I test it embedded in an iframe, the pdf is missing almost everything in IE 10 and 11. Although, when accessing it without an iframe, it works in IE11, but is still bugged in IE10.

Hyperlinks and email adresses

Great though, Viewer.js seems to be unable to convert hyperlinks and mailto: links into functional links which limits the range of use down to a bottom line (which is a nice tool anyway).

Anyone remembering a pdf without a link somewhere, ie. to get in contact with the author? ;) Would love to see Viewer.js being capable of showing functional hyperlinks.

PDF Text Layer does not resize on zoom

The text layer in PDFs does not keep up with the zoom level.
This can be seen by changing to a non-initial zoom level (not necessarily 100%) and then trying to select text.

Underlying Text <div>s not re-sized on Zoom In/Out

I've observed this behavior in an embedded iFrame. These invisible text <div>s allow the native browser highlighting, so highlighting locations after zoom do not match the rendered text.
I don't know if that is a problem with PdfJs, but I don't observe that behavior when opening the PDF in Firefox.

EDIT:
I took a dig through the code. In PDFViewerPlugin the function updatePageDimensions updates the outer textLayer <div>. Each text-line <div> has the following attributes that need to be updated: data-canvas-width, left, top, and scale.

UI glitches

(at least) when showing a spreadsheet, the top UI bar overlaps with contents:
(perhaps vertically centering makes sense?)

2014-04-03-225601_411x260_scrot

Also: when the iframe is small like this, UI elements are clashing...

Ability to offer links to the currently displayed page

There should be an optional UI element which offers a link which will result in the currently selected page in the document if a browser opens that url in a new page.

Viewer.js for that needs to also offer a method in the API which allows to set/create the link, as the exact link depends on the embedding webpage/website.

Compile instructions on README.md

Hi there,

although I can use viewer.js from the download zip available on the project page, I don't seem to find it on this repo. Am I missing something?

image

I'm having some problems on Safari, and I'd like to take a look on viewer.js file code, but it's minified. Is it somehow compiled together with pdf.js? If so, how?

Thanks in advance.

Wanted: special page on viewerjs.org to give a presentation from own file

For people who have a file with slides (like ODP/PDF) but no device around with a proper slide presentation feature supporting those formats, it could be handy to have a special page on viewerjs.org (or maybe even an own domain like show-your-slides.org) where one can simply upload a file and then do the presentation by viewerjs and the browser.

Nice-to-have: drag'n'drop support from file browser to webpage, for loading the file.

default document

viewer.js when used without specifying a default document should show a standard document. e.g. something similar to webodf/programs/viewer/README-viewer.odt

About dialog cannot be closed on smaller ViewerJS sizes

viewerjs-about-dialog-ok-button-hidden

If the size is so small that the full about dialog is not visible, the Ok button is not shown. And it is not possible to scroll the dialog upwards. So the button stays out of reach, and the dialog can never be closed.

zoom in and zoom out is not working

i am trying to add in index.html the zoom in and zoom out button.

The code is:

<button id = "zoomIn" class = "toolbarButton zoomIn" title = "zoomIn"></button>
<button id = "zoomOut" class = "toolbarButton zoomOut" title = "zoomOut"></button>

It doesn't work.

Thanks

dynamic content and type detection problem with URL parameters

If I have a dynamically generated / custom served PDF (because I have to use URLs that expire and that verify security settings in the session before serving content) I have issues with the type detection:

This works as expected:

http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf

This does not work:

http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf?foo=bar

This hack with a parameter I don't look at forced on the end does:

http://localhost:8080/Viewer.js/index.html#/test/pdf/demodoc.pdf?foo=bar&type=.pdf

I think the problem is here:

function loadDocument(documentUrl) {
    "use strict";

    if (documentUrl) {
        var extension = documentUrl.split('.').pop(),

this function assumes that there are no parameters

The following might fix this:

function loadDocument(documentUrl) {
    "use strict";

    if (documentUrl) {
        var extension = documentUrl.split('?')[0].split('.').pop(),

Not loading document

Hi i am using viewer.js for providing preview option of odp file in my web app. Locally when i tested it was working fine and still works fine (LAMP) ubuntu. But in one of our live server(apache2) the document does not load.

Javascript console shows :
WARNING: refreshOdf called but ODF was not DONE. webodf.js (line 44)
will be back later... webodf.js (line 44)

will be back later.. will be logged every second

Examples not working in Safari Mac and Windows

Is there any work around? it works on safari mobile(ipod/ipad/iphone) it returns Unexpected server response (206) while retrieving PDF in mac and TypeError: 'undefined' is not an object (evaluating 'PDFJS.WorkerMessageHandler.setup') in windows

Viewer.js doesnt work on Safari

Hi,

I have issue that library doesn't work on safari. the Safari give a warning:

Warning: Setting up fake worker.
TypeError: 'undefined' is not an object (evaluating 'PDFJS.WorkerMessageHandler.setup')

Clicking download goes to an intermediate page

I have recently implemented Viewer.js and have noticed that when I click the download button it goes to the default browser document viewer and I have to click download again. (Google Chrome)

When I try to use Firefox, the button doesn't appear to do anything.

Note: I haven't edited anything. I just have the folder ViewerJS in my web/ folder on my server and am using the following link to access my document.

.../web/ViewerJS/#../documents/Testing.pdf

"Viewer.js" or "ViewerJS"?

Naming of the viewerXXX product is not consistent ATM.
One can see at least "Viewer.JS", "viewer.js", "Viewer.js", "ViewerJS".

This needs to be standardized.

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.