Open
Description
if (rotation) {
this.internal.write(
[1, "0", "0", 1, coord(x), vcoord(y + height), "cm"].join(" ") // Why add height?
); //Translate
this.internal.write(rotationTransformationMatrix.join(" "));
this.internal.write(
[coord(width), "0", "0", coord(height), "0", "0", "cm"].join(" ")
); //Scale
This is odd behavior in my opinion. If you place an image at 0,0 and rotate it 90 degrees it ends up very very far away from 0,0.
My preference would be rotation around the position it is drawn, I'd even take center rotation. Better yet give me an anchor point variable. Rotating an image means I also have to do complicated math to make sure the position is correct after the fact.
My solution has been to rotate the image with Jimp BEFORE handing it jspdf, which makes the logic more understandable, if computationally expensive.
I'm fully expected it to be "well its always been this way, I cant break our users' expectations" or "pdf's are weird like that bro" or some other Chestertons Fence I'm unaware of.
Metadata
Metadata
Assignees
Labels
No labels