You can control SumatraPDF with DDE commands.
They are mostly used to use SumatraPDF as a preview tool from e.g. LaTeX editors that generate PDF files.
Single DDE command: [Command(parameter1, parameter2, ..., )]
Multiple DDE commands: [Command1(parameter1, parameter2, ..., )][Command2(...)][...]
Since 3.5 (currently in pre-release) you can send all named commands.
[<command_id>]
e.g. [CmdClose]
[Open("<pdffilepath>"[,<newwindow>,<focus>,<forcerefresh>])]
newwindow
is 1 then a new window is created even if the file is already openfocus
is 1 then the focus is set to the windowforcerefresh
is 1 the command forces the refresh of the file window if already open (useful for files opened over network that don't get file-change notifications)".[Open("c:\\file.pdf", 1, 1, 0)]
[ForwardSearch(["<pdffilepath>",]"<sourcefilepath>",<line>,<column>[,<newwindow>,<setfocus>])]
pdffilepath
: path to the PDF document (if this path is omitted and the document isn't already open, SumatraPDF won't open it for you)column
: this parameter is for future use (just always pass 0)newwindow
: 1 to open the document in a new window (even if the file is already opened)focus
: 1 to set focus to SumatraPDF's window.[ForwardSearch("c:\\file.pdf","c:\\folder\\source.tex",298,0)]
[ForwardSearch("c:\\folder\\source.tex",298,0,0,1)]