Yes, you are correct, Mark.

 
a b 0

c d 0

e f 1

 
a and d are scale parameters, b and d are for shear/skew, and e and f are 
translation.

 
This is why you see scale, shear, shear, scale, translate, translate in the 
method sig.

 
John

-----Original message-----
From: Mark Gargan
Sent: Thursday, December 6 2018, 9:34 am
To: users@pdfbox.apache.org
Subject: RE: AffineTransform
 
And apologies Tilman,
I'm using PDFBox 2.0.3 and the question about the AffineTransformation was 
asked the wrong way, it was more a question as to why the signature would be 
that way as it doesn't make intuitive sense to me. Perhaps it's something to do 
with the structure of the 3x3 matrix?? 

Thanks,
Mark.

-----Original Message-----
From: Tilman Hausherr [mailto:thaush...@t-online.de 
<mailto:thaush...@t-online.de> ] 
Sent: 06 December 2018 17:15
To: users@pdfbox.apache.org <mailto:users@pdfbox.apache.org> 
Subject: Re: AffineTransform

Hi,

You didn't upload the PDF, attachments don't go through.

Please mention what PDFBox version you are using (hopefully 2.0.13) and include 
your code. I assume you want to draw an image. If you would use

2480 0 0 3508 0 0

Then the image would appear at the original size. So 700 0 0 700 x y will have 
a weird effect.

The coordinates start at the bottom left.

"it's quite unintuitive to place two shearing factors between two scaling" 
complain to the designers of the java language :-) Tilman

Am 06.12.2018 um 17:55 schrieb Mark Gargan:
> Hi folks,
>
>              I'm trying to work with the Affine transform to superimpose a 
> snapshot of an A4 document into an SRA3 document which has crop lines.
>
> The SRA3 template size is or  (8.86in x 12.6in) in inches. The original A4 
> document I'm taking the snapshot of is typical A4 ( 8.27in × 11.69in).
>
> I've taken a snapshot of the first page of the A4 original document and it 
> produces an image in typical A4 size 2480 X 3508 pixels.
>
> I'm trying to figure out the AffineTransform that will place the A4 snapshot 
> into the centre of the SRA3 document and within the croplines.
>
> So far I have
>
> AffineTransform at = new AffineTransform(700, 0, 0, 700, 100, 200);
>
> with the Affine constructor as follows
>
>
> *
> * @param m00 the X coordinate scaling element of the 3x3 matrix
> * @param m10 the Y coordinate shearing element of the 3x3 matrix
> * @param m01 the X coordinate shearing element of the 3x3 matrix
> * @param m11 the Y coordinate scaling element of the 3x3 matrix
> * @param m02 the X coordinate translation element of the 3x3 matrix
> * @param m12 the Y coordinate translation element of the 3x3 matrix
> * @since 1.2
> */
> @ConstructorProperties({ "scaleX", "shearY", "shearX", "scaleY", 
> "translateX", "translateY" }) public AffineTransform(float m00, float m10,
>                         float m01, float m11,
>                         float m02, float m12) {
>
> I.e. x-scaling, y-shearing, x-shearing, y-scaling, x-translation, 
> y-translation
>
> I guess the questions are
>
>
>    1.  Why the signature was presented like this, it's quite unintuitive to 
> place two shearing factors between two scaling.
>    2.  Also I can't understand why the x & y scaling factors need to be in 
> the hundreds. i.e. 700 and 700
>    3.  The translation factors, are they taken from the top right of the 
> image/object being imported or from the centre?
>
> Thanks in advance for any help folks,
> Mark.
>
>
>
>
> Aviva Insurance Limited, trading as Aviva, is authorised by the Prudential 
> Regulation Authority in the UK and is regulated by the Central Bank of 
> Ireland for conduct of business rules.
>
> Registered Branch Office in Ireland No 900175, Registered Branch Address One 
> Park Place, Hatch Street, Dublin 2. Registered in Scotland No 2116. 
> Registered Office Pitheavlis, Perth, PH2 0NH.
>
> Aviva Direct Ireland Limited is regulated by the Central Bank Of Ireland. A 
> private company limited by shares. Registered in Ireland No 374895. 
> Registered Office One Park Place, Hatch Street, Dublin 2.
>
> Aviva Life & Pensions UK Limited, trading as Aviva Life & Pensions Ireland, 
> is authorised by the Prudential Regulation Authority in the UK and is 
> regulated by the Central Bank of Ireland for conduct of business rules.
>
> Aviva Life & Pensions UK Limited, trading as Aviva Life & Pensions Ireland, 
> is also regulated in the UK: by the Prudential Regulation Authority for 
> prudential rules and, to a limited extent, by the Financial Conduct Authority 
> for applicable UK conduct rules.
> Registered Branch Office in Ireland (No 906464) at One Park Place, 
> Hatch Street, Dublin 2. Registered in England (3253947) at Wellington 
> Row, York, YO90 1WR
>
> Aviva Life Services Ireland Limited is regulated by the Central Bank Of 
> Ireland. A private company limited by shares. Registered in Ireland No 
> 406616. Registered Office One Park Place, Hatch Street, Dublin 2.
>
>
> www.aviva.ie <http://www.aviva.ie> 
>
> The information transmitted is intended only for the person or entity to 
> which it is addressed and may contain confidential and/or privileged 
> material. Any review, retransmission, dissemination or other use of, or 
> taking of any action or reliance upon this information by persons or entities 
> other than the intended recipient is prohibited. If you received this in 
> error, please contact the sender and delete the material from your computer.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org 
<mailto:users-unsubscr...@pdfbox.apache.org> 
For additional commands, e-mail: users-h...@pdfbox.apache.org 
<mailto:users-h...@pdfbox.apache.org> 

Aviva Insurance Limited, trading as Aviva, is authorised by the Prudential 
Regulation Authority in the UK and is regulated by the Central Bank of Ireland 
for conduct of business rules.

Registered Branch Office in Ireland No 900175, Registered Branch Address One 
Park Place, Hatch Street, Dublin 2. Registered in Scotland No 2116. Registered 
Office Pitheavlis, Perth, PH2 0NH.

Aviva Direct Ireland Limited is regulated by the Central Bank Of Ireland. A 
private company limited by shares. Registered in Ireland No 374895. Registered 
Office One Park Place, Hatch Street, Dublin 2.

Aviva Life & Pensions UK Limited, trading as Aviva Life & Pensions Ireland, is 
authorised by the Prudential Regulation Authority in the UK and is regulated by 
the Central Bank of Ireland for conduct of business rules.

Aviva Life & Pensions UK Limited, trading as Aviva Life & Pensions Ireland, is 
also regulated in the UK: by the Prudential Regulation Authority for prudential 
rules and, to a limited extent, by the Financial Conduct Authority for 
applicable UK conduct rules.
Registered Branch Office in Ireland (No 906464) at One Park Place, Hatch 
Street, Dublin 2. Registered in England (3253947) at Wellington Row, York, YO90 
1WR

Aviva Life Services Ireland Limited is regulated by the Central Bank Of 
Ireland. A private company limited by shares. Registered in Ireland No 406616. 
Registered Office One Park Place, Hatch Street, Dublin 2.


www.aviva.ie <http://www.aviva.ie> 

The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
or reliance upon this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete the material from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org 
<mailto:users-unsubscr...@pdfbox.apache.org> 
For additional commands, e-mail: users-h...@pdfbox.apache.org 
<mailto:users-h...@pdfbox.apache.org> 



Reply via email to