Problem with nested transformations [Archive] - XML Elves

Problem with nested transformations

miepmuts
10-07-2008, 02:07 AM
Hi,

I am creating a pdf document from xml and xslt. The target document also contains some svg graphics.
The data from the xml is used to create the correct svg image.
I have my complete picture, but now I want to add another feature.
I want to use an image on the harddisk and place it inside my svg image.

That image has the correct sizes to fit into a rectangle I draw right
after placing the image.
That image is rotated 90 degrees, so I have to rotate it back. Because of
the rotation, I have to scale the image back to it's original size. This
all works fine, I have a rotated image at the right size. Now I want to
place the image into my rectangle. When I try to place the image at the
correct place (as I think it should be) it doesn't place the image at the
correct position (it is placed somewhat higher and more to the left as I
expect it to be).

Here's the piece of code for the image:

<!-- Draw the tiff image -->
<svg:g transform="translate({$svg_image_width_first},
{$svg_image_height_first})">
<svg:g transform="rotate({$tiff_rotation}, {$tiff_width_middle},
{$tiff_height_middle})">
<svg:g transform="scale({$scale})">
<svg:image xlink:href="{$xml_bitmap_path}"
width="{$svg_image_width}"
height="{$svg_image_height}">
<svg:title>Front Image</svg:title>
</svg:image>
</svg:g>
</svg:g>
</svg:g>


I think it has something to do with the changed coordinate systems due to
the rotation and scaling. I can place the image manually with some values (which make no real sense to me) to the right position, but I like to have a generic solution, because not all the documents I generate have the same measurements and sizes.

A more concrete example I use right now is:

translate(51, 114).scale(1,25).rotate(-90)


Is there a generic solution, which I can use to generate all documents correct?

Thanks in advance,

Miepmuts

XMLAdmin
10-10-2008, 07:32 AM
hmm, not sure. What is your environment? - Eric

miepmuts
10-10-2008, 08:36 AM
Today I solved my problem.
If I exchanged the height and width values on the image, the scaling was not necessary anymore, with that I just needed a correction on the position of the image to let it appear in the right place.

It was really simple after I heard that the scaling wasn't necessary.

XMLAdmin
10-18-2008, 01:13 PM
Cool, thanks for the follow up - Eric

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum