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 08-03-2016, 08:24 PM   #1
dma_k
Member
dma_k began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2013
Device: Sony PRS-T2
epub → pdf conversion: remove a section

Dear all,
I am trying to master EPUB → PDF possibilities of Calibre and I hope that somebody can help me.

Original epub contains the section "Notes" with the following contents:

Code:
<body name="notes">
 <title>
  <p>Примечания</p>
 </title>
 <section id="n_1">
  <title>
   <p>1</p>
  </title>
  <p>Неофициальное название Лондонского Сити.</p>
 </section>
</body>
The given note is referred from text as following:
Code:
<a l:href="#n_1" type="note">[1]</a>
Problem: I would like the given note to be rendered as end-of-page note (in page footer). If that is not possible, then how can I remove this whole section from processing (as it results a separate page for each note, which do not look nice)?

Another question related to i18n of PDF output: when I enable "Add a printable Table of Contents at the end", Calibre generates a nice table of contents but with title "Table of Contents". How to customize it so the title reads "Оглавление"?

In general I wonder where I can read more about HTML classes used for PDF conversion? Few (e.g. .calibre-pdf-toc) are mentioned in Printable Table of Contents but I think there are more. As far as I can see, HTMLZ does not use such (or similar) classes. Are they all documented somewhere?
dma_k is offline   Reply With Quote
Old 08-04-2016, 12:29 AM   #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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use extra css

#n_1 { display: none }

And the option nam,e Title for ToC in the PDF output section of the conversion dialog
kovidgoyal is offline   Reply With Quote
Advert
Old 08-04-2016, 08:19 AM   #3
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 922
Karma: 15576314
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by dma_k View Post
In general I wonder where I can read more about HTML classes used for PDF conversion? Few (e.g. .calibre-pdf-toc) are mentioned in Printable Table of Contents but I think there are more. As far as I can see, HTMLZ does not use such (or similar) classes. Are they all documented somewhere?
You can figure out which are used by running "ebook-convert --debug-pipeline" and looking at the intermediate pipeline stages. (In general this is a very useful way to figure out what's going on in conversion without diving into the Calibre source code.)
NullNix is offline   Reply With Quote
Old 08-04-2016, 05:11 PM   #4
dma_k
Member
dma_k began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2013
Device: Sony PRS-T2
Quote:
Originally Posted by kovidgoyal View Post
#n_1 { display: none }
Not very practical if I have 30 of them. And it did not work.
No way to render them at the bottom of the page?
Quote:
Originally Posted by NullNix View Post
You can figure out which are used by running "ebook-convert --debug-pipeline" and looking at the intermediate pipeline stages.
Is it possible to get intermediate HTML that way?
Quote:
How to customize it so the title reads "Оглавление"?
I have found this configuration option myself: PDF Output → "Title for ToC".
dma_k is offline   Reply With Quote
Old 08-04-2016, 09:34 PM   #5
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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by dma_k View Post
Not very practical if I have 30 of them. And it did not work.
Then you did not use it right. And if you have many of them, then you need to identify some pattern they follow and use that pattern with either search and replace or a more sophisticated css selector.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-19-2016, 06:37 PM   #6
dma_k
Member
dma_k began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2013
Device: Sony PRS-T2
Quote:
Originally Posted by kovidgoyal View Post
Then you did not use it right. And if you have many of them, then you need to identify some pattern they follow and use that pattern with either search and replace or a more sophisticated css selector.
I would be happy if you tell me where I am wrong. Take sample book in FB2 and use #n_1, #n_2, #n_3 { display: none } or body[name="notes"] { display: none; } as "Common Options → Look&Feel → Styling" and do conversion to PDF. I got this, basically, CSS has no effect.
dma_k is offline   Reply With Quote
Old 08-19-2016, 11:18 PM   #7
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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Works fine for me. As I said you are doing something wrong. Most likely you dont realize that re-converting a previously converted book uses the settings from the previous conversion over the global preferences. http://manual.calibre-ebook.com/conv...for-conversion
kovidgoyal is offline   Reply With Quote
Old 08-28-2016, 05:18 PM   #8
dma_k
Member
dma_k began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2013
Device: Sony PRS-T2
Quote:
Originally Posted by kovidgoyal View Post
Most likely you dont realize that re-converting a previously converted book uses the settings from the previous conversion over the global preferences.
You're right. It seems like I have missed that point – thanks for noting that. Indeed, there is an effect if I use CSS #n_1, #n_2, #n_3 { display: none; }. But I still see the section "Примечания" – I would like to hide it together with entry in TOC. I tried CSS body[name="notes"] { display: none; } but it didn't work out. What I did wrong?
dma_k is offline   Reply With Quote
Old 08-31-2016, 05:40 PM   #9
dma_k
Member
dma_k began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2013
Device: Sony PRS-T2
I think there is something wrong there. I have removed the books from the list – I believe the per-book conversion options should be removed. I have selected FB2 file(s) and pressed "Convert books → Bulk convert". "Notes" section is still there after conversion. kovidgoyal, could you please share the PDF file that you've got and CSS which you have applied?
dma_k is offline   Reply With Quote
Reply

Tags
epub css xpath


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating epub/kepub books (docx→epub/kepub via MS Word→Calibre) SJC-Caron ePub 18 04-21-2016 11:10 AM
PDF->EPUB only displays 'Front section' bsmart Conversion 2 05-14-2011 05:44 AM
epub to pdf conversion: blank page inserted before any section Nicoo Calibre 0 12-06-2009 06:10 PM
remove tabs at pdf conversion automated Calibre 0 02-01-2009 02:45 AM


All times are GMT -4. The time now is 08:12 PM.


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