SDI image converters (e.g. CGM to SVG, PDF, and PNG) are available on Linux and Windows 64 | 32-bit applications. Converters can be called from:
- Desktop applications (Office CAD or GEO, Montage, and Editor)
- The command line
- Executable programs that run in their own memory space
- Benefits calling program by not using up available memory, nor crashing due to invalid parameters or input files
- Returns conversion status for success or failure
Example command line
1) Convert basefile.cgm to newfile.svg, 2) remove background color, 3) pass fontnames instead of font metrics
Cgm2svg.exe c:\temp\basefile.cgm c:\work\newfile.svg –nobackground –fontname
Stream input, output stream, and filter
All converters accept stream input and output to a stream, thus allowing them to be used as filters.
- CUPS uses filters in order to print files of unknown format. SDI image converters can be used as CUPS filters.
- Pass the output SVG stream to a browser to display the resultant SVG.
1) Convert PDF to CGM, 2) pipe the output to cgm2shape, 3) produce newfile.shp
Pdf2cgm.exe c:\work\pdffile.pdf stdout | cgm2shape stdin c:\work\newfile.shp
In effect, you are converting PDF to SHP by using two converters with an IO write to disk.
Command line options and switches
All converters have command line options, or switches. These switches provide alternate behavior for the filter.
- Select the profile and version of the CGM using –profile=PIP and –version=3
- White text on black backgrounds can be switched to black text on white background using -reversebw
- Color files can be turned to monochrome files using -monochrome.
- Status = cgm2pdf infile outfile
- If ( status .ne. success ) do something