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-30-2020, 06:27 AM   #1
Lafisrap
Junior Member
Lafisrap began at the beginning.
 
Posts: 5
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: 43,926
Karma: 22669820
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: 43,926
Karma: 22669820
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: 43,926
Karma: 22669820
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: 5
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


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Image PDF to PDF with text or other ebook format. Memes PDF 7 05-01-2023 04:52 PM
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 TOC to PDF Bookmarks Dillinquent Conversion 1 08-23-2011 09:19 AM


All times are GMT -4. The time now is 12:25 AM.


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