Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rotate PDF in Adobe Plug in Browser

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
Hi All

I have a windows form with an Adobe 8.0 browser control on it. (Adobe Acrobat 8.0 Browser Control Type Library). Its simple to use, and you can use the loadfile method to open up your pdf.

All I want to do is to rotate the PDF clockwise through 90 degrees automatically, after each PDF opens. This is equivalent to pressing SHIFT+CTRL+Plus. I noticed that when the form loads, a process of AcroRd32.exe also opens, and I have managed to get the process id both of this, and of the embedded control itself (they are different ids!)

My theory to make this work was to get a handle on the running process, make it the foreground app, and use sendkeys to force the rotation. Here is what I've tried with no success..does anyone have any idea how to make this work?

Code:
        ''Grabbing the Process
        'Dim p() As Process = Process.GetProcessesByName("AcroRd32")
        'If p.Length = 0 Then Exit Sub
        'Dim iId As Integer = p(0).Handle
        'SetForegroundWindow(iid)

        ''Grabbing the handle of the embedded control
        SetForegroundWindow(xPdf.Handle)

        'Rorate
        My.Computer.Keyboard.SendKeys("+(^{+})")

        'Zoom (brings a dialog box)
        My.Computer.Keyboard.SendKeys("^Y")

        xPdf.Select()

Any help/ideas greatly appreciated...Ive run out of steam on this one.




Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top