![]() |
#31 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
Quote:
I don't have a lot of time to experiment today. I'm a little worried about no author style: would that mean that nothing in the original's CSS would be maintained? That's hardly a good compromise. I've been meaning to play around with pacify too, ahi... just don't have a lot of time this week, and am juggling other projects. Last edited by frabjous; 09-16-2009 at 11:52 AM. |
|
![]() |
![]() |
![]() |
#32 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
Quote:
The approach I intend to take in pacify, is to import only minimal formatting, and dress the output (whether LaTeX or HTML) with predefined templates (or, I suppose, optionally a user provided one). However that's not really an option, unless you know what elements and classes the document uses. With pacify, I know that, because I basically (re)generate the HTML... but if the source HTML is to be faithfully preserved, intricacies may be impossible to address other than on a document by document basis (via a custom user-provided CSS stylesheet). Of course... well formatted ePubs should have their paragraphs inside <P> tags and headers inside <Hx> tags... that much is easy enough to style. The problems start only if there are quotations, poems, tables, pictures, et cetera in there... most of which could be handled in a variety of different ways in HTML. - Ahi |
|
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,790
Karma: 507333
Join Date: May 2009
Device: none
|
.....
|
![]() |
![]() |
![]() |
#34 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I've updated the script in post #11 again. I think it's a bit cleaner now, and two main improvements:
- It will use pdftk if available to set the author and title metadata of the PDF. - It has another option, -S, equivalent to -s but with a higher priority. The stylesheet specified with -s is overriden (if there are conflicts) by the book-specific .css, if any. The stylesheet specified with -S will override anything (use !important to override the "author" styles, as usual). |
![]() |
![]() |
![]() |
#35 | |
Liseuse Lover
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 869
Karma: 1035404
Join Date: Jul 2008
Location: Netherlands
Device: PRS-505
|
Quote:
- I had to softlink /usr/bin/xmlstarlet to a /usr/bin/xml which the script seems to think is the name of the xmlstartlet program? (I'm on stock FC10, xmlstarlet from standard package repos). No big headache though. - If I use the -S option it won't load my specified stylesheet, instead trying to load default.css - if that doesn't exist it throws an error (circumvented by renaming my style sheet default.css) - the generated bookmarks seem odd at times.For some Calibre-generated epubs I got a multilevel TOC like - <book name> ---<author> ------produced by calibre (version) Other than that, it looks rather spiffy ![]() ![]() I had some issues with it ignoring my css and defaulting to the book CSS, but forcing lots of !importants everywhere seems to solve it. Still, I would expect -S to override everything as per your previous post, but that doesn't seem to happen always. Last edited by acidzebra; 09-18-2009 at 08:44 PM. Reason: I'm an idiot who should use the !important attribute in CSS |
|
![]() |
![]() |
Advert | |
|
![]() |
#36 | ||||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Quote:
Quote:
[code].calibretitle, .calibreauthor, .calibreversion { prince-bookmark-level: none; }[/quote] ... using the correct class names, of course. If you show me a sample file, I'll tell you Quote:
Normally, "Author" styles override "User" styles, but rules with !important change this ("User" rules with !important are stronger than "Author" rules, with or without !important). So if you want to override "Author" styles, you can just have !important in the stylesheet given with -s (or ~/.epub2pdf/default.css). When the priority of conflicting rules is the same, the last one to be declared takes precedence. So, if your default.css and the book's prince-style are in conflict, the latter wins, because it is passed to the Prince command-line last. Usually you could override it with !important in your default.css, but if it already has !important in the prince-style, it won't do anything. This is the role of the -S option, it passes the stylesheet to the command-line after the prince-style, so it can override !important rules there. In fact, it's only needed in this case, since in all other cases you can override rules with the -s option. Another problem is, as Frabjous commented above, that if you specify a font-family (or any other property) for the body element, but the book's stylesheets have another font-family for lower elements (p, div...), the latter take precedende, no matter how !important your rules are. If you want to change it you have to define the font family for these p or div elements (and maybe with the correct class names) in your default.css. |
||||
![]() |
![]() |
![]() |
#37 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2009
Device: none
|
Not able to remove watermark [:(]
Quote:
Hii I am not able to remove the logo watermark from the first page... How you have done it. Thanks |
|
![]() |
![]() |
![]() |
#38 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
(do some magic[*] with tmp.pdf) pdftk tmp.pdf output file.pdf compress [*] The magic boils down to searching for: Code:
stream 0.2314 0.0471 0.3765 rg ... h f |
|
![]() |
![]() |
![]() |
#39 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2009
Device: none
|
Thanksss alot
Awesome!!!
![]() Thanks a alot ![]() Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating XML book listing with Calibre | JTAL604622 | Library Management | 5 | 06-01-2010 02:57 PM |
Question about creating PDFs (resolved - my error, d'oh) | Prince Hal | 19 | 03-02-2010 11:30 PM | |
Software for creating image-based PDFs | 301verbs | Workshop | 2 | 06-13-2009 12:51 PM |
Mobile reader being able to display A4 pdfs | Mononofu | Which one should I buy? | 10 | 01-17-2009 07:22 AM |
Creating media.xml manually | pepak | Sony Reader | 5 | 11-28-2008 10:26 AM |