Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

pdf reader?

If you have a question or need help, this is the place to be.
Post Reply
jollyb
Posts: 6
Joined: Tue Mar 10, 2009 1:41 am

pdf reader?

Post by jollyb »

has eventghost any plugin except irfanview that can view pdf files?
i'm using irfanview to watch some pdfs, but it doesn't do that right. it would be great if i could manage adobe reader with EventGhost, but i didn't find anything here on the forum. i'm trying myself to do something in EventGhost but no success. just prev/next page and fullscreen would be needed as commands in my case.
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: pdf reader?

Post by jinxdone »

This is the sort of thing EG excels at, you don't need a ready made plugin for simple program control like this.

Here is a little example of sending emulated keystrokes to acrobat reader from EG. (copy&paste the piece of code into EG)

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="851">
    <Folder Name="Adobe Reader" Expanded="True">
        <Macro Name="NextPage">
            <Action>
                Window.FindWindow(u'AcroRd32.exe', None, None, u'AVPageView', None, 1, False, 0.0, 0)
            </Action>
            <Action>
                Window.SendKeys(u'{Right}', False)
            </Action>
        </Macro>
        <Macro Name="PrevPage">
            <Action>
                Window.FindWindow(u'AcroRd32.exe', None, None, u'AVPageView', None, 1, False, 0.0, 0)
            </Action>
            <Action>
                Window.SendKeys(u'{Left}', False)
            </Action>
        </Macro>
        <Macro Name="Fullscreen">
            <Action>
                Window.FindWindow(u'AcroRd32.exe', None, None, u'AVPageView', None, 1, False, 0.0, 0)
            </Action>
            <Action>
                Window.BringToFront()
            </Action>
            <Action>
                Window.SendKeys(u'{Ctrl+L}', False)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
You could also control a program using the SendMessage action to generate windows messages but that will get more complicated and I think keystroke emulation should be sufficent in you case anyway.

-jinxdone
Post Reply