webOS Nation Forums >  webOS tablets >  HP TouchPad > A better way to read pdf files
A better way to read pdf files

  Reply
Like Tree1Likes
  • 1 Post By lupos

 
LinkBack Thread Tools Display Modes
Old 01/30/2012, 01:12 PM   #1 (permalink)
Member
 
Join Date: Oct 2011
Posts: 42
Likes Received: 1
Thanks: 3
Thanked 1 Time in 1 Post
Smile A better way to read pdf files

Many people have problems with the default pdf reader. Most involve the rendering speed, page turning etc. The TP does do a pretty good job of viewing web pages. After all, web pages are designed to show formatted, reflowable text and pictures. Why not convert the pdf to viewable web pages? The results are surprisingly good. The web browser does the rendering. We can gain fast rendering, pinch and zoom, indexed pages, portrait or landscape orientation and more depending on the quality of the conversion.

One place to start is Poppler, but there are other converters available. I have converted a complicated Scientific American issue with this and it seems most pages render fine and have the gains I have previously mentioned. Since most common pdfs are not so complex, this may be enough for most needs.

The basic procedure is convert the pdf to html, placing all results in a single folder since there can be multiple files. Copy this folder to the TP and open the main html file in the browser. In my case, 201202.pdf creates 201202.html as the main file. A preware patch that allows the browser to open local files is also needed. Use the method described in this thread, way to view stored html files, and Efftokar's post for a fast way to open the main file in the browser. If this proves popular, it should be relatively trivial for someone to create a reader app for these local html files.

OPTIONAL AUTOMATIC BATCH CONVERSION (see attached files):
The shell script convertPDF.sh will create a folder with the converted html files.
To install, place the attached convertPDF.sh and pdfControlScript into /usr/local/bin. Make sure convertPDF.sh is executable. Run the script convertPDF.sh with the pdf file as its argument in the folder containing the pdf file to be converted. The original pdf file is retained. Note the key command used is the open source "sed" editor. It should be possible to use a form of this script on windows, though I have not tried this.

NETWORK ACCESS (preliminary):
Want easy local network access to these and other files? Make sure python is installed. Run the command line "python -m SimpleHTTPServer" in the folder you want to share on the sharing computer. Using the browser on the TP, enter the local IP address of this sharing computer using port 8000. As an example, enter "http://192.168.0.50:8000". This will allow you view the converted pdf files, the original pdf files, play music, view pictures etc. In short, whatever your browser can handle. You can also add a launcher to save typing for next time.

More to come...
Attached Files
File Type: zip pdfConvert.zip (931 Bytes, 10 views) Email Attachment

Last edited by levinite; 02/15/2012 at 11:45 AM. Reason: added/updated code, wrong program link
levinite is offline   Reply With Quote
Old 01/30/2012, 02:58 PM   #2 (permalink)
Member
 
Join Date: Feb 2005
Location: NYC
Posts: 271
Likes Received: 8
Thanks: 48
Thanked 42 Times in 24 Posts
Default

i have cm9(android) installed and the kindle app for android will open pdfs. You actually have to select the file in a file explorer than when prompted choose the kindle app but it's awesome.
lupos is offline   Reply With Quote
Liked by Joe_B likes this.
Old 01/30/2012, 04:54 PM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 555
Likes Received: 46
Thanks: 48
Thanked 69 Times in 41 Posts
Default

If you install this patch, the PDF reader is like a whole new program.
[PATCH/IPK]Adobe PDF Reader Enhancements
jdale is offline   Reply With Quote
Old 01/30/2012, 05:18 PM   #4 (permalink)
Member
 
Join Date: Oct 2011
Posts: 42
Likes Received: 1
Thanks: 3
Thanked 1 Time in 1 Post
Default

Maybe so, but I doubt it is anywhere near as fast and as versatile this method on the TP. If the link info is accurate, it is even possible to use your own CSS code. I am currently working on page forward and page back. Also note that the page is rendered in its own frame (a click to a new page does not require a new browser page. This method is not without issues, but it does have certain advantages. Don't knock it until you have tried it.
levinite is offline   Reply With Quote
Old 01/30/2012, 11:39 PM   #5 (permalink)
Member
 
Join Date: Sep 2011
Location: St. Louis MO
Posts: 48
Likes Received: 7
Thanks: 22
Thanked 5 Times in 4 Posts
Default

Quote:
Originally Posted by levinite View Post
Maybe so, but I doubt it is anywhere near as fast and as versatile this method on the TP. If the link info is accurate, it is even possible to use your own CSS code. I am currently working on page forward and page back. Also note that the page is rendered in its own frame (a click to a new page does not require a new browser page. This method is not without issues, but it does have certain advantages. Don't knock it until you have tried it.
How is it faster if you have to first convert it to HTML before you can read it? I have way too many documents to attempt that.

If you install the mupdf render from the above mentioned post it is at least twice as fast as the stock adobe.
Dogma is offline   Reply With Quote
Old 01/31/2012, 01:00 AM   #6 (permalink)
Member
 
Join Date: Jan 2012
Posts: 104
Likes Received: 19
Thanks: 6
Thanked 24 Times in 23 Posts
Default

These patches work great!! Makes the stock PDF reader actually read PDFs!!!
creepingmee is online now   Reply With Quote
Old 01/31/2012, 02:44 AM   #7 (permalink)
Member
 
Join Date: Aug 2011
Posts: 34
Likes Received: 0
Thanks: 1
Thanked 1 Time in 1 Post
Default

Although I'll agree that the patches for the stock Adobe reader work rather well, I'll admit that this is a good proof of concept, and worth encouraging.

Keep up the work.
CyberPhunk is offline   Reply With Quote
Old 01/31/2012, 04:22 AM   #8 (permalink)
Member
 
Join Date: Jul 2008
Posts: 428
Likes Received: 49
Thanks: 118
Thanked 38 Times in 32 Posts
Default

Quote:
Originally Posted by levinite View Post
Maybe so, but I doubt it is anywhere near as fast and as versatile this method...
How do you know? Have you tried it?

Quote:
Originally Posted by levinite View Post
Don't knock it until you have tried it.
p41m3r is offline   Reply With Quote
Old 01/31/2012, 09:45 AM   #9 (permalink)
Member
 
Join Date: Oct 2011
Posts: 42
Likes Received: 1
Thanks: 3
Thanked 1 Time in 1 Post
Red face program link error

I have discovered an error in the link to the program used for my conversion discussed in the original post. The correct link is Poppler. I have also corrected the original post. The version I used initially was 0.12.4, the current version is 0.18.3. Note I have not tested this new version. I apologize for any inconvenience this may have caused.

Last edited by levinite; 01/31/2012 at 09:52 AM.
levinite is offline   Reply With Quote
Old 01/31/2012, 01:21 PM   #10 (permalink)
Member
 
Join Date: Aug 2011
Posts: 275
Likes Received: 21
Thanks: 14
Thanked 58 Times in 37 Posts
Default

I came up with this exact thought in Sept but decided against going into messing with it.
knownboyofno is offline   Reply With Quote
Old 02/02/2012, 10:35 AM   #11 (permalink)
Member
 
Join Date: Oct 2011
Posts: 42
Likes Received: 1
Thanks: 3
Thanked 1 Time in 1 Post
Default update

I have replaced the controlling code with a cleaner interface and added a goto page with display. The next step is to automate this process and finally allow the files to be selected, optionally converted and read through a network.
levinite is offline   Reply With Quote
Old 02/03/2012, 01:08 AM   #12 (permalink)
Member
 
Jane66's Avatar
 
Join Date: Jun 2010
Posts: 44
Likes Received: 0
Thanks: 2
Thanked 3 Times in 3 Posts
Default

Thanks levinite's contribution, would like to have a try soon.
As Im collecting HP TP rips, such as have just found a list of "Top HP TouchPad Apps You must Have" from Aneesoft, cool, cheers!
Jane66 is offline   Reply With Quote
Old 02/03/2012, 05:55 AM   #13 (permalink)
Member
 
noseph's Avatar
 
Join Date: Feb 2010
Location: Massachusetts
Posts: 693
Likes Received: 57
Thanks: 127
Thanked 96 Times in 90 Posts
Default

Quote:
Originally Posted by Jane66 View Post
Thanks levinite's contribution, would like to have a try soon.
As Im collecting HP TP rips, such as have just found a list of "Top HP TouchPad Apps You must Have" from Aneesoft, cool, cheers!
Do not forget The "How do I...?" thread.
__________________
Quidquid Latine dictum sit, altum sonatur.

Palm III -> Palm V -> Viewsonic Pocket PC V36 -> Treo 650 -> Samsung i760 ->
Palm Pre Plus -> Palm Pre 2 & HP TouchPad

WebOS 2.1.0 VZW Pre 2
CM9 Alpha 2 Official Nightly HP TouchPad

Twitter: @noseph47
noseph is online now   Reply With Quote
Old 02/03/2012, 10:20 AM   #14 (permalink)
Member
 
Join Date: Sep 2011
Posts: 58
Likes Received: 6
Thanks: 1
Thanked 4 Times in 4 Posts
Default

Quote:
The best way to read pdf imo is using cm9. The webos app is so barebone and slow.
That is true but this thread is about how to do it in WebOS.

Last edited by HelloNNNewman; 02/22/2012 at 03:47 PM. Reason: removed banned member
chronoreverse is offline   Reply With Quote
Old 02/15/2012, 12:11 PM   #15 (permalink)
Member
 
Join Date: Oct 2011
Posts: 42
Likes Received: 1
Thanks: 3
Thanked 1 Time in 1 Post
Default update: conversion script and local network access

I have added a script to automatically convert the pdf file into a folder containing the html files. Although this is a linux script, since it primarily uses the open source "sed" editor, it could probably be modified for windows or mac. Also, I have added an easy method to allow local network access to browser compatible file types including pdf, music, video etc. See the original post.
levinite is offline   Reply With Quote
Reply

 

Tags
fast, pdf, reader

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0