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

Jim Lawrence accessd at shaw.ca
Fri Sep 4 11:53:49 CDT 2015


Hi Shamil:

You definitely are a dreamer. ;-) You will have to assemble your own FE for sure but it can be done with but a few lines of html code. Haven't you heard, everything is web based now? ;-)  

Good to hear that you are now gainfully employed. 
 
Jim

----- Original Message -----
From: "Salakhetdinov Shamil" <mcp2004 at mail.ru>
To: "Discussion of Hardware and Software issues" <dba-tech at databaseadvisors.com>
Sent: Friday, September 4, 2015 3:46:44 AM
Subject: Re: [dba-Tech] Great JS PDF Viewer...

 Hi Jim --

Thank you for your comment. I hope I will find time to do that - very busy with other work but I do plan to include the subject viewer into my solution (as I have noted it works even on my good old Nokia Lumia 800)...

I was a kind of expecting to get here "ready to use" advise/step-by-step subject sources' edition procedure to get it feeded 

- with and external url PDF file or
- even with a web service call returning/piping a pdf generated on-the-fly on that web service side  :) 

Never mind.

Thank you.

-- Shamil

P.S. BTW, after I will finish a couple of urgent current projects I wanted to apply the subject PDF viewer to a sample ASP.NET web site I plan to develop from our Northwind.NET sources ( https://northwind.codeplex.com/ ) - so if anybody here have free time to solve the task of feeding JS PDF Viewer with and external PDF URL and with SOAP(/.asmx) / RESTFul (/WCF, ASP.NET Web API) then you'll be credited in to be developed and published (hopefully this fall) sources/docs of a sample Northwind.NET ASP.NET web site at  https://northwind.codeplex.com/


>Thursday, September  3, 2015 6:53 PM -06:00 from Jim Lawrence <accessd at shaw.ca>:
>
>Hi Shamil:
>
>First thing to note is that the PDF display code is just a function for a larger application. Pay attention to the universal variable that hold and are assembled the entire URL. Check how the  "download_manager.js" assembles the entire PDF URL. Comment out the default assignments within the Viewer code and assign them from the application calling this code. In other words assign the Global variables within the caller routines.
>
>Second, you could do something as simple as pass the Viewer routine, the URL via parameters. Its not classy but it is simple and it works. 
>
>Then there is HTML5's sessionStorage:
>
>http://stackoverflow.com/questions/11609376/passing-data-between-html-pages
>
>Jim 
>
>----- Original Message -----
>From: "Salakhetdinov Shamil" < mcp2004 at mail.ru >
>To: "Discussion of Hardware and Software issues" < dba-tech at databaseadvisors.com >
>Sent: Thursday, September 3, 2015 12:12:30 AM
>Subject: Re: [dba-Tech] Great JS PDF Viewer...
>
> 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
>
>_______________________________________________
>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

_______________________________________________
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