Jump to content

Changing size of inline graphic


AndyB

Recommended Posts

Hello,

I have a rule that selects a graphic resource depending on the name in the field. And this rule is placed into a formatted text resource as an "inline graphic". This works fine but the graphic ends up being too small. Is there any way to change the size of the inline graphic? It's basically a variable signature that is at the end of a variable letter. It needs to be an inline graphic as not all the letters have the same length and the signature needs to move up and down accordingly. Below I have included the rule javascript.

switch (Field("sender").toLowerCase())
{
    case "Aneesa Din".toLowerCase():
        return Resource("Aneesa Din");
    case "Barbara Merz".toLowerCase():
        return Resource("Barbara Merz");
    case "Frances Cifrino".toLowerCase():
        return Resource("Fran Cifrino");
    case "Jeremiah Haruna".toLowerCase():
        return Resource("Jerry Haruna");
    case "Lois Quam".toLowerCase():
        return Resource("Lois Quan");
    default:
        return NullResource();
}

Link to comment
Share on other sites

Wrap that code in a function and set the height and/or width property of the returned resource object, like so:

function SenderResource()
{
  switch (Field("sender").toLowerCase())
  {
    case "Aneesa Din".toLowerCase():
        return Resource("Aneesa Din");
    case "Barbara Merz".toLowerCase():
        return Resource("Barbara Merz");
    case "Frances Cifrino".toLowerCase():
        return Resource("Fran Cifrino");
    case "Jeremiah Haruna".toLowerCase():
        return Resource("Jerry Haruna");
    case "Lois Quam".toLowerCase():
        return Resource("Lois Quan");
    default:
        return NullResource();
  }
}

var r = SenderResource();
r.height = HundredthsOfPointsFromText("0.5 in");
return r;

 

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.

Guest
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...