Page 1 of 1

cutting right edge of image in PDF output

Posted: Fri Oct 16, 2020 9:38 am
by msambasiva
Hi
DITA-OT 2.4.6

Some how, few images are cutting right edge in the PDF output .
Tried to set the attribtes as below. But nothing helped me on this issue. Could you suggest any clue?
dita-ot-2.4.6\plugins\my.dita.pdf\cfg\fo\attrs\commons-attr.xsl

Thanks,
Samba.

Code: Select all

	<xsl:attribute-set name="image__block">
      <xsl:attribute name="padding-bottom">20pt</xsl:attribute>
      <xsl:attribute name="padding-top">10pt</xsl:attribute>
      <xsl:attribute name="start-indent">inherit</xsl:attribute>
	  <!-- samba added to fix the image too big in PDF guide -->
      <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
      <xsl:attribute name="content-height">100%</xsl:attribute>
      <xsl:attribute name="width">100%</xsl:attribute>
      <xsl:attribute name="scaling">uniform</xsl:attribute>
    </xsl:attribute-set>

    <xsl:attribute-set name="image__inline">
	   <xsl:attribute name="vertical-align">middle</xsl:attribute>
	  <!-- samba added to fix the image too big in PDF guide -->
      <xsl:attribute name="content-width">auto</xsl:attribute>
      <xsl:attribute name="content-height">auto</xsl:attribute>
      <xsl:attribute name="width">auto</xsl:attribute>
      <xsl:attribute name="scaling">uniform</xsl:attribute>
    </xsl:attribute-set>

Re: cutting right edge of image in PDF output

Posted: Fri Oct 16, 2020 12:08 pm
by Radu
Hi Samba,

If you set in the transformation scenario the "clean.temp" parameter to "yes", then publish, in the transformation temporary files folder you should find the "topic.fo" XSL-FO file from which the PDF was created. If you open it in Oxygen and look at the image reference, does it contain the changes you made in the customization XSLTs?

Regards,
Radu

Re: cutting right edge of image in PDF output

Posted: Fri Oct 16, 2020 12:45 pm
by msambasiva
Thanks Radu for dubbing steps.

Looks the attribute changes (width=auto & width=100 under image__inline)are taking place in topic.fo. It's throwing error saying that content-width, content-height and scaling are not allowed as shown in the attached screenshot.
width=auto :
<fo:inline content-height="auto" content-width="auto" scaling="uniform" vertical-align="middle" width="auto">
<fo:external-graphic src="url('file:/C:/dita-ot-2.4.6/sdl-content/out2/images/GUID-8D654C41-960B-4896-9AFC-2620067BC08B-default.png')"/>
</fo:inline>

width=100 :
<fo:inline content-height="auto" content-width="auto" scaling="uniform" vertical-align="middle" width="100">
<fo:external-graphic src="url('file:/C:/dita-ot-2.4.6/sdl-content/out2/images/GUID-8D654C41-960B-4896-9AFC-2620067BC08B-default.png')"/>
</fo:inline>
pdf-image-scaling-issue.png
Could you suggest any further clue?

Please suggest how to debug the attribute changes under image__block set.

Thanks,
Samba.

Re: cutting right edge of image in PDF output

Posted: Fri Oct 16, 2020 12:49 pm
by Radu
Hi,

I think you should try to place the attributes directly on the fo:external-graphic element:

https://stackoverflow.com/questions/622 ... age-in-fop

Regards,
Radu

Re: cutting right edge of image in PDF output

Posted: Fri Oct 16, 2020 2:18 pm
by msambasiva
Yes.It's working by setting directly on the fo:external-graphic element as you suggested.
<xsl:otherwise>
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
<xsl:attribute name="content-height">100%</xsl:attribute>
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="scaling">uniform</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</fo:external-graphic>

Thanks a lot.
Samba.