These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Correct rotation of pasted objects

Tom M
Registered: May 3 2011
Posts: 5
Answered

Group,
I have a binder set of pdf drawings (42"x30") I created from individual files. If memory serves they were all rotated after the binder was created. I have received addendum's to the pages and I want to transfer all my comments, notes, lines, rectangles, polygons, etc. objects from the old pages to the new pages in a new binder document. My problem is when I copy/paste the pasted objects are inserted in the wrong orientation. I have tried rotating the new document page in both portrait and landscape but when I paste the objects the new page is rotated 90 degrees by the program then the page is rotated back to its original orientation, or the objects rotate 90 degrees when pasted.
Can someone please describe how I can best resolve this transfer of objects.
Thanks,
 
Tom M

Regards,
Tom M

My Product Information:
Acrobat Pro Extended 9.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First you need to ensure that the new page has the same rotation as the old page. The Acrobat UI does not provide the actual rotation. So, navigate to the page of interest in the PDF, then open the Acrobat Console window and run this code.

getPageRotation(pageNum);

Do this for the old page and the new page. Rotate the new page by 90 until they match. Now when you copy the comments from the old to new page they should have the correct rotation.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Tom M
Registered: May 3 2011
Posts: 5
Thom,
Even after using the script in the Console to query page rotation, then I set the old and new pages so their values match at 0 and then copy and paste; again the markups are rotate in the new page. It would be easier if I could just rotate the markups, I don't know if that is possible. It's hard to describe, I don't see a way to attach documents here to explain it better. I do like your pdfscripting website, when I have time I may subscribe to the videos, thanks.

Regards,
Tom M

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Accepted Answer
It's a known issue with certain types of annotation copy/paste, though it's not entirely obvious what combination of circumstances cause it. You can't rotate annotations independently of their pages using the Acrobat tools.
Tom M
Registered: May 3 2011
Posts: 5
Dave,
Thank you for sharing your experience - I am going to accept your answer because it make sense coupled with my attempts to transfer data. I'm basically using the PDFs as electronic paper to highlight completed contract items and to note RFI comments for my part of the scope (I model the structural steel). In the future I will take the time to rotate individual PDF sheets prior to creating my binders. It may be more time consuming up front with 100's of drawings but it will sure be better than manually redoing my annotations & markups when the contract docs change.

Regards,
Tom M

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
To display an annotation in the correct orientation it has to have the same rotation as the page. Or, in your case, the rotation of the source and destination pages have to match. However, this does not cover the issue of the content on one page having a different orientation than another page. Annotations are handled in Default User Space coordinates. This is the coordinate system you see on the screen when the page rotation is 0. If you set both the new and old pages to zero rotation, and they both look the same then the contents on both are oriented in the same way. If this is true then an annotation copied from one page to another should also look the same on both pages.

The Acrobat UI occasionally tries to be smart and fix things up for the user behind the scenes. If odd things truly are happening then it may be this feature that is at the root of the problem.

So there is another way to do it. If the pages are in the same file it's actually quite simple to write a script to copy annots from one page to another in the same orientation and location. Scripts don't have the same funny business going on that the UI does.

To test this out select an annotation on one page and run the following code in the console window.

var myProps = this.selectedAnnots[0].getProps();
myProps.page = myProps.page+1;
this.addAnnot(myProps);

This copies the selected annot to the next page with exactly the same properties. If it works for your document, then Acrobat might be doing something funny.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

rbogie
Registered: Apr 28 2008
Posts: 432
this issue has been repeatedly aired on this forum.
One or all of the following suggestions may resolve the 'rotated text box' problem (these assume the target file is monochrome image):
1- on target PDF apply OCR. run 'examine document' tool (on document menu) and remove hidden text
2- export the target PDF to TIFF (file> export> image> TIFF); individual pages are created; recombine the TIFFs to PDF (if other than monochrome, may want to experiment with ZIP compression [see preferences] for both PDF to TIFF and TIFF to PDF)
2.1 - import each TIFF to Photoshop (PS elements is okay) and save as TIFF or PDF
3- import the target PDF to MS Office Doument Imaging (MODI comes with MS office) and save as TIFF (not MDI) and then create a new PDF from the TIFF
Tom M
Registered: May 3 2011
Posts: 5
thomp wrote:
..................
The Acrobat UI occasionally tries to be smart and fix things up for the user behind the scenes. If odd things truly are happening then it may be this feature that is at the root of the problem.

So there is another way to do it. If the pages are in the same file it's actually quite simple to write a script to copy annots from one page to another in the same orientation and location. Scripts don't have the same funny business going on that the UI does.

To test this out select an annotation on one page and run the following code in the console window.

var myProps = this.selectedAnnots[0].getProps();
myProps.page = myProps.page+1;
this.addAnnot(myProps);


This copies the selected annot to the next page with exactly the same properties. If it works for your document, then Acrobat might be doing something funny.
I gave it a try, I'm not sure if I need another operation since I received this error:

var myProps = this.selectedAnnots[0].getProps();
myProps.page = myProps.page+1;
this.addAnnot(myProps);


myProps is not defined
1:Console:ExecException in line 1 of function top_level, script Console:Exec

myProps is not defined
1:Console:Exec
undefined

Regards,
Tom M

Tom M
Registered: May 3 2011
Posts: 5
rbogie wrote:
this issue has been repeatedly aired on this forum.
One or all of the following suggestions may resolve the 'rotated text box' problem (these assume the target file is monochrome image):
1- on target PDF apply OCR. run 'examine document' tool (on document menu) and remove hidden text
2- export the target PDF to TIFF (file> export> image> TIFF); individual pages are created; recombine the TIFFs to PDF (if other than monochrome, may want to experiment with ZIP compression [see preferences] for both PDF to TIFF and TIFF to PDF)
2.1 - import each TIFF to Photoshop (PS elements is okay) and save as TIFF or PDF
3- import the target PDF to MS Office Doument Imaging (MODI comes with MS office) and save as TIFF (not MDI) and then create a new PDF from the TIFF
I tried all the steps, with no luck, however removing the metadata was a new command for me which was cool removing all the embedded TT text and having only geometry data remain - It gives me ideas for other drawing tasks - thanks

Regards,
Tom M

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In the posted script, one of the key points is that an annotation has to be selected, i.e., the "selectedAnnots" property is an array of selected markup annotations.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script