Page 1 of 1

How to avoid PDF page break when inserting images into ol/ul lists?

Posted: Thu Nov 14, 2024 9:14 am
by youny
When I add images, notes or other elements in the unordered or ordered list, and apply to DITA Map PDF-based on HTML5&CSS, the PDF will break the page even there is much space like this:
Image
However, when I add a outputclass parameter to avoid this ordered list to break the page like this:
<ol id="ol_icl_5bh_fdc" outputclass="page-break-avoid">

The PDF output result will show some contents hidden.
Image
Even I added page-break-avoid parameter to image element in my css file, this still does not solve the problem.
There are much cases like this, may I know if any parameter can reduce the space when output as PDF?

Re: How to avoid PDF page break when inserting images into ol/ul lists?

Posted: Thu Nov 14, 2024 12:05 pm
by julien_lacour
Hello,

Using <oXygen/> XML Editor 26.1, build 2024091606 and the following sample:

Code: Select all

<topic id="topic">
    <title>Topic</title>
    <body>
        <ol id="ol_icl_5bh_fdc" outputclass="page-break-avoid">
            <li>Turn on the device.<image placement="break" href="images/start.png" id="image_wth_2xm_jdc"/></li>
        </ol>
    </body>
</topic>
I did get the correct output:
image.png
Could you indicate which version of Oxygen you are using?
Have you tried to run the default DITA Map PDF - based on HTML5 & CSS scenario? Did the problem occur?

Regards,
Julien

Re: How to avoid PDF page break when inserting images into ol/ul lists?

Posted: Thu Nov 14, 2024 1:00 pm
by youny
julien_lacour wrote: Thu Nov 14, 2024 12:05 pm Hello,

Using <oXygen/> XML Editor 26.1, build 2024091606 and the following sample:

Code: Select all

<topic id="topic">
    <title>Topic</title>
    <body>
        <ol id="ol_icl_5bh_fdc" outputclass="page-break-avoid">
            <li>Turn on the device.<image placement="break" href="images/start.png" id="image_wth_2xm_jdc"/></li>
        </ol>
    </body>
</topic>
I did get the correct output:
image.png
Could you indicate which version of Oxygen you are using?
Have you tried to run the default DITA Map PDF - based on HTML5 & CSS scenario? Did the problem occur?

Regards,
Julien
Sorry for my not clarify my problem. Yes after adding the page-break-avoid statement, the picture will not break but it cause the new problem that the pictures will not display normally when the size is over the page. It looks like there is not any limit or configuration to recognize the page edge to generate the page break intelligently.
Image

Re: How to avoid PDF page break when inserting images into ol/ul lists?

Posted: Thu Nov 21, 2024 1:22 pm
by julien_lacour
Hello,

This is normal as you have added the outputclass="page-break-avoid" on the list, as explained in our user-guide:
page-break-avoid
Use this to avoid page breaks inside the marked element.
If you remove this outputclass, the image will be displayed on the following page.

Regards,
Julien