SyntaxHighlighter

Wednesday, March 11, 2009

TexnicCenter DDE Commands for Acrobat Reader

Not really a dev related post, but I had to re-install Vista due to an epic fail on MS's part. My pc went into sleep mode and wrote the files from the C:\ProgramData\Microsoft directory to the C:\ProgramData\Microso~1 dir.

If this ever happens to you, I'm sorry to say you'll have to re-install your OS. I tried everything to get the files back to where they were supposed to be, but it looks like MS tightened security on FS and its impossible to move some of the Crypto files to where they belong. Even if you boot up in Linux...

Anyhow, I have to get latex running again and I'm using TexnicCenter as an editor. I forgot the DDE commands and had to figure it out again. Joy.

Here's the basic setup:
  1. In TexnicCenter, hit Alt+F7 and click on the viewer tab.
  2. In the "View project output" and "Forward search" options, select the "DDE Command" radio button and fill in the following: Command = [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")], Server = acroview, Topic = control
  3. For the "Close document before running Latex" , select DDE with the same settings as above, but change the command to be [DocClose("%bm.pdf")]

One can also fool around with some other commands. Here's the snippet on DDE from the Adobe Interapplication Communication document:

Acrobat Application DDE Messages
This section lists all DDE messages. For complete descriptions of the parameters associated with DDE messages, see the DDE sections of the Acrobat Interapplication Communication Reference.

Application Configuration
  • AppExit — Exits Acrobat.
  • AppHide — Iconifies or hides Acrobat.
  • AppShow — Shows Acrobat.
  • CloseAllDocs — Closes all open documents.
  • HideToolbar — Hides the toolbar.
  • MenuitemExecute — Invokes a menu item, given its language-independent name.
  • ShowToolbar — Shows the toolbar.

Document Manipulation
  • DocClose — Closes the file without saving it and without prompting the user to save the document if it has been modified.
  • DocDeletePages — Deletes a specified range of pages in a document. It cannot delete all pages in a document.
  • DocInsertPages — Inserts specified pages from one file into another.
  • DocOpen — Opens a document and adds it to the list of documents known to DDE, allowing it to be manipulated by other DDE messages (for example, FileOpen).
  • DocReplacePages — Replaces specified pages using pages from another file.
  • DocSave — Saves the specified file.
  • DocSaveAs — Saves an open file into a new file, without warning the user if there is a problem saving.
  • DocSetViewMode — Controls whether bookmarks or thumbnail images are shown in addition to the document content.
  • FileOpen — Opens and displays a file, making it the current document and bringing it to the front if it is already open.
  • FileOpenEx — Opens and displays a file, making it the current document and bringing it to the front if it is already open. The file is opened during an idle loop to allow DDE messages to continue flowing during the opening of large documents.
Document Printing
  • DocPrint — Prints a specified range of pages from a document, without displaying a modal Print dialog box to the user.
  • FilePrint — Prints all pages in a document, displaying a modal Print dialog box to the user.
  • FilePrintEx — Prints all pages in a document, displaying a modal Print dialog box to the user. Only PostScript Level 1 operators are used for PostScript printing. Printing is performed during an idle loop to allow DDE messages to continue flowing during the printing of large documents.
  • FilePrintSilent — Prints all pages in a document, displaying no print dialog box to the user.
  • FilePrintSilentEx — Prints all pages in a document, displaying no print dialog box to the user. Only PostScript Level 1 operators are used for PostScript printing. Printing is performed during an idle loop to allow DDE messages to continue flowing during the printing of large documents.
  • FilePrintTo — Prints all pages in a document to a specified printer, using a specified driver and port, displaying a modal Print dialog box to the user.
  • FilePrintToEx — Prints all pages in a document to a specified printer, using a specified driver and port, displaying a modal Print dialog box to the user. Only PostScript Level 1 operators are used for PostScript printing. Printing is performed during an idle loop to allow DDE messages to continue flowing during the printing of large documents.
View Manipulation
  • DocGoTo — Goes to the specified page.
  • DocGoToNameDest — Goes to the specified name destination within the document.
  • DocPageDown — Scrolls forward through the document by one screen area.
  • DocPageLeft — Scrolls to the left by a small amount.
  • DocPageRight — Scrolls to the right by a small amount.
  • DocPageUp — Scrolls backward through the document by one screen area.
  • DocScrollTo — Scrolls the view of the current page to a specified location.
  • DocZoomTo — Sets the zoom for a specified document.
Search-related
  • DocFind — Finds a string in a specified file.