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 11-20-2023, 02:51 AM   #1
bdoors
Junior Member
bdoors began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2023
Device: none
Calibre can't link to images or pdfs?

This valid code is in my HTML file that I submit as input to Calibre --

<a href="test.pdf">Test PDF</a>
<a href="test.jpg">Test JPG</a>

After I convert my input to EPUB and edit it, I see that Calibre has translated my input lines into this-

<a href="test.pdf" class="pcalibre calibre5 pcalibre1">Test PDF</a>
<a href="test.jpg" class="pcalibre calibre5 pcalibre1">Test JPG</a>

When I'm in the Calibre Reader and try to click on my links, Calibre brings up the browser and gives me these error messages --

https://calibre-internal.invalid/test.pdf
https://calibre-internal.invalid/test.jpg

Is Calibre not capable of displaying a linked image or PDF file?

Or am I doing something wrong?

Thank you.
bdoors is offline   Reply With Quote
Old 11-20-2023, 04:52 AM   #2
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,360
Karma: 25865246
Join Date: Mar 2012
Location: Sydney Australia
Device: none
AFAIK those aref clauses are not valid because "test.pdf" is not a well-formed URL.

See [W3School] HTML a href Attribute

BR
BetterRed is online now   Reply With Quote
Old 11-20-2023, 12:05 PM   #3
bdoors
Junior Member
bdoors began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2023
Device: none
Thank you, BR, for your help.

I see what you're saying -- in the phrase

<a href="subject">link_name</a>

the "subject" must be an html file, not a jpg or pdf file.

I was coding with jpg and pdf as "subjects" because it passes html validation just fine. And works in the two browsers I test with.

But it doesn't work when I generate an EPUB through Calibre.

Through research I found that now html officially does allow jpg and pdf files to act as subjects, just by adding the download keyword --

<a href="test.jpg" download>link_name</a>

But his didn't work in Calibre either.

For now, it looks like my solution for Calibre should be to embed those jpg and pdf files within an html file. Then refer to the html file as the subject in my link.

(PS-- this is no knock on Calibre, it is a fantastic tool I am very grateful for.)
bdoors is offline   Reply With Quote
Old 11-20-2023, 03:54 PM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,433
Karma: 82723493
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Ebooks use HTML and CSS, but they don't support all the stuff that websites do.
Putting an HTML "wrapper" is best, but a PDF is a terrible thing to put in an ebook.
Quoth is offline   Reply With Quote
Old 11-21-2023, 12:48 PM   #5
bdoors
Junior Member
bdoors began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2023
Device: none
Thanks for the tip, Quoth. I looked at a few PDFs on my mobile and, like you said, they looked pretty bad. I tried on a bigger phone and got a decent result when turning the phone sideways, but you're right, PDFs seem to range from "a little awkward" to hardly readable.

So I converted my PDFs to html. Looks way better and fits Calibre, too.

I only had a few files, so I converted manually. (If I had more files, I might have tried out the free tool pdf2htmlEX at Github.)

Cheers.
bdoors is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove background images from pdfs? perhaps all images? MarjaE PDF 2 10-17-2018 04:30 PM
cover images for pdfs manicwhale Calibre 1 07-23-2011 01:42 AM
PDFs with images to mobi rcuadro Calibre 2 10-28-2009 12:39 PM
Converting PDFs to images (Linux only) kylecronan Kindle Developer's Corner 1 02-28-2009 03:37 PM
Converting PDFs to Images fargo iRex 9 05-02-2008 12:34 AM


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


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