ViewCompanion supports a set of DDE commands that can be used to control the application from another Windows program. These commands are mainly intended for legacy automation, integration with existing document workflows, and compatibility with older systems that still use Dynamic Data Exchange.
DDE, short for Dynamic Data Exchange, is a legacy Microsoft Windows technology that allows applications to communicate with each other. It was commonly used before newer automation technologies such as COM, ActiveX, .NET, scripting APIs, command line tools and web-based interfaces became common.
Although DDE is no longer considered a modern integration method, it can still be useful in established Windows-based environments where older systems need to open, print, convert or control documents automatically.
DDE commands can be useful when another Windows application needs to control ViewCompanion directly.
Typical use cases include:
A DDE command is sent as a command string enclosed in square brackets.
String parameters, such as file names and format
names, must be enclosed in quotation marks.
[open("C:\Drawings\example.pdf")]
When using file paths, make sure the full path is valid and that the calling application has permission to access the file.
| Command | Description |
|---|---|
[open("filename")] |
Opens a file for viewing. The file name must be enclosed in quotation marks. |
[print("filename")] |
Loads a file and prints it. The file name must be enclosed in quotation marks. |
[closeapplication()] |
Closes the ViewCompanion application. |
[showmainwindow("state")] |
Sets the window state of the main application window.
Valid values are "maximized", "minimized" and "restore".
|
[setwindowpos(x,y,w,h)] |
Sets the main window position and size. All values are in screen pixels. |
[tilehorz()] |
Tiles all child windows horizontally. |
[tilevert()] |
Tiles all child windows vertically. |
[cascade()] |
Cascades all child windows. |
[setactivefile("filename")] |
Selects the current active file. The file name must be enclosed in quotation marks. |
[rotate()] |
Rotates the current active file 90 degrees counterclockwise. |
[convert("format","outputfile")] |
Converts the current active file to the selected output format. |
[closeactivefile()] |
Closes the current active file. |
[namedview(name)] |
Zooms the drawing and displays the specified named view. |
[zoomall()] |
Executes the Zoom All command on the current active file. |
[zoomtowidth()] |
Executes the Zoom To Width command on the current active file. |
[zoomin()] |
Executes the Zoom In command on the current active file. |
[zoomout()] |
Executes the Zoom Out command on the current active file. |
The convert command converts the currently active file to another file format.
Both the format name and output file name must be enclosed in quotation marks.
[convert("PDF","C:\Output\converted-file.pdf")]
The following format names can be used with the DDE conversion command:
AVIF - AV1 Image File FormatBMP - Windows BMP Image File FormatCALS - CALS Group 4 Image FormatCGM - CGM BinaryDWF - Autodesk Design Web FormatDXF - Autodesk DXFEMF - Windows Enhanced MetafileGBR - Gerber RS-274XGIF - GIF Image FormatHEIC - HEIF Image FormatJPEG - JPEG RasterJPEG2K - JPEG 2000 Image FormatJXL - JPEG XL Image FormatPCX - Paintbrush PCX Image FormatPDF - Adobe Acrobat PDFPDFRASTER - Flattened raster PDFPNG - Portable Network GraphicsPS - Adobe PostScriptTIFF - TIFF RasterSVG - Scalable Vector GraphicsWEBP - Google Image FormatWMF - Windows Placeable Metafile[open("C:\Drawings\sample.dwg")]
[print("C:\Drawings\sample.pdf")]
[convert("PDF","C:\Output\sample.pdf")]
[convert("TIFF","C:\Output\sample.tif")]
[showmainwindow("maximized")]
[zoomall()]
DDE should be used only in trusted local automation scenarios. Because DDE allows one application to send commands to another application, it should not be exposed to untrusted input, remote users, downloaded files or uncontrolled scripts.
For new automation workflows, command line processing or dedicated developer APIs are usually safer and easier to maintain.
DDE is useful for compatibility, but it is not normally the best choice for new integrations. Depending on your workflow, the following alternatives may be more suitable:
ViewCompanion includes DDE command support for legacy automation and compatibility with existing Windows workflows.
In most cases, no. DDE is mainly useful for legacy systems. For new automation projects, command line tools, batch processing, folder monitoring or developer APIs are usually better choices.
Yes. The convert command can convert the currently active file to supported output formats such as PDF,
TIFF, PNG, DXF, DWF and others.
Yes. All ViewCompanion DDE commands are case sensitive.