PDF: Inline images centered

Posts: 137
Joined: Thu Mar 24, 2016 5:54 pm

PDF: Inline images centered

Post by B-E-N » Wed Aug 15, 2018 5:50 pm


we are using a lot of inline images in our documentations. We use mostly small icons but space is often an issue. Some icons can only be reduced in size to a certain extend until too many information would be lost. That's why we would like to use all the space we have for displaying inline images.

But there is a problem in the PDF output. Inline images are placed on the base line. This way we lose almost some space that would be available. We would prefer to have inline images use the full text height.

See wikipedia to understand what I mean: https://en.wikipedia.org/wiki/Ascender_(typography)

We want the inline image to go from the descent to the ascent. At the moment it goes from the base line to the ascent.

In WebHelp Responsive, everything works as intended. Is there a way to make the PDF output of inline images look like the WebHelp output?


Posts: 711
Joined: Mon Dec 05, 2011 6:04 pm

Re: PDF: Inline images centered

Post by Costin » Thu Aug 16, 2018 10:27 am

Hi B-E-N,

Indeed, there seems to be a discrepancy between the WebHelp output and PDF output.
I logged this in our internal issues tracking system to investigate and see if there is something we could do on our side to improve this.

Meanwhile, as a workaround you could use the "vertical-align: sub;" property in your customization CSS.

Code: Select all

*[class ~= "topic/image"][placement='inline']{
Whenever you need to style elements to look in the PDF as in HTML / WebHelp, you could just identify the specific element's selector, using the CSS inspector of your internet browser. Please see:
https://www.oxygenxml.com/doc/versions/ ... =debugging

Costin Sandoi
oXygen XML Editor and Author Support

Posts: 137
Joined: Thu Mar 24, 2016 5:54 pm

Re: PDF: Inline images centered

Post by B-E-N » Thu Aug 16, 2018 10:53 am

Thank you for investigating this.

Regarding your workaround I should have given more information. We use a custom framework with Oxygen 19 (soon 20.1) and use Apache FOP as our formatter. This is why we cannot use a custom CSS at the moment.

Is there a workaround for FOP?

Posts: 7145
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF: Inline images centered

Post by Radu » Mon Aug 20, 2018 10:53 am

Hi Benjamin,

There is a baseline-shift attribute which seems to be available for the "fo:external-graphic" XSL-FO element:


so maybe you could experiment with that, I do not know if the Apache FOP processor has support for it or not.
Maybe you can also register and ask around on the DITA Users List (Yahoo Group), they may have a better suggestion than mine.

Radu Coravu
<oXygen/> XML Editor

Post Reply