![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
format image to be full page (ignore margins - bleed?)
Newb here - sorry if in wrong place, asking wrong question.
Want to convert docx original for print and later ebook. Tried Calibre conversion docx>pdf and it seemed to work fine (though I have not submitted to any printers yet so maybe don't really know - but it looks ok to me). Issue is I have one 300dpi image with several lines of text in it that I want to be on one page and legible and maintain aspect ratio. Would like to do a 6x9 book and I think if i could get the image (and only the image) to "bleed' to [near] the edge of the page it would work. The image is currently jpg @ 1.67MB so not sure if I can attach it here. Can this be done in Calibre? Thanks for any help or suggestions on alternative approaches. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,253
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you are trying to generate a PDF for printing from a DOCX why not just print to a PDF file in Word? As for full page images, no you cant really guarantee that going from DOCX to PDF. Instead go to epub first and use the calibre edit book tool to make the images full screen, (this involves putting them in their own html file with zero page margins and using svg markup to make them fullscreen) and the convert that.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
Thank you for your reply and the information.
I converted the docx to ebub then opened edit book. There I found an individual html file that contained the image in question and no other text. I added style and svg markup as I got from researching examples. The result looked the same so I converted the jpp image to svg and swapped out the jpg file in images folder with the svg version. Still no change in appearance when viewing the updated epub file - the image still did not go the edge of the page but seemed constrained by the normal margins. I converted that updated epub to pdf - same result (which is as it should be I guess) Below is the html for the image epub file. Trying to get the image to go the edge (or very near the edge, i.e., maximum size viewable/printable) of page. Any and all help greatly appreciated. Sorry to have to ask, but if possible, please be specifics as I am too new to all this to easily understand & follow generalized direction. Thank you!! For reference, here is the epub code: <?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Unknown</title> <style type="text/css"> body { margin:0; padding:0; overflow:hidden } svg {viewBox="-10 -10 2250 3000"; position:fixed; top:0; bottom:0; left:0; right:0 } </style> </head> <body> <p><img src="images/Character_%26_Calling_-_portrait_4.svg" alt="Image"/> </p> </body></html> |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,253
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the insert image button in the calibre edit book tool. It has an option for inserting full page images. If you do that in an HTML file with margins and padding set to zero via @page and body selectors you should be fine.
|
![]() |
![]() |
![]() |
#5 |
Book E d i t o r
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Try the following in the HTML file for the image:
<body class="cover"> <p class="image1"> <img src="images/Character_%26_Calling_-_portrait_4.jpg" alt="Image" class="image" /> </p> Copy and paste the following into the CSS file: .cover { display: block; text-align: center; margin: 0 0; } .image { height: 100%; width: 100%; } .image1 { display: block; text-align: center; margin: 0 0; } Be sure the image filename has a proper image extension. I don't use SVG, so I'm not sure if *.svg will work or not. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
kovidgoyal - Thank you for your answer! I tried to do the insert image, with full screen & aspect ratio checked and with body and @page margins set to zero.
When I then open the epub file in calibre the image still looks the same - it does not go to the edge of the reader panel as I expected. And likewise, does not convert to a pdf with full page image. Sorry, I am obviously missing something here. Here is my updated epub html file for reference: <?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Unknown</title> <style type="text/css"> body { margin:0; padding:0; overflow:hidden } @page { margin-bottom: 0pt; margin-top: 0pt margin-left: 0pt; margin-right: 0pt } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link href="stylesheet.css" rel="stylesheet" type="text/css"/> <link href="page_styles.css" rel="stylesheet" type="text/css"/> </head> <body class="calibre"> <div style="page-break-before:always; page-break-after:always; page-break-inside:avoid"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 889 1186" preserveAspectRatio="xMidYMid meet"><image width="889" height="1186" xlink:href="images/CC3.jpeg"/></svg></div> </body></html> |
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
deback - Thank you so much for reaching out with an answer. I tried to copy and apply your suggestion. I got no errors, but, alas, it did not change the view of the in the calibre epub reader - the image still does not go to the edges.
I really appreciate the help but I am obviously not understanding something here. I went back to jpg file and renamed it to simpler name. Here is the epub html file I created from your suggestion. <?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Unknown</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link href="stylesheet.css" rel="stylesheet" type="text/css"/> <link href="page_styles.css" rel="stylesheet" type="text/css"/> <style type="text/css"> <body class="cover"> @page { margin-bottom: 0pt; margin-left: 0px; margin-right: 0px; margin-top: 0pt; padding: 0px } </style> </head> <body> <p class="image1"> <img src="images/CC3.jpeg" alt="Image" class="image" /> </p> </body></html> and code appended to top of stylesheet.css: .cover { display: block; text-align: center; margin: 0 0; } .image { height: 100%; width: 100%; } .image1 { display: block; text-align: center; margin: 0 0; } |
![]() |
![]() |
![]() |
#8 |
Book E d i t o r
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
Move the line <body class="cover"> to where you have <body> and delete the line <body>, which is a duplicate <body> and overrides the first <body class="cover"> line.
Here is the revised code: <?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Unknown</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link href="stylesheet.css" rel="stylesheet" type="text/css"/> <link href="page_styles.css" rel="stylesheet" type="text/css"/> <style type="text/css"> @page { margin-bottom: 0pt; margin-left: 0px; margin-right: 0px; margin-top: 0pt; padding: 0px } </style> </head> <body class="cover"> <p class="image1"> <img src="images/CC3.jpeg" alt="Image" class="image" /> </p> </body></html> |
![]() |
![]() |
![]() |
#9 |
Book E d i t o r
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
I would also remove the following lines, since you have a page_styles.css file that should have similar lines.
@page { margin-bottom: 0pt; margin-left: 0px; margin-right: 0px; margin-top: 0pt; padding: 0px } </style> |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
deback - Thank you for taking the time to help!!
Replaced the code with your revised version and also removed the @page lines and adjusted the page_styles.css to have zero values for all margins. When saved and opened in the file in the calibre epub reader the image still does not go the edges. Perhaps it is not supposed to, but seems odd that one cannot make that happen - or else there is something else controlling. My goal is to have the image be full page in a pdf for 6x9 print and was advised to go from docx to epub first to be able to adjust these margins in the html then go to pdf. But it still looks the same. I really do appreciate the help very much. But I am beginning to think either I am just not understanding how this does/should work or I need a new approach. Just so you will see the calibre epub reader image I see I'm attaching an image. I thought the image would fill all available space with no margin. Sorry to be so much trouble - thanks again for your help!! |
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
Well, attempting to insert the image did not seem to work - if interested, here is a try with direct link
https://drive.google.com/file/d/10G_...ew?usp=sharing |
![]() |
![]() |
![]() |
#12 |
Book E d i t o r
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
The image looks fine to me. Without seeing your actual epub file, I don't know what could be wrong. The codes I gave you would work fine in Adobe Digital Editions. That software has no user settings, so it uses all the settings from the epub's CSS file. I don't use Calibre's ePub viewer, so I'm not sure if it has settings you can change or not, but I think it does, so you might want to check your settings in the viewer.
|
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Oct 2020
Device: none
|
deback - Much thanks for all your help. I think you are right, it is the reader that enforces the appearance of margins. There is user control to allow adjustments, though not all the way to the edge. I am going to rethink this a bit. Thanks again, very kind of you to spend so much time to offer help.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Erratic full page image conversion | psychovertical | ePub | 3 | 10-15-2018 07:39 PM |
How to make pages with full bleed / full page images | mypointofview | Editor | 5 | 06-21-2016 05:45 PM |
recipe to ignore image size constraint on web page | rutmang | Recipes | 4 | 07-31-2014 04:52 PM |
Full page Image | Nakaleen | ePub | 1 | 01-20-2011 01:44 PM |
Next Firmware Update - Page margins and full justification | JBlyth | Kobo Reader | 32 | 07-11-2010 11:13 PM |