New Forum | Previous | Next | (P-PDF) Developers
Topic: transformation matrix
Conf: (P-PDF) Developers, Msg: 69953
Date: 8/6/2002 06:15 PM
Hi.. At this moment i am working in a Clipping PDF project.. It's working almost fine. But i have some small problems with transformation matrix.
Ok, i am using Windows 2000, Acrobat Plugin SDK and so.
I have one pdf file. Then, from another component i receive coordinates to clip. Then, i use this information to clip the coordinates from my original pdf file, get the content inside of this coordinates and create a new pdf with this content and scaling all the elements with the scale factor specified. it sounds nice and is working almost fine. But, to scale and move the content (element by element) i use the transformation matrix, but how can i exactly specified translation matrix and scale matrix keeping the rotation matrix of the original element. In my code you can see how i am moving and scaling the element (just for image as example)
translationMatrix.a = fixedOne; // x scale = 1
translationMatrix.b = fixedZero;// no rotate & skew
translationMatrix.c = fixedZero;// no rotate & skew
translationMatrix.d = fixedOne;// y scale = 1
translationMatrix.h = FloatToFixed(xPos);
translationMatrix.v = FloatToFixed(yPos);
scaleMatrix.a = newWidth;// x scale = 1
scaleMatrix.b = fixedZero;// no rotate & skew
scaleMatrix.c = fixedZero;// no rotate & skew
scaleMatrix.d = newHeight; // y scale = 1
scaleMatrix.h = fixedZero;// x translation
scaleMatrix.v = fixedZero;// y translation
It's according to specification, but using this code i am losing the rotation of the image (when the image is rotated).
Thanks very much.