Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2016, 05:41 PM   #1
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
Attached Files
File Type: pdf 1.pdf (51.5 KB, 143 views)
rjwse@aol.com is offline   Reply With Quote
Old 11-11-2016, 08:55 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-14-2016, 12:53 PM   #3
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
rjwse@aol.com is offline   Reply With Quote
Old 11-14-2016, 10:04 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 11-15-2016, 09:12 AM   #5
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
rjwse@aol.com is offline   Reply With Quote
Advert
Old 11-15-2016, 09:48 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 11-16-2016, 09:18 AM   #7
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2016-11-16 08-12-59.png
Views:	138
Size:	208.6 KB
ID:	153046   Click image for larger version

Name:	Screenshot from 2016-11-16 08-12-17.png
Views:	117
Size:	103.8 KB
ID:	153047  
rjwse@aol.com is offline   Reply With Quote
Old 11-16-2016, 09:32 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 11-17-2016, 08:24 AM   #9
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
rjwse@aol.com is offline   Reply With Quote
Old 11-20-2016, 12:35 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
Attached Files
File Type: pdf pdf.pdf (5.90 MB, 177 views)
kovidgoyal is offline   Reply With Quote
Old 12-07-2016, 12:23 PM   #11
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
Attached Files
File Type: gz 1.m4v.gz (12.52 MB, 103 views)
rjwse@aol.com is offline   Reply With Quote
Old 12-09-2016, 01:34 PM   #12
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
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
rjwse@aol.com is offline   Reply With Quote
Reply

Tags
calibre pdf with headers, css ref in headers, pdf headers


Forum Jump

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 PDF 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


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


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