Page 1 of 1
Float causes text to overflow page
Posted: Tue Apr 08, 2025 7:50 pm
by Leighb
I am using Oxygen 25.0 but I need to float some images in a pdf. I just installed a trial of Chemistry 27.1 to use the float feature (my understanding is that I needed at least Chemistry 26.1 to be able to use the float feature for a pdf). The float feature works brilliantly in the pdf but now the text rolls off the bottom of the page on every page where I have specified a float image. How do I get the page break to break at that normal margin at the bottom? Here is my css:
Code: Select all
img[src *="images/case"] {
float: right;
display: block;
width: 200px;
padding: 0px 0px 15px 15px;
}
Thanks,
Leigh
Re: Float causes text to overflow page
Posted: Wed Apr 09, 2025 9:12 am
by julien_lacour
Hello Leigh,
If you remove this rule from the CSS does the overflow persist?
I did a small sample but cannot reproduce the issue:
float.zip
Could you indicate if you are using XML, HTML, DITA or any other XML-type based document?
Regards,
Julien
Re: Float causes text to overflow page
Posted: Wed Apr 09, 2025 9:42 pm
by Leighb
Thanks Julien. We are using Dita. If I remove "float" from the css, the issue resolves. Please see the attached.
Re: Float causes text to overflow page
Posted: Thu Apr 10, 2025 10:42 am
by julien_lacour
Hello,
I reproduced the issue and added it into our bug tracking system.
I will notify this thread when a fix will be available. Thank you for the files.
As a workaround you can
place the text and the image side by side.
Regards,
Julien
Re: Float causes text to overflow page
Posted: Wed Apr 16, 2025 6:01 pm
by Leighb
Thanks Julien. This solution works in a few cases but not when the image size varies or the length of the side by side paragraph varies. If the paragraph is shorter than the image, there is a gap. If the image is longer than the paragraph, there is a gap and if the image is wider, the image won't fit so it bumps down. Is there another way to wrap the text around the image even when the image and paragraph size vary? We have a number of these images so I am trying to come up with a solution that will work for all.
Thanks,
Leigh
2025-04-16_9-35-00.png
Re: Float causes text to overflow page
Posted: Thu Apr 17, 2025 11:10 am
by julien_lacour
Hello,
Using the side-by-side view, you can't correct the text longer/shorter than the image (except if you split the text/add the following text in the div container - so it has the same length as the image).
For wider images, you should be able to correct the display by setting max-width on the image so it can't overflow its inline-block.
Regards,
Julien
Re: Float causes text to overflow page
Posted: Thu Apr 17, 2025 7:56 pm
by Leighb
Thanks Julien. I will try to be patience while I wait for a float solution.
Leigh