How to prevent page breaks inside info macro when exporting to PDF?

Marshall Yam September 18, 2022

Info macro (for Notes, Warnings, Cautions, Tips, etc.) in Confluence Wiki is a built-in macro (not a user macro), so I don't know how/where I can modify its properties.

When exporting from Wiki to PDF, the info macro often breaks across two pages, which looks really bad.

Capture.PNG

How can I set the macro to not break across PDF pages?

In our PDF Stylesheet, we have the following CSS script:

/***** INFO BOXES *****/
div.dds-MessageBox { break-inside: avoid!important;}
{ background-color: #fcfcfc;
border: 1px solid #ccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
margin: 10px 0 1em 0;
min-height: 20px; /* CONFDEV-29900 needed to guarantee correct layout for empty macro in Macro Preview mode with no text entered */
/*margin-bottom: 1.5em;
margin-top: 0;*/
break-inside: avoid;
display: block !important;
}

div.dds-MessageBox.dds-has-no-icon
{ padding-left: 10pt;
background-image: none !important;
}

div.dds-MessageBox > div.ddsInfoMacroTitle
{ font-weight: bold;
padding-bottom: 0;
padding-left: 20pt;
border: none;
margin-top: 0;
font-size:14px!important; /* IPO */
}

div.dds-MessageBox-tip
{ background-color: #f3f9f4;
border-color: #91c89c;
padding: 1em 1em 1em 1em;
background-repeat: no-repeat !important;
background-position: 0.75em 1em;
background-image: url("/images/ddsimages/informationmacros/tip.png");
break-inside: avoid!important;
}

div.dds-MessageBox-warning
{ background: #fff8f7;
border-color: #d04437;
padding: 1em 1em 1em 1em;
background-repeat: no-repeat !important;
background-position: 0.75em 1em;
background-image: url("/images/ddsimages/informationmacros/warning.png");
break-inside: avoid!important;
}

div.dds-MessageBox-information
{ background-color: #fcfcfc;
border-color: #aab8c6;
padding: 1em 1em 1em 1em;
background-repeat: no-repeat !important;
background-position: 0.75em 1em;
background-image: url("/images/ddsimages/informationmacros/info.png");
break-inside: avoid!important;
}

div.dds-MessageBox-note
{ background-color: #fffdf6;
border-color: #ffeaae;
padding: 1em 1em 1em 1em;
background-repeat: no-repeat !important;
background-position: 0.75em 1em;
background-image: url("/images/ddsimages/informationmacros/note.png");
break-inside: avoid!important;
}
div.dds-MessageBox > .ddsInfoMacroBody { padding-left: 20pt; font-size: 13px;}
div.dds-MessageBox.dds-has-no-icon > div.ddsInfoMacroTitle { padding-left: 0 !important;}
div.dds-MessageBox.dds-has-no-icon > div.ddsInfoMacroBody { padding-left: 0 !important;}
div.dds-MessageBox > .ddsInfoMacroBody > p:empty { display:none; }

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events