Download pdf of epaper eisamay

Eisamay is awesome Bengali newspaper. I wanted a pdf copy of the paper to read it offline in my brand new Tab2 .
Long days ago I have seen there was a pdf button in website to generate pdf copy but now its not there.

Searched a lot if it is moved to anywhere else but not able to find 🙁 … It need to try something else…

Information gathering:

  • In the below of the page it is written eisamay is Designed and Developed by Ezinemart. Opened there website.
  • They are providing service to lots of other paper. Opened some….Yes in some paper there is a pdf button to generate pdf copy.
  • They have made a common platform and customized it as per client requirement. So there may be same features available to all the site.

Findings:
In some paper they are just calling showpdf() JavaScript function to download pdf copy of current page.

How to call js function from browser:
So it is found that if they haven’t removed the showpdf() js functionality then we can call it externally and can get the pdf.
Now how to fire js externally without clicking any button in existing page?
In Chrome there is console (Rigtclick -> Inspect Element -> Console). Here you can call any js. Write showpdf() and press enter. It will make pdf of current page. In Firefox you can do the same if firebug is installed. getimgnext(1,123) fuction is used to go to the next page. So with combination of showpdf() and getimgnext(1,123) you can make some script to down the all pages.

Developed some script:
I was thinking to download pdfs of whole website without opening it. While experimenting with showpdf() function I observed it is not generating the pdf on the fly but opening it from the server and there is a patten with the link. So we can easily make a request and get the file downloaded. After a little try wrote a shell script to download(wget) all the pdfs and merge(pdftk) it to 1 file.
https://github.com/sonu041/pdfEiSamay/blob/master/pdfEiSamay.sh

Script in action:

Eisamay Download Processing

Enjoy Eisamay Epaper offline:

EiSamay Epaper

Enjoy 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.