Reputation: 4602
while the topic of my question seems to be a well supported feature of many PDF manipulation packages and tools out there, I need to make clear that I don't want to rotate the PDF.
I have a PDF that exposes a portrait orientation (A4) with dimensions WxH 297x210 (A4 rotated).
Now, what I need to achieve, is that this PDF has landscape orientation while preserving the dimensions.
I am not sure what this requires me to do.
If I use Adobe Illustrator to change document format to the desired position, I also need to rotate the contents. If I put this page into the badly designed PDF, the formfields and all annotations on this page are still in the portrait orientation.
How can I rotate them to match the new page orientation? There seems to be no tool support for this kind of task.
Thanks for your support!
Thomas
Upvotes: 0
Views: 7851
Reputation: 4602
First I fixed the PDF.
It seems, that cpdf -upright will also fix this. If you cannot use cpdf, because of commercial use, you can use a manual approach as shown with Adobe Illustrator.
cpdf did not correct the Acrofields orientation and not the annotations in the pdf. I had to recreate the annotations. The Acrofields can be fixed using JavaScript as shown below.
Then I fixed the Acrofields using the PDF JavaScript in Acrobat Pro.
Enter the following script:
var box = getPageBox();
var w = box[2] - box[0];
var h = box[1] - box[3];
// left,top right,bottom
// bottom, h-left top, h-right
for(i=0; i<numFields; i++) {
var f = getField(getNthFieldName(i));
var orig = f.rect;
f.rect = [orig[3], h-orig[0], orig[1], h-orig[2]];
f.rotation = 0;
}
To execute, highlight the script and press the ENTER Key, NOT RETURN. The ENTER Key is the enter-key on the keypad. This will execute the highlighted JavaScript. The formfields will be rotated by +90° and should be placed almost correct, but at least near the position, where they are supposed to be.
Upvotes: 0
Reputation: 2763
It's not completely clear what you want, but I think it might be that you want to change the viewing rotation, counter-rotating the content and page dimensions to compensate.
In which case, the CPDF command line tools can do this:
cpdf -upright in.pdf -o out.pdf
which will make the viewing rotation 0, rotating the contents and changing the page dimensions to compensate. You can then change the viewing rotation as you like with
cpdf -rotate <angle> in.pdf -o out.pdf
(absolute) or
cpdf -rotate-by <angle> in.pdf -o out.pdf
(relative) where <angle>
is 0, 90, 180, 270, 360
.
If this doesn't suffice, you also have
cpdf -rotate-contents <angle> in.pdf -o out.pdf
where is a number of degrees to rotate clockwise, and
cpdf -mediabox "minx miny width height" in.pdf -o out.pdf
Upvotes: 3
Reputation: 496
You can use FoxitReader. Is it free and it has a function HOME -> ROTATE VIEW, which does what you want.
Upvotes: 0