[dba-Tech] Great JS PDF Viewer...

Salakhetdinov Shamil mcp2004 at mail.ru
Thu Sep 3 02:12:30 CDT 2015


 Hi Jim --

Thank you! I somehow missed to find this default .pdf file assignment.

Now, here are two challenges:

- 1. load .pdf from a url/fileName passed to the viewer.html in url parameter, e.g:

    {custom site pdf viewer url}/viewer.html?pdfFile={myTestPdfFileUrl}

- 2. load .pdf via AJAX call(s) from a web service, which attributes are passed to the viewer.html would in url parameters, e.g:

    {custom site pdf viewer url}/viewer.html?service={webServiceEndPointl}&pdfFileCode={guid}&...

Anybody?

Thank you.

-- Shamil


>Wednesday, September  2, 2015 6:56 PM -06:00 from Jim Lawrence <accessd at shaw.ca>:
>
>Hi Shamil:
>
>I went one step back up the directory tree to:
>
>https://github.com/mozilla/pdf.js/tree/master/web
>
>...and downloaded the ZIP file, expanded it. 
>
>The directory of interest is "web" and the start html file within that directory is "viewer.html". Note: The PDF file is in that root directory and is called "compressed.tracemonkey-pldi-09.pdf" The file name is assigned to the global variable "URL", in the JavaScript file named "viewer.js" (loaded and called from the "viewer.html" file), on line 30 but it can be assigned anywhere within the html application or via a config file. See the JavaScript function file, "download_manager.js" which assembles the PDF url, for the actual downloading code. 
>
>Aside: The code is really nice and should be used as reference material. :-)
>
>Jim 
>
>----- Original Message -----
>From: "Salakhetdinov Shamil" < mcp2004 at mail.ru >
>To: "Discussion of Hardware and Software issues" < dba-tech at databaseadvisors.com >
>Sent: Tuesday, September 1, 2015 5:29:56 AM
>Subject: [dba-Tech] Great JS PDF Viewer...
>
> Hi All --
>
>Here is a greate JS PDF Viewer
>
>http://mozilla.github.io/pdf.js/web/viewer.html
>
>
>but I cannot find how they define the url/path to the .pdf file to be loaded/viwed, do you? - the sources are here:
>
>https://github.com/mozilla/pdf.js/tree/master/web
>
>BTW, if you try the above link (  http://mozilla.github.io/pdf.js/web/viewer.html ) on your smartphone it should also work, I suppose, as it worked on my old Nokia Lumia 800.
>
>Enjoy!
>
>
>Thank you.
>
>-- 
>Салахетдинов Шамиль
>_______________________________________________
>dba-Tech mailing list
>dba-Tech at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-tech
>Website:  http://www.databaseadvisors.com
>
>_______________________________________________
>dba-Tech mailing list
>dba-Tech at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-tech
>Website:  http://www.databaseadvisors.com



More information about the dba-Tech mailing list