Rotate a PDF in PdfCreator and PB8

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
bandenny
Posts: 2
Joined: Wed Oct 20 2004
Location: Germantown, MD

Rotate a PDF in PdfCreator and PB8

Post by bandenny »

I am evaluating the demo version of the PdfCreator Active X tool with Powerbuilder 8. I am viewing a PDF file fine and can navigate through the pages, but I am unable to rotate a page that is currently being viewed by the user. Is there a trick to this? Below is my code....I appreciate any help!

When this script is executed the PDF "blinks" inside the viewer, but does not rotate. No error messages are generated.......

thanx!

This is inside the clicked event of a command button......


int w=0

ole_amy.object.setLicenseKey("Suite Evaluation Developer", "07EFCDAB01000100003C76714DFEB6E6A141975E3458F5876894F09D094E735A605D4254516537B70DE20EB190063C2E5657526ACB2D4D7594022EE0B321480A6410FEECE2BA87958AFD65E704148631EC58A5FF7B73E128C596F1")
ole_amy.object.doCommandTool(53777) // design mode
w = ole_amy.object.objectAttribute("Pages[1]", "width") // store current page width
ole_amy.object.objectAttribute("Pages[1]", "rotate", 90) // rotate page
ole_amy.object.objectAttribute("Pages[1]", "width", ole_amy.object.objectAttribute("Pages[1]", "length")) // set new width to current length
ole_amy.object.objectAttribute("Pages[1]", "length", w) // set new length to previous width
ole_amy.object.doCommandTool(53776) // run mode
ole_amy.object.reDrawObject("Pages[1]") // redraw the page
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I noticed in your code that you first rotate the document 90 degrees, than you are sustituting the page lenght and width. So it is as if you are not rotating any thing.

Comment the below statments and check what you get
//ole_amy.object.objectAttribute("Pages[1]", "width",
//ole_amy.object.objectAttribute("Pages[1]", "length")) // set new width to current length
//ole_amy.object.objectAttribute("Pages[1]", "length", w) // set new length to previous width
bandenny
Posts: 2
Joined: Wed Oct 20 2004
Location: Germantown, MD

Post by bandenny »

Joan,

Thanx for your reply. I tried what you suggested, but it had no effect. I changed my code to rotate the page, and then save it a new pdf file. When I view that file in Acrobat the background (white area) of the page looks rotated, but the text and images on top are still in portrait. The text seems a bit smaller too....Here is that code :

ole_amy.object.doCommandTool(53777) // design mode
ole_amy.object.currentPage = 1
ole_amy.object.objectAttribute("Pages[1]", "Rotate", 90) // rotate page
ole_amy.object.doCommandTool(53776) // run mode

ole_amy.object.save("c:\testpdf.pdf", 1) // save only the view
ole_amy.object.open("c:\testpdf.pdf", "") // re-open the document
Post Reply