ViewCompanion DDE Commands
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.
What is DDE?
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.
Why use DDE with ViewCompanion?
DDE commands can be useful when another Windows application needs to control ViewCompanion directly.
Typical use cases include:
- Opening a drawing or document from another application.
- Printing a file automatically.
- Converting a loaded file to another format.
- Controlling the main application window.
- Zooming, rotating or closing the active document.
- Maintaining compatibility with older document management systems.
DDE Command Syntax
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 Reference
| 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. |
Conversion Command
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")]
Supported Output Formats
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
Examples
Open a file
[open("C:\Drawings\sample.dwg")]
Print a file
[print("C:\Drawings\sample.pdf")]
Convert the active file to PDF
[convert("PDF","C:\Output\sample.pdf")]
Convert the active file to TIFF
[convert("TIFF","C:\Output\sample.tif")]
Maximize the main window
[showmainwindow("maximized")]
Zoom to the full drawing
[zoomall()]
Security Considerations
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.
Modern Alternatives to DDE
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:
- Command line automation: Useful for scripted file conversion and batch processing.
- Batch conversion: Convert many files in one operation using ViewCompanion Standard, Pro, or Premium.
- Folder Monitor: Automatically convert files when they are added to a monitored folder.
- Developer tools: Use Software Companions SDK products when you need to add viewing or conversion functionality to your own application.
Frequently Asked Questions
Is DDE still supported?
ViewCompanion includes DDE command support for legacy automation and compatibility with existing Windows workflows.
Should I use DDE for new integrations?
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.
Can DDE be used to convert files automatically?
Yes. The convert command can convert the currently active file to supported output formats such as PDF,
TIFF, PNG, DXF, DWF and others.
Are DDE commands case sensitive?
Yes. All ViewCompanion DDE commands are case sensitive.