If you have created a PDF file with the wrong page format, if you want to rotate the PDF or even reposition the PDF contents, then you can consider the advanced workflow utilities component, PDF scale and rotate.
The PDF Scale and rotate component makes it possible to scale a PDF to a new size, rotate it at any degrees and move the content to a new position.
This component was originally made for resizing a PDF for DriverPrint (Option to use the Windows driver on the operating system for an OS connected printer) to make it match a different size of a label.
It is also possible to manually define a new size of the output.
None of the fields are mandatory and they are ignored if they are empty or the value 0.
The scaling, rotating and moving is done using a transformation matrix and it shouldn’t modify the content of the PDF in any other way. The transformations is added in the order SRT (Scale, Rotate, Translate).
Before running this component you need to ensure, that a PDF is loaded to the payload. You can do that either by getting the PDF file initially in the workflow or by creating a PDF file in the payload with the component, Create PDF document.
The component has these parameters:
The parameters are:
Units
The unit dropdown defines which unit is used for scaling and moving. The default value is centimeters.
New width and new height
When a new width and/or a new height is defined then the page is rescaled to that new size. If one of the fields is missing, it will be calculated using the same ratio as the one entered.
If Target page width and Target page height is not entered or 0, then they will be set to the new size of the page.
Move X and move Y
This moves the page using the coordinate system in the PDF
Usually this is defined as bottom left is 0,0
Move X is the X direction for the move (Usually move to the right)
Move Y is the Y direction for the move (Usually move up)
Please notice that the coordinate system is depending on the PDF, meaning it is possible for a PDF to be rotated 90 degrees or upside down (or worse).
Rotate
This rotates the entire page in any angle as a degree between 0 and 360.
Normally this is done counter clockwise. Please note that the rotation depends on the coordinate system in the PDF.
Target page width and target page height
This is override parameters for the page width and page height. When only scaling and if these are left blank, then the page width and height is scaled the same.
If no scaling is done, the default is to leave the page size as it is.