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 10-16-2020, 12:37 AM   #1
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: none
Probably bug - Thin lines vanishing

I have an epub I'm converting to pdf. The Calibre converter's doing okay, really, but I decided for best results to create a customised epub and convert that. The document uses 'thin' 'medium' and 'thick' lines which are 0.25mm, 0.5mm and 1.0mm - those were round numbers chosen to make some CSS box sizes neater.

(css sample:

div.large_cap {
background-color: #FFFFFF;
border: 0.25mm solid #222222;
color: #5588FF;
line-height: 12.5mm;
text-align: center }

i.e. a decorative box round a drop cap)

But the 0.25mm lines vanish entirely from the PDF output, although they display fine in Calibre when I view the epub, and also when I view the relevant chapter html file in a web browser. So I don't think they should disappear in the pdf. When you print at 360 dpi, 0.25mm is would be about 3 dots wide so they should print OK except they're getting nobbled in transit. So I think there's a rounding error in Calibre. This is because 'one pixel' is 1/96th of an inch (ish; I know some caveats may apply), and that's 0.26mm. Seems I unknowingly chose a round number juuuust below that, so no thin lines for me!

I'd be glad to log it as a bug - can anyone confirm it?

Is there a config setting I've missed where I can set the minimum line thickness to some lower value?
Simons Mith is offline   Reply With Quote
Old 10-16-2020, 02:18 AM   #2
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,775
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
https://www.mobileread.com/forums/sh...d.php?t=186697

So for someone else to confirm it, please post a simple (public domain) ePub that shows the problem, and the PDF resulting from the conversion.
pdurrant is offline   Reply With Quote
Advert
Old 10-16-2020, 04:22 PM   #3
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: none
Sample files and screenshots attached .... I think. Calibre and Firefox screenshots, epub and pdf samples.

Anyone wanting to use the skeleton epub for their own purposes is welcome to.

However I can't reproduce the thin lines showing correctly in calibre right now. I fiddled with display and export settings a lot, and I'm no longer certain I definitely looked at the ultra-thin lines in the Calibre viewer - thinking back, I may have been loading into Calibre and jumping straight to pdf export by that stage.

However, even lines that thin could print out at 360dpi on A4, which is the intended target. There's no special reason you can't have a 0.5px line, on an ultra- hi-res display, is there?
Attached Thumbnails
Click image for larger version

Name:	calibre.png
Views:	184
Size:	56.5 KB
ID:	182805   Click image for larger version

Name:	firefox.png
Views:	189
Size:	49.9 KB
ID:	182808  
Attached Files
File Type: epub Calibre PDF Conversion Bug Demo - Simon Smith.epub (3.1 KB, 198 views)
File Type: pdf Calibre PDF Conversion Bug Demo - Simon Smith.pdf (73.6 KB, 199 views)
Simons Mith is offline   Reply With Quote
Old 10-17-2020, 12:02 AM   #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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The viewer and PDF export both happen via Chromium (Qt WebEngine to be exact). There isn't any cotrol I have over the process. If Chromium doesnt like rendering 0.5px lines, it doesnt, end of story.
kovidgoyal is offline   Reply With Quote
Old 10-17-2020, 12:07 AM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,321
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Simons Mith View Post
However, even lines that thin could print out at 360dpi on A4, which is the intended target. There's no special reason you can't have a 0.5px line, on an ultra- hi-res display, is there?
Did you mean a 0.5pt line? A 0.5px line is half a pixel which is going to be hard to display.
DNSB is offline   Reply With Quote
Advert
Old 10-17-2020, 04:14 AM   #6
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,775
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
How very strange. That PDF appears to be bit maps. I had assumed it would be objects.
pdurrant is offline   Reply With Quote
Old 10-17-2020, 10:18 AM   #7
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: none
@pdurrant - the first page is the autogenerated cover, which is a bitmap. Second page, which looks the same, is the proper text.

@DNSB I did mean 0.5px. Yes, a line that thin might well be too thin to display on-screen at ~96dpi. But it wouldn't be too thin to display on paper at ~360dpi. Unfortunately it never manages to get that far.

@kovidgoyal That's fair then. Thank you for clarifying, and so quickly too.
Simons Mith is offline   Reply With Quote
Old 10-17-2020, 12:25 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,321
Karma: 168808725
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Simons Mith View Post
@DNSB I did mean 0.5px. Yes, a line that thin might well be too thin to display on-screen at ~96dpi. But it wouldn't be too thin to display on paper at ~360dpi. Unfortunately it never manages to get that far.
Last time I looked, 1px = 1/96th of an inch was specified for printing while being left rather nebulous for displays.

What if you try a scaling transform which I've seen used on a few occasions? Though this is not guaranteed to work on every device.

Code:
hr.thin2 {
    height: 1px;
    border-top: none;
    border-bottom: 1px solid black;
    transform: scaleY(0.50);
}
DNSB is offline   Reply With Quote
Old 10-17-2020, 02:46 PM   #9
Simons Mith
Member
Simons Mith began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Oct 2020
Device: none
@dnsb

While that works for an hr, you'd have to get fancier to use the same trick on a box border and then undistort the contents. I think it would be a mistake to go to those lengths for something that's only presentational.

In my case, I didn't mind what the exact values were - I can use 0.5mm, 0.75mm, 1.0mm just fine, now I know 0.25mm is too thin. It's just a little bit annoying when 0.25mm is a nice round number and it's almost 1px wide anyway darnit. (BTW, it looks like Firefox simply rounds 0.5px up to 1. 0.49px lines vanish on Firefox too.)

Ironic that a definition intending to simplify printing sods up screen displays, and then the sodded-up screen stage stops the printing from working properly too.
Simons Mith is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GLO HD screen more thin lines sbwtxj Kobo Reader 3 08-31-2015 06:37 AM
Troubleshooting [PROBLEM] Is my K4 a goner? (Thin gray horizontal lines on screen) olivaresfelipe Amazon Kindle 7 11-19-2013 11:13 AM
Touch [Bug report] Black lines on some pdfLaTex-generated pdfs createsoftware Kobo Reader 2 06-26-2012 02:11 PM
Touch Dark lines between lines of text taming Kobo Reader 12 06-13-2011 07:20 PM
Blank lines vanishing in Kindle Previewer - iPhone mode Oxford-eBooks Kindle Formats 20 12-24-2010 04:42 PM


All times are GMT -4. The time now is 01:44 PM.


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