11-11-2016, 05:41 PM | #1 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
pdf header reference to css
I have an extremely long pdf header instruction which puts a colored frame around the header:
<div style=" background-color: #ffc; border: black solid 2pt; border-radius: 10px; display: block; width:max; font-size: 0.75em; font-weight: bold; margin: 0 2em 0 0; line-height: 1; padding: 1%; text-indent: 0; <p style="float:left">_TITLE_<p style="float:right;">by _AUTHOR_ <p></p><p></p></div> I copied most of it from my CSS: f { background-color: #ffc; border: black solid 2pt; border-radius: 10px; display: block; float: left; font-size: 0.75em; font-weight: bold; margin: 0 2em 0 0; line-height: 1; padding: 1%; text-indent: 0; } Would it be possible to wrap the text within the header with <f></f> with some sort of reference to the CSS? Best regards, Pop |
11-11-2016, 08:55 PM | #2 |
creator of calibre
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sorry I dont understand what you are asking. The header is just HTML+CSS like the rest of the book, anything you can do with HTML you can do in the header.
|
Advert | |
|
11-14-2016, 12:53 PM | #3 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
Sorry if I was verbose and not clear. I am asking if there is a way, using the calibre PDF converter, to include a header instruction which invokes the CSS file. The CSS file includes a definition for a frame:
f { background-color: #ffc; border: black solid 2pt; border-radius: 10px; display: block; float: left; font-size: 0.75em; font-weight: bold; margin: 0 2em 0 0; line-height: 1; padding: 1%; text-indent: 0; } I wish to reference it in the PDF header instruction so that I do not have to include the information between { and } in the header. Can I somehow just put in <f>? I was thinking something like 'href' might work. Best regards, Pop |
11-14-2016, 10:04 PM | #4 |
creator of calibre
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, there is no way to refer to document stylesheets from header HTML. DOcument stylesheets are flattened before PDF output takes place.
|
11-15-2016, 09:12 AM | #5 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
thank you for the answer to the question about pdf headers
I have made 280 youtube videos and am currently making a series about calibre. They are entitled "calibre epub (##) whatever" and the newest one is "calibre epub (34) bulleted and numbered lists". I am going to make another on pdf output and wanted to clarify css reference. Thank you. Best regards, Pop
|
Advert | |
|
11-15-2016, 09:48 AM | #6 |
creator of calibre
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You're welcome, feel free to ask if you need clarification on something
|
11-16-2016, 09:18 AM | #7 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
unwanted intervening blank pages in pdf
When converting from epub to pdf I notice that if a chapter ends near the bottom of a page then an intervening blank page is inserted before the next chapter begins. It appears that 3 or fewer blanks lines at the end of a chapter triggers the unwanted blank page to occur. Is there a way to instruct pdf output so that the blank page is not put in before the next chapter? Best regards, Pop
|
11-16-2016, 09:32 AM | #8 |
creator of calibre
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Not really, the PDF output has to use heuristics to try to guess when a trailing page at the end of a chapter is blank -- these heuristic can fail, especially if you use headers/footers.
If you have a sample epub file demonstrating the issue feel free to post it and I will see if I can improve the heuristics. |
11-17-2016, 08:24 AM | #9 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
unwanted intervening blank pages in pdf (continued)
Dear Kovid,
Thank you for looking at my problem. I hope this helps you in your work. When 0, 1, 2, or 3 blank lines occur at the bottom of the last page of a chapter, the next page is always blank and the H1 chapter begins after the blank page. The blank pages are: 4, 53, 59, 97, 114, 116, 161, 168. I have been trying warious things as 'work-arounds'. I tried using widows and orphans, page-break-before: avoid, no footers, varying PDF bottom margin, page-break-inside: avoid. I tried to use H1 such that it will not cause a page break. I have been in the habit of enclosing frame around image without captions and also enclosing frame around image with captions. I have noticed the frame will start at the bottom of a page, then extend image and caption to the top of the next page. To prevent this, I have been using the 'page-break-before: always' command in the CSS. The command does not work using my 'made-up' CSS inclusion called <f>. Instead, I must use an existing command of one sort or another. I have been using <dd>. The text will then look like: <dd><f><image>caption</f></dd> and this conglomeration will keep a captioned, framed image from spreading across two pages. (I realize the <dd> is an 'odd duck'.) Best regards, Pop |
11-20-2016, 12:35 AM | #10 |
creator of calibre
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I dont get any blank pages converting to PDF, see attached. (this is with all default conversion options). If you are using some custom options, such as headers/footers/page size then you will need to post those as well.
|
12-07-2016, 12:23 PM | #11 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
unwanted blank pages in PDFs with headers
I have been working on solving the "unwanted blank pages with headers' problem to no avail. The header text:
<br><br><br><br> <div style="text-indent:0;text-align:center; background-color: #ffc; border: black solid 2pt; border-radius: 10px; font-size: 0.75em; font-weight: bold; margin: 0 2% 0 0; line-height: 1; padding: 1%;"> <b><u>_TITLE_</b></u> <br> by _AUTHOR_ 713-818-8995 rjwse@aol.com<br> _SECTION_</div> I am including a short file. In advance, I thank you for your help. Best Regards, Pop |
12-09-2016, 01:34 PM | #12 |
Addict
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
Dear Kovid,
I found an awkward work-around so that conversion from EPUB to PDF will not create unwanted blank pages when using complex headers. While in the editor, if you merge the HTML segments into one large segment, the H1 chapters are now strung out along the new, huge HTML segment. PDF conversion does cause each H1 to begin a new page, but now there are no intervening blank pages produced. Hope this helps. Best regards, Pop |
Tags |
calibre pdf with headers, css ref in headers, pdf headers |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF header still showing up after cropping | Algiedi | Conversion | 9 | 03-23-2011 02:53 PM |
Regex to remove header from PDF | neonbible | Calibre | 4 | 09-07-2010 10:08 AM |
Remove Header from PDF | rrosenwald | Calibre | 10 | 08-22-2009 08:36 PM |
PDF Reference | joblack | 5 | 06-12-2009 08:39 AM | |
Free CSS reference on your iPod | TadW | Deals and Resources (No Self-Promotion or Affiliate Links) | 2 | 12-16-2004 05:22 PM |