Home General

Invalid PDF generated when it includes a canvas drawn picture that has had a rotation applied

Currently we are using Report Builder 19.03 with Delphi 10.3.1, I've also just tried this with 19.04

If I use report builder to export a PDF that has canvas drawn pictures with -90 or -270 degree rotations (set via canvas world transform) a bad PDF is generated (also sometimes a PDF that can be opened but that is missing the pictures)
If I print to PDF using Microsoft PDF creator the PDF can be opened and shows the drawings
If I draw with no rotation set in the canvas transformation the report builder PDF export produces a valid PDF.
If I only have 0 and -180 degree rotations in the report the PDF export is okay.
I also tested a +90 rotation and had the same problem with the PDF, I haven't tried other rotations.

SinCos(-in_MagnetDetails.partDropOffOrientation, Sin1, Cos1); Fillchar(rotationMatrix, SizeOf(rotationMatrix), 0); rotationMatrix.eM11 := Cos1; // X Multiplier rotationMatrix.eM12 := Sin1; // X in Y multiplier rotationMatrix.eM21 := -Sin1; // Y in X multiplier rotationMatrix.eM22 := Cos1; // Y Multiplier 1 rotationMatrix.eDx := rotationCentre[0] - (Cos1*rotationCentre[0]) + (sin1*rotationCentre[1]); rotationMatrix.eDy := rotationCentre[1] - (Cos1*rotationCentre[1]) - (sin1*rotationCentre[0]); Fillchar(scalingMatrix, SizeOf(scalingMatrix), 0); scalingMatrix.eM11 := sf; // Horizontal scaling scalingMatrix.eM12 := 0; // not used in scaling scalingMatrix.eM21 := 0; // not used in scaling scalingMatrix.eM22 := sf; // Vertical scaling scalingMatrix.eDx := 0; scalingMatrix.eDy := 0; CombineTransform(transformMatrix, rotationMatrix, scalingMatrix); sf := 1.0; // all scaling is now being done by the transform above SetGraphicsMode(mfCanvas.Handle, GM_ADVANCED); SetWorldTransform(mfCanvas.Handle, TransformMatrix);
Sign In or Register to comment.