XML Elves

XML Elves

<community>of XML and SVG Developers</community>


Problem with nested transformations

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


Go Back   XML Elves > SVG Forums > SVG Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-07-2008, 02:07 AM
Junior Member
 
Join Date: Oct 2008
Location: Uden, Netherlands
Posts: 2
Default Problem with nested transformations

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:
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>
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:
Code:
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-10-2008, 07:32 AM
Administrator
 
Join Date: Mar 2008
Posts: 24
Default

hmm, not sure. What is your environment? - Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-10-2008, 08:36 AM
Junior Member
 
Join Date: Oct 2008
Location: Uden, Netherlands
Posts: 2
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-18-2008, 01:13 PM
Administrator
 
Join Date: Mar 2008
Posts: 24
Default

Cool, thanks for the follow up - Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
nested, problem, transformations


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -6. The time now is 01:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.0 RC3

Data Recovery Specialist
Get your lost data recovered, and save time! Bring your hard disk to us, Data Clinic. Click here for more!


1 2 3 4 5 6 7 8 9 10 11 12 13 14