PDF: Inline images centered

Post here questions and problems related to editing and publishing DITA content.
Anonymous1

PDF: Inline images centered

Post by Anonymous1 »

Hello,

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?

Thanks,
Benjamin
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: PDF: Inline images centered

Post by Costin »

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']{
vertical-align:sub;
}
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

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Anonymous1

Re: PDF: Inline images centered

Post by Anonymous1 »

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?
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF: Inline images centered

Post by Radu »

Hi Benjamin,

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

https://www.w3.org/TR/xsl11/#baseline-shift

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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply