Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to make the orientation of mutiple combined PDFs the same

New Here ,
Dec 14, 2016 Dec 14, 2016

Hello,

I'm trying copy multiple comments from one PDF to the other, when they are pasted their orientation is at 90 same as the source. The orientation of the destination PDF is 270. How do I change the orientation of either pdf so they match?

Regards,

TOPICS
Edit and convert PDFs
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 14, 2016 Dec 14, 2016

Acrobat is rotating your comments because the source page rotation is different from the target page rotation. You cannot change the page rotation (unless you do some heavy lifting and process each page element at a time, rotate it and then place it in the correct position), so the only way you can fix this is to rotate the comments after you place them - e.g. using the script that Try67 provided.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2016 Dec 14, 2016

The question is whether the pages are actually rotated, or just appear to be... To check it you can execute this code from the JS Console and it will print the rotation degrees for all the pages in the file:

for (var p=0; p<this.numPages; p++) {

    console.println("Page " + (p+1) + ": " + this.getPageRotation(p));

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

I have done this and confirmed that one page is set at 90 and the other at 270. So, how do actually rotate the page as apposed to the page just appearing to be rotated through the view>rotate drop down?

Thank you for your response.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2016 Dec 14, 2016

You can do it manually via Tools - Pages - Rotate, or automatically, using this code:

for (var p=0; p<this.numPages; p++) {

    if (this.getPageRotation(p)!=270) {

        this.setPageRotations(p, p, 270);

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

The codes and procedures you have posted work as they are intended. However, when I import the comment data file or manually copy a comment from one PDF to the Other (or alternately page to page in the same PDF)

Acrobat DC is still rotating the comment 180 degrees!?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2016 Dec 14, 2016

Acrobat is rotating your comments because the source page rotation is different from the target page rotation. You cannot change the page rotation (unless you do some heavy lifting and process each page element at a time, rotate it and then place it in the correct position), so the only way you can fix this is to rotate the comments after you place them - e.g. using the script that Try67 provided.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2016 Dec 14, 2016

Thank you everyone for your help..........I was afraid that was going to be the answer. Well I'm off to copy and rotate one hundred + comments.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2016 Dec 15, 2016
LATEST

Ah, I missed one thing. Somehow I assumed that Try67's second code snippet was about rotating comments, which you can do using JavaScript as well:

var annots = this.getAnnots();

for (var i in annots) {

  annots.rotate = 270;

}

This will rotate all annotations to use a rotation angle of 270 degrees. When you run this, you will notice that the rotated annotation is still using the same box as the original one, and therefore the actual annotation will very likely be smaller than the original. You also need to change the annotation rectangle accordingly to make this work correctly (and potentially change it's position). You would use the 'rect' property of the annotation: Acrobat DC SDK Documentation

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines