Images going out of the page in PDF output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Nettem
Jr. Propeller Head
Posts: 5
Joined: Tue Dec 25, 2018 11:05 pm

Images going out of the page in PDF output

Post by Nettem »

We have used CHM output and HTML output till now. But now there is requirement for PDF output. The images are now being restricted by the size of PDF output like A4 size. Some parts of the images are going out of the page. But i don't want to resize the images individually, because we have a lot of linked files and the the total documentation is around 2000 pages. So is there any option so that the image gets resized automatically like "fit to width" or "fit to length" or "fit to page" for PDF output.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Images going out of the page in PDF output

Post by Nita Beck »

Two things come to mind:

-- So you are not setting explicit sizes on the images? If you have, those sizes are being set by inline formatting and making a stylesheet change isn't going to help.
-- Assuming you are not setting explicit sizes, you can make a stylesheet change in the medium you use for PDF output. For the base img class, set its max-width to 100%. That way, no image in PDF will exceed the width of its container.

HTH
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Nettem
Jr. Propeller Head
Posts: 5
Joined: Tue Dec 25, 2018 11:05 pm

Re: Images going out of the page in PDF output

Post by Nettem »

The CHM and HTML are created by some other person.
There was actually no image style created in the style sheet before.
I think all the images were just inserted and were not resized, because all the image properties are set to default.
I have tried the second way mentioned by you, I made a style sheet change and the output did not change because the images had no "style class" selected earlier. So, i changed the style class of few images which were running out of the page to new style class created. Now they are inside the page.
So this solves one of my problem, But still i need to do it for all the images individually, which is very much time consuming.
Nettem
Jr. Propeller Head
Posts: 5
Joined: Tue Dec 25, 2018 11:05 pm

Re: Images going out of the page in PDF output

Post by Nettem »

I figured out the way to do it.
From the image in the stylesheet, i selected max height and max width, and set them to 100.
But i also got an another problem here, the aspect ratio seems to change, this is probably because the flare compares the size of the image and the size of the page and if the any dimension of the image exceeds the size of the page then it resizes the image to fit inside the page in that particular direction.
It doesn't seem to care about the aspect ratio and resize the image the whole image. This makes some content to look very odd in PDF Format.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Images going out of the page in PDF output

Post by NorthEast »

Don't set both max-width and max-height; just set one, e.g. max-width if most of the images are landscape, or max-height if most are portrait.
Nettem
Jr. Propeller Head
Posts: 5
Joined: Tue Dec 25, 2018 11:05 pm

Re: Images going out of the page in PDF output

Post by Nettem »

It is not possible to use this method because as we also got some images which are in portrait as some of them needs to be resized. But most of them are in Landscape, so it will help for a few of them but will not be useful for all of them. Thank you for the partial solution.
So one way of doing it is to set two different image classes as Landscape and Portraits and use max height and max width appropriately.

So is there any otherway of doing it, than changing the whole image classes and selecting the stuff.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Images going out of the page in PDF output

Post by ChoccieMuffin »

If MOST of your images are landscape, then set max-width: 100% on the base img style. You can then add an extra style class, for example img.portrait, and set max-height: 100% and max-width: auto, then apply that img style class ONLY to images that don't fit. Or if most of your images are portrait, do it the other way round.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Post Reply