cutting right edge of image in PDF output

Post here questions and problems related to editing and publishing DITA content.
msambasiva
Posts: 87
Joined: Tue Jul 17, 2018 6:57 am

cutting right edge of image in PDF output

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

Re: cutting right edge of image in PDF output

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
msambasiva
Posts: 87
Joined: Tue Jul 17, 2018 6:57 am

Re: cutting right edge of image in PDF output

Post 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
pdf-image-scaling-issue.png (68.42 KiB) Viewed 1056 times
Could you suggest any further clue?

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

Thanks,
Samba.
Attachments
image.png
image.png (60.13 KiB) Viewed 1056 times
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: cutting right edge of image in PDF output

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
msambasiva
Posts: 87
Joined: Tue Jul 17, 2018 6:57 am

Re: cutting right edge of image in PDF output

Post 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.
Post Reply