Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 12-16-2008, 07:38 AM   #1
caritas
Enthusiast
caritas doesn't littercaritas doesn't litter
 
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
HTML to PDF via mozilla

About
-----

Convert HTML to PDF with mozilla rendering engine.

The best rendering application of HTML is web browser such as
FireFox(Mozilla), but full function web browser is too large for some
devices such as ebook reader. One of the solution is to pre-render
HTML on PC with web browser and send the resulting PDF to devices.


* Usage and configuration

Make sure you have Xulrunner correctly installed.

xulrunner --app html2pdf/application.ini [-pw <width>] [-ph <height>] \
file:///tmp/foo.html /tmp/foo.pdf

-pw and -ph is to used to specify paper width and height.

mb_html.tar.gz and mb.pdf is an example html and result.
Attached Files
File Type: gz mb_html.tar.gz (57.2 KB, 336 views)
File Type: gz html2pdf.tar.gz (10.8 KB, 434 views)
File Type: pdf mb.pdf (56.0 KB, 1163 views)
caritas is offline   Reply With Quote
Old 12-16-2008, 01:36 PM   #2
bill_mchale
Wizard
bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.bill_mchale ought to be getting tired of karma fortunes by now.
 
Posts: 1,451
Karma: 1550000
Join Date: Sep 2008
Location: Maryland, USA
Device: Nook Simple Touch, HPC Evo 4G LTE
Mmm, I haven't tried this particular method, though when I tried to save html files as PDFs using firefox on the Mac, I ended up having limited success. I might have had more luck if I rewrote the style sheets. That being said, I was trying to save the file as a PDF defined for a 5" screen.

I found PrinceXML handled the job very well once I defined the style sheet for my reader.

--
Bill
bill_mchale is offline   Reply With Quote
 
Advertisement
Old 12-16-2008, 08:41 PM   #3
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,117
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Quote:
Originally Posted by bill_mchale View Post
That being said, I was trying to save the file as a PDF defined for a 5" screen.
--
Bill
I made print settings for Acrobat to save for the Sony reader; 3.47x4.86" pages and 166dpi. It's what I use when converting from Word, but should work with HTML just fine.

For people with Acrobat Pro, it can either go in C:\Program Files\Adobe\Acrobat 7.0\Distillr\Settings or C:\Documents and Settings\All Users\Documents\Adobe PDF\Settings. People using other print drivers would have to look for where the options for those are saved.
Attached Files
File Type: zip SonyReader-PDFjoboptions.zip (4.0 KB, 252 views)
Elfwreck is offline   Reply With Quote
Old 12-16-2008, 09:25 PM   #4
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 967
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by Elfwreck View Post
I made print settings for Acrobat to save for the Sony reader; 3.47x4.86" pages and 166dpi. It's what I use when converting from Word, but should work with HTML just fine.

For people with Acrobat Pro, it can either go in C:\Program Files\Adobe\Acrobat 7.0\Distillr\Settings or C:\Documents and Settings\All Users\Documents\Adobe PDF\Settings. People using other print drivers would have to look for where the options for those are saved.
I'm going to have to try this.
Amalthia is offline   Reply With Quote
Old 12-17-2008, 04:07 AM   #5
Elfwreck
Grand Sorcerer
Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.Elfwreck ought to be getting tired of karma fortunes by now.
 
Elfwreck's Avatar
 
Posts: 5,117
Karma: 24387938
Join Date: Nov 2008
Location: SF Bay Area, California, USA
Device: Clié; PRS-505; EZR Pocket Pro, PRS-600, Kobo Mini
Quote:
Originally Posted by Amalthia View Post
I'm going to have to try this.
Is very simple. It's settings that anyone could do--if they knew which of the dozen-odd buttons in the dialogue box to click on, and which tab to select, and when to click "Options," and which dropdowns are useful and which ones to skip because the later click will invalidate them...

Once you know the settings exist, it's a matter of seconds to set them, but it's nice to have a saved set for whatever kinds of PDF conversion you do most often.

Once this is installed, you can use Word, change your page size to 3.47x4.86 with whatever margin you like, and in the Adobe PDF menu, click "Change conversion settings."
Elfwreck is offline   Reply With Quote
Old 12-26-2008, 06:20 PM   #6
Bookathon
Bookaholic
Bookathon doesn't litterBookathon doesn't litter
 
Posts: 72
Karma: 142
Join Date: Dec 2008
Device: Kindle 1, 3, Ipad
Elfwreck

I read from How to create optimized sony pdf, and they mention 3.47x4.54 page size for sony 505 and your settings are little off, any particular reason?
Bookathon is offline   Reply With Quote
Old 12-26-2008, 06:56 PM   #7
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Bookathon View Post
I read from How to create optimized sony pdf, and they mention 3.47x4.54 page size for sony 505 and your settings are little off, any particular reason?
The page size information in the Sony doc is rather off. Quite a while ago I produced Reader page-size tester PDFs which demonstrate the actual correct page size is exactly 88.184 x 113.854mm.
llasram is offline   Reply With Quote
Old 12-26-2008, 10:57 PM   #8
Bookathon
Bookaholic
Bookathon doesn't litterBookathon doesn't litter
 
Posts: 72
Karma: 142
Join Date: Dec 2008
Device: Kindle 1, 3, Ipad
llasram

I just happen to notice if you are in landscape mode the last line in bottom is dim as compared to other lines and it only happens in landscape mode, in portrate mode if text flows in that area, it would not exhibit any anomaly, changing text size does not not make a difference, still that area is murky, I happen to read some pdf in landscape mode, therefore noticed it
Bookathon is offline   Reply With Quote
Old 12-27-2008, 02:12 AM   #9
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Bookathon View Post
I just happen to notice if you are in landscape mode the last line in bottom is dim as compared to other lines and it only happens in landscape mode, in portrate mode if text flows in that area, it would not exhibit any anomaly, changing text size does not not make a difference, still that area is murky, I happen to read some pdf in landscape mode, therefore noticed it
If I understand you correctly, I believe what you're seeing is the way is the way the Reader PDF renderer indicates the overlap between the two "halves" of the page. If the screen-width is scaled to fill the screen-height, that results in a scaling factor of (113.854mm / 88.184mm) = 1.291. Multiplying that times the page height yields a scaled height of 146.985mm, which is less than 2x the screen width (176.368mm). Sony fills in the extra space by having 14.691mm of each screen-page overlap content with the other screen-page showing the same PDF-page. It indicates this overlap with the fairly subtle graying effect.
llasram is offline   Reply With Quote
Old 12-30-2008, 02:55 PM   #10
Bookathon
Bookaholic
Bookathon doesn't litterBookathon doesn't litter
 
Posts: 72
Karma: 142
Join Date: Dec 2008
Device: Kindle 1, 3, Ipad
llasram

Thanks, it makes lot of sense.
Bookathon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF to HTML Mamaijee Calibre 3 10-01-2010 01:45 AM
Calibre Recipe HTML content differs from raw html of index.html. krunk Calibre 4 09-20-2010 10:48 PM
PDF to HTML ThomasMcKean Calibre 1 01-08-2010 06:49 AM
PDF, HTML, Comics Operator23 Which one should I buy? 9 12-30-2008 04:22 AM
PDF and HTML Highlighting possible? mabhobs iRex 1 07-21-2007 04:10 AM


All times are GMT -4. The time now is 10:55 PM.


MobileRead.com is a privately owned, operated and funded community.