<community>of XML and SVG Developers</community>
This is a discussion on Problem with nested transformations within the SVG Questions forums, part of the SVG Forums category; Hi, I am creating a pdf document from xml and xslt. The target document also contains some svg graphics. The ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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: Code: <!-- 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>
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: Code: translate(51, 114).scale(1,25).rotate(-90) Thanks in advance, Miepmuts |
| |||
|
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. |
![]() |
| Tags |
| nested, problem, transformations |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Data Recovery Specialist
Get your lost data recovered, and save time! Bring your hard disk to us, Data Clinic. Click here for more!