Float causes text to overflow page

Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
Leighb
Posts: 4
Joined: Tue Apr 08, 2025 7:32 pm

Float causes text to overflow page

Post 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
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Float causes text to overflow page

Post 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
You do not have the required permissions to view the files attached to this post.
Leighb
Posts: 4
Joined: Tue Apr 08, 2025 7:32 pm

Re: Float causes text to overflow page

Post by Leighb »

Thanks Julien. We are using Dita. If I remove "float" from the css, the issue resolves. Please see the attached.
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Float causes text to overflow page

Post 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
Leighb
Posts: 4
Joined: Tue Apr 08, 2025 7:32 pm

Re: Float causes text to overflow page

Post 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
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Float causes text to overflow page

Post 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
Leighb
Posts: 4
Joined: Tue Apr 08, 2025 7:32 pm

Re: Float causes text to overflow page

Post by Leighb »

Thanks Julien. I will try to be patience while I wait for a float solution.
Leigh
Post Reply