Legacy application and Dosbox

dosboxprinter

I have a legacy application, that only works in DOS up to Windows XP, but nowadays I'd prefer to use Windows 8 owing to the other softwares. This legacy application uses lpt1 port to print your things, in Dosbox I can't configure lpt1 port using:

 net use lpt1 \\<mynetworkpc>\<printer> /persistent:yes

note: the printer is parallel.

So in other topic around the internet I found a article who says to use this Dosbox http://ykhwong.x-y.net/ and configure there lines:

    [printer]
    #     printer: Enable printer emulation.
    #         dpi: Resolution of printer (default 360).
    #       width: Width of paper in 1/10 inch (default 85 = 8.5'').
    #      height: Height of paper in 1/10 inch (default 110 = 11.0'').
    # printoutput: Output method for finished pages: 
    #                png     : Creates PNG images (default)
    #                ps      : Creates Postscript
    #                bmp     : Creates BMP images (very huge files, not recommend)
    #                printer : Send to an actual printer (Print dialog will appear)
    #   multipage: Adds all pages to one Postscript file or printer job until CTRL-F2 is     pressed.
    #     docpath: The path where the output files are stored.
    #     timeout: (in milliseconds) if nonzero: the time the page will
    #              be ejected automatically after when no more data
    #              arrives at the printer.
    printer=true
    dpi=360
    width=85
    height=110
    printoutput=printer
    multipage=false
    docpath=.
    timeout=0

    [parallel]
    # parallel1: parallel1-3 -- set type of device connected to lpt port.
    #            Can be:
    #               reallpt (direct parallel port passthrough),
    #               file (records data to a file or passes it to a device),
    #               printer (virtual dot-matrix printer, see [printer] section)
    #            Additional parameters must be in the same line in the form of
    #            parameter:value.
    #              for reallpt:
    #              Windows:
    #                realbase (the base address of your real parallel port).
    #                  Default: 378
    #                ecpbase (base address of the ECP registers, optional).
    #              Linux: realport (the parallel port device i.e. /dev/parport0).
    #              for file: 
    #                dev:<devname> (i.e. dev:lpt1) to forward data to a device,
    #                or append:<file> appends data to the specified file.
    #                Without the above parameters data is written to files in the capture dir.
    #                Additional parameters: timeout:<milliseconds> = how long to wait before
    #                closing the file on inactivity (default:500), addFF to add a formfeed when
    #                closing, addLF to add a linefeed if the app doesn't, cp:<codepage number>
    #                to perform codepage translation, i.e. cp:437
    #              for printer:
    #                printer still has it's own configuration section above.
    # parallel2: see parallel1
    # parallel3: see parallel1
    #    dongle: Enable dongle
    parallel1=enabled dev:lpt1
    parallel2=disabled
    parallel3=disabled
    dongle=false

But, after these configurations I can't do my program to print, I can't change these programming because I don't have the source code, probably programmed in Clipper.

Best Answer

You should be able to fix the printing with the correct configuration to the SVN-Daum version of DOSBox from http://ykhwong.x-y.net/

Here's the relevant parts of a correct configuration file to print from Windows 8.1:

#     Enable printer emulation in Windows using print dialog
#     dosbox-SVN-Daum.conf
#     C:\Program Files (x86)\DOSBox SVN-Daum\TOOLS\Run DOSBox configuration.bat

[printer]
#     printer: Enable printer emulation.
# printoutput: Output method for finished pages: 
#                png     : Creates PNG images (default)
#                ps      : Creates Postscript
#                bmp     : Creates BMP images (very huge files, not recommend)
#                printer : Send to an actual printer (Print dialog will appear)
#   multipage: Adds all pages to one Postscript file or printer job until CTRL-F2 is     pressed.
#     timeout: (in milliseconds) if nonzero: the time the page will
#              be ejected automatically after when no more data
#              arrives at the printer.
printer=true
printoutput=printer
multipage=true
timeout=10000

[parallel]
# parallel1: parallel1-3 -- set type of device connected to lpt port.
#            Can be:
#               reallpt (direct parallel port passthrough),
#               file (records data to a file or passes it to a device),
#               printer (virtual dot-matrix printer, see [printer] section)
parallel1=printer

Boom, you're printing using the Windows print dialogue. Personally, I like printing to a PDF first using PrimoPDF and then printing once I see the output.

One thing that tripped me up is that multipage=true means that you get stuck "Spooling" in Windows until you hit CTRL+F2. You can fix this with a sufficient timeout that exceeds the number of milliseconds that you will ever have between page output from your program. I have mine set to 10 seconds.

Also, once you set the printer on the SVN-DAUM DOSBox one time using the Windows print dialog box, then it's set as that printer until you restart DOSBox (Ctrl-Alt-Home).

Related Question