cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Scale Down Oversized Graphics using ArborText Styler in XSL Print

JamesCLS
6-Contributor

Scale Down Oversized Graphics using ArborText Styler in XSL Print

How do I use Styler to force oversized graphics to fit within the width and/or height of a page? 

I cannot edit the graphic or have the authors/illustrators resize the graphic files.

I am using the XSL Print mode and understand that it is no longer supported.  

I cannot use the APP Print mode because I've already made custom XSL changes and do not have time to learn how to make custom changes with the APP. 

I am using ArborText Editor with Styler Release 7.1.

 

I have already tried the following XSL, but it has no effect:

 

 

<xsl:attribute name="width">8in</xsl:attribute>
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
<xsl:attribute name="scaling">uniform</xsl:attribute>

 

 

 

I can force graphics to a particular size with the following, but it blows up small graphics:

 

 

 

<xsl:attribute name="width">8in</xsl:attribute>
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
<xsl:attribute name="scaling">uniform</xsl:attribute>

 

 

 

 

 

Thanks,

-James

5 REPLIES 5

I'm not familiar with the XSL publishing, do you mean the XSL-FO publishing feature that was grandfathered about 10 years ago? Both underlying print engines (FOSI and APP) support the feature you need, so there is hope 🙂

JamesCLS
6-Contributor
(To:GarethOakes)

Yes, XSL-FO. I apologize for the confusion.

Here are some tips then:

1. How it should work in XSL-FO: https://stackoverflow.com/questions/6220316/scale-down-to-fit-an-image-in-fop

2. What the underlying FOSI <putgraph> supports: http://support.ptc.com/cs/help/arbortext_hc/ae61_hc/index.jspx?id=help357&action=show

Between those two things you should be able to figure this out. First try the out-of-the-box XSL-FO method and if it isn't working, have a look in the ACL code that does the FOSI transformation to find where the <putgraph> is being generated and if it supports the scaling features you require.

JamesCLS
6-Contributor
(To:GarethOakes)

Thanks for your replay Gareth!

 

Unfortunately, the XSL-FO solution does not work.  I did originally use the "scale-down-to-fit" value as I had use that previously with the Apache FOP. However, it had no effect.

 

And while I am not experienced with FOSI, based on the documentation that you provided, it does seem that FOSI does not support a "scale-down-to-fit" for individual graphics. Perhaps this is why the XSL-FO solution does not work? Because ArborText never needed to support it for FOSI?

 

I'm also not seeing how this could be done with APP.

scale-to-fit (scalefit)
Scale to fit stretches or shrinks the graphic to fit within the width and depth you provide. The width and depth cannot both equal zero whereas hscale and vscale must both equal zero.
Enter no to turn scalefit off or yes to turn it on (you must enter both width and depth).
---
This is a supported characteristic for a FOSI putgraph. You would have to identify which graphics need to be downsized to the page width/height and also perform the relevant calculations to ensure the original image aspect ratio is retained as you need to set the width/height for each image. Therefore it is not just a setting you turn on, but is an underlying function you can use in combination with some higher level logic (e.g. ACL scripting) to implement your desired capability. The scripting could run before publishing or even during publishing (there is a way to have a FOSI call out to an ACL script during publishing).
---
In APP you have even more flexibility in scripting this capability but APP is not really an option if you are sticking with the Arbortext XSL-FO renderer.
---
To be honest, the XSL-FO renderer was abandoned by PTC long ago. If you need to publish using XSL-FO you may be better exploring alternative rendering software - however you will probably need to adjust your XSLT code to suit the new software. The best long-term approach may be to explore the use of Arbortext Styler or the development of custom APP print templates.
Top Tags