How to place two copies of the same image in a template

252 views
Skip to first unread message

Richard Huntley

unread,
Jul 6, 2011, 3:15:12 AM7/6/11
to jodreports-users
It seems like this could be a common question but I have searched the
forum as well as the test cases without success.

I am trying to create a template that uses the same image in two
different locations. Once in the document header and once on the title
page.

I can name one of the images using the standard "jooscript.name(logo)"
but when I try to name the second image the same name Open Office
changes it to a generic "graphic7" name. Obviously two graphics can't
have the same name in an Open Office doc.

Is there a standard workaround to this issue, ie a script to place in
front of the graphic or some way of modifying the image name that
tricks Open Office but has no impact on the jooscript processing.

Richard Huntley

unread,
Jul 6, 2011, 9:11:00 PM7/6/11
to jodreports-users
After going through the source code and looking at how script comments
are handled I have discovered that I can use:
jooscript.image(logo[#--1--])
and
jooscript.image(logo[#--2--])

to differentiate the copies of the image within the Open Office
template and both get replaced with the same image.

I'm still looking for confirmation that this is the best/standard way
to use the same dynamic image two or more times in the same document.

Terry

unread,
Jul 9, 2011, 1:54:00 AM7/9/11
to jodrepor...@googlegroups.com
Due to the Open Office won't allow images with the same name, you can use this cheat:

the first one use the following as name:
jooscript.image(logo[#--1--]) 

the second one use (extra space appended on the end):
jooscript.image(logo[#--1--] ) 

Reply all
Reply to author
Forward
0 new messages