Old AutoCAD .sld slide files from a CAD archive will not open in anything modern until sldtoppm turns them into PPM images. You will get a converted image plus, if you need them, metadata inspection, aspect-ratio correction and vector-domain scaling. Allow about fifteen minutes if the slide file is ready. The examples use Netpbm 11.5.2 from Debian package netpbm 2:11.05.02-1.1build1, installed on the system used for this guide.
The command reads one slide from a file, or from standard input when no slide file is supplied, and writes the PPM image to standard output. That makes shell redirection part of the normal workflow, but it also means an unsafe output name can truncate an existing image before conversion has finished.
Start with a read-only check. This needs no elevated privileges:
$ command -v sldtoppm
/usr/bin/sldtoppm
$ sldtoppm --version
sldtoppm: Using libnetpbm from Netpbm Version: Netpbm 11.5.2
The version output contains build details as well as the library version. If your output differs, keep the installed manual page nearby: old slide formats and Netpbm builds can differ in their diagnostics. The manual says only Level 2 slide files are supported; a Level 1 file is not a fallback format this command can convert.
Use -info to send the slide header to standard error. Keep the image output separate by redirecting standard output:
$ sldtoppm -info /path/to/slide.sld > slide.ppm
The output file is the converted image. Header information, including the original screen size and aspect ratio, is printed on the terminal rather than inserted into the PPM. A successful command normally leaves the terminal showing the diagnostic and creates slide.ppm.
Checkpoint: Confirm that the output exists and that a file-identification tool recognises it:
$ file slide.ppm
$ test -s slide.ppm && echo "non-empty PPM created"
non-empty PPM created
The exact file wording varies. The useful checks are that it identifies a PPM image and that the file is non-empty. Do not treat a successful exit status as proof the drawing looks right: open the result with a trusted image viewer or pass it to another Netpbm tool after checking its dimensions.
AutoCAD slides can record a source display with non-square pixels. Without -adjust, the installed command warns about that condition and keeps the unadjusted geometry. Add -adjust when the result should have square pixels:
$ sldtoppm -adjust /path/to/slide.sld > slide-square-pixels.ppm
This correction changes the image width so circles remain circles. The manual describes the operation as vector-domain scaling before rasterisation, which is preferable to producing an uncorrected bitmap and trying to repair its width afterwards with pamscale.
Do not add -adjust merely to silence the warning without checking the source display geometry. Compare the header shown by -info with the dimensions of the resulting PPM, and keep the original output until the corrected image has been inspected.
Use -width or its alias -xsize to set the output width. If height is omitted, the command preserves the pixel aspect ratio:
$ sldtoppm -width 1600 /path/to/slide.sld > slide-1600px.ppm
Use -height or -ysize for a target height instead:
$ sldtoppm -height 1200 /path/to/slide.sld > slide-1200px.ppm
When both dimensions are supplied, the command uses both values, which can alter the apparent aspect ratio: only do that when you have measured the target canvas deliberately. These options scale vector data before rasterisation; they are not a request to crop the slide.
For proportional scaling by a floating-point factor, use -scale. The factor must be greater than zero, and scaling happens after aspect-ratio adjustment:
$ sldtoppm -adjust -scale 0.5 /path/to/slide.sld > slide-half-size.ppm
Use full option names in scripts even though this program accepts the shortest unique abbreviation. Full names make a command easier to audit when a future release adds another option.
An AutoCAD slide library contains named slides rather than one standalone drawing. First list its members:
$ sldtoppm -dir /path/to/slides.slb 2> slide-library.txt
$ sed -n '1,20p' slide-library.txt
-dir prints the directory listing to standard error. Redirecting only standard error preserves that listing as text and leaves standard output unused for this inspection step.
Extract a member with -lib. This form converts the requested name to upper case:
$ sldtoppm -lib TITLE /path/to/slides.slb > title.ppm
Use -Lib, with a capital L, when the exact member case matters or when the name contains non-ASCII characters:
$ sldtoppm -Lib 'Title With Case' /path/to/slides.slb > title.ppm
The manual warns that -lib may not find 8-bit or 16-bit names unless the program was built with suitable locale conversion support. -Lib uses the name as supplied, so copy the exact spelling from the -dir listing instead of guessing.
Shell > truncates its destination before sldtoppm starts. Do not overwrite a useful PPM directly while testing a new slide or scale. Use a new name first:
$ sldtoppm -info /path/to/slide.sld > slide.ppm.new
$ test -s slide.ppm.new
$ mv -- slide.ppm.new slide.ppm
The mv is the state-changing step: run it only after inspecting the new image. If conversion fails, remove the incomplete slide.ppm.new after checking that it is the intended temporary file; the previous slide.ppm remains untouched. There is no need for sudo for ordinary reads and writes in your own working directory. Use elevated privileges only when the source or destination permissions genuinely require them, and never to work around a wrong path.
An input-open error usually means the path, permissions or file type needs checking. Inspect without modifying anything:
$ ls -l /path/to/slide.sld
$ file /path/to/slide.sld
If the command reports an unsupported format, confirm the file is a Level 2 slide. If a library member cannot be found, rerun -dir, copy the exact name and choose -Lib when case or character-set conversion is a concern. If the image is stretched, compare -info output and try -adjust before applying any later bitmap scaling.
For more detail, -verbose prints the header and lists every vector and polygon to standard error. Keep that diagnostic stream separate from the PPM:
$ sldtoppm -verbose /path/to/slide.sld > slide.ppm 2> slide.trace
That trace can be large. Treat it as temporary diagnostic material if the slide contains sensitive drawing data, and delete it only after confirming the path is correct and it is no longer needed.
sldtoppm and Netpbm version were confirmed.-adjust, explicit dimensions or -scale were chosen on purpose.