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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-30-2020, 06:27 AM   #1
Lafisrap
Junior Member
Lafisrap began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2020
Device: Kindle Reader
Exclamation ebook-convert changes width of pdf pdf-odd-even-offset and pdf-add-toc used both

Executing

Code:
echo "# This is a test" > test.md
ebook-convert test.md test.pdf --custom-size 4.724x7.48 --pdf-odd-even-offset 10
--pdf-add-toc --level1-toc //h:h1
results in a test.pdf having a width of 4.54.

Code:
ebook-convert test.md test.pdf --custom-size 4.724x7.48 --pdf-odd-even-offset 0
--pdf-add-toc --level1-toc //h:h1
or

Code:
ebook-convert test.md test.pdf --custom-size 4.724x7.48 --pdf-odd-even-offset 10
results in a with of 4.71.

Not exact though, but very much closer to the specified width.

1. First is a bug I guess.
2. Question: Why can't it be exact? (I need this to upload a book to bod.de)
Lafisrap is offline   Reply With Quote
Old 08-30-2020, 11:27 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: 39,816
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1. odd-even offsets are implemented by adding to margins, so subtract that size from the custom size you specify. calibre could of course do so itself, and probably should, open a bug report for it.

2. No clue, calibre simply passes page size to chromium, the rest is up to it
kovidgoyal is offline   Reply With Quote
Advert
Old 08-30-2020, 11:43 AM   #3
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: 39,816
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Actually regarding (2), this will make it a bit better https://github.com/kovidgoyal/calibr...c26188df85ed33

however you will never get exact sizes unles syou specify the sizes in pts, as that is the unit used by PDF.
kovidgoyal is offline   Reply With Quote
Old 08-30-2020, 11:57 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: 39,816
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And I looked at 1 as well. I was misremembering. It does not change page sizes, it changes the crop box on each page.
kovidgoyal is offline   Reply With Quote
Old 09-04-2020, 06:43 AM   #5
Lafisrap
Junior Member
Lafisrap began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2020
Device: Kindle Reader
Quote:
Originally Posted by kovidgoyal View Post
Actually regarding (2), this will make it a bit better https://github.com/kovidgoyal/calibr...c26188df85ed33
Thanks a lot!

Quote:
Originally Posted by kovidgoyal View Post
however you will never get exact sizes unles syou specify the sizes in pts, as that is the unit used by PDF.
I will change this in my app ...
Lafisrap is offline   Reply With Quote
Advert
Reply

Tags
markdown pdf md width

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I format the TOC in a PDF created by ebook-convert cli command? Lafisrap Conversion 1 07-28-2020 12:04 PM
Just add TOC to PDF, but no other changes? ghostwheel Conversion 1 04-22-2018 09:58 PM
Convert Image PDF to PDF with text or other ebook format. Memes PDF 6 06-16-2017 03:29 AM
Convert TOC to PDF Bookmarks Dillinquent Conversion 1 08-23-2011 09:19 AM


All times are GMT -4. The time now is 05:45 PM.


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