Jump to content

Scaling anchored resources

Recommended Posts

I have a job where I need to have a logo that is inline with some text. In the past I have simply put a rule to return the graphic inside the text box so that it flows with the text.

However for this one the user is uploading their logo so I would need to resize it proportionally to be no larger that a certain size.



Anyone know how this might be accomplished?




Jake Merrick

Link to comment
Share on other sites

So an inline graphic is just a <graphic> tag, with either a "file" or "resource" attribute, something like <graphic file="mylogo.tif">. If you look in the FusionPro Tags Reference, in the section titled "Graphic Tag Inside Story Tag / Inline Graphics", you will see that the <graphic> tag can also take width and height attributes, in hundredths of points. If you specify one of those attributes, the graphic will be proportionally to be the specified width or height. If you specify both, the graphic will be stretched to the specified width and height.


So if you want to make sure your inline graphic is, say, always one inch tall, you would just add the attribute height=7200 to the tag, such as <graphic file="mylogo.tif" height="7200">. That will make it always be exactly that height.


If you want to enforce a maximum height, rather than every graphic being the same height, that's a bit trickier. You'll have to do something similar to the logic in this post to measure the width and height of the graphic, then you can determine whether it's already small enough to fit within your maximum, in which case you can just put out the <graphic> tag with no extra width or height attributes, or whether it exceeds your maximum, in which case you can put out the <graphic> tag with a width or height attribute to specify the size you want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...