Installed 32bit dos box on win10 32bit pc it runs my old dos program well, but when I click on the DOSBox-x DOS menu and click "printers" the box is empty???? What do I do to attach a printer... There are printers attached to my win10 pc. (they are network printers however) I tried to use my program to print to lpt1: and I get a printer error.
Also there is no readme in the windows installer, and there is no description of how to configure or make autoexec bat entries , I was hoping to launch my program in a DOSBox-x window when I open it.
Are there any how to documents or tutorials for just running old dos programs with DOSBox-x?
Thanks in advance
the1fitz
For 'autoexec', see [autoexec] section at the end of default .conf.
My own example (I'm just a fellow DOSBox-X user, hope you can get something out of this example):
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
MOUNT -nocachedir C: D:\EMULATION\DOS
C:
SET PATH=Z:\;C:\VC;C:\ULTRASND;C:\TOOLS;C:\FBC
CD \
C:\ULTRASND\ULTRAMID.EXE -16
VC
@joncampbell123 @aybe
I've just imported back printer emulation code from DOSBox-Daum along with FreeType library into https://github.com/alexat/dosbox-x/commits/printer branch of mine, and it works. Alas, it's not yet ready at all to be a pull request (multiple build warnings are there to be fixed) and is quite large, given entire FreeType library is added.
Don't really know if it's feasible to add such a bit of old and unsupported code though. It is readable and it just seems to work, but that's all to it. Alas, I don't seem to have much spare time recently to finish it as pull request soon enough, so mentioning it just in case you may want to take it over.
What's confusing me is the [parallel] section of the .conf file referring to a virtual dot-matrix printer and saying "printer still has it's own configuration section above." and it isn't there. Could these references either be deleted or a note added saying that it is yet to be implemented?
I've never used Daum but DOSBox MegaBuild 6 did a good job at printing. I don't know if the code is still available though.
Well, with the latest pull request mentioned above accepted, it is like that (identical to Daum build):
[printer]
printer=true
dpi=360
width=85
height=110
printoutput=png
multipage=false
docpath=./print
timeout=0
[parallel]
parallel1=printer
parallel2=disabled
parallel3=disabled
dongle=false
Which is quite logical I think. You direct one (and only one) parallel port to the printer emulation in [parallel] section, and dot matrix printer emulator settings are in [printer] section. Both sections are commented quite fine.
Before it, there were comments in the code about printer emulation, but indeed printer emulation itself was not there. I think there is no release yet with it, but you can always build it from source code and save default config using config.com to get all the comments in.
Thank you for the clarification. I'd downloaded version 0.82.8, the .exe and .conf files are dated 15 July so obviously work has been done since.
DOSBox-X certainly seems far better than plain DOSBox and it'll be utterly fantastic if, and when, it can print.
What model of printer that is emulated?
Whatever Daum's printer code emulates... not sure.
10/04/2005 : Added "Virtual printer support (freetype2)"
PS?
To better answer your question,
The source file doesn't say what model/brand printer it emulates, but the code supports printing to PS (PostScript) or PNG (bitmap rendering). On Windows, it also supports rendering directly to a printer device.
It emulates de-facto standard Epson command set(s), a bit of crossover between models (mostly FX).
Yup! Time to find some drivers.
From the DOSBox-Daum documentation:—
Virtual Printer
The Virtual Printer emulates a color dot-matrix printer that follows the ESC/P2 printing standard.
Features:
Limitations:
I've found telling DOS programs that they are connected to an Epson LQ-800 to work, as does IBM Pro Printer. Epson FX-80 causes the lines to print too far apart meaning they come out five to the inch instead of six.
The courier.ttf was my voluntary change introduced to make it less ugly and more Epson-like in the end result. Otherwise it's indeed Daum code all over.
And a big improvement it is too.
Btw do region selection commands work at least partially correctly? I had to mod this part (code numbers mostly) as well according to Epson docs to make cyrillic print, but have not tested it extensively.
Sorry, I haven't tested that at all. All I can say is that £ prints as £ rather than #, which some printers did in the old days.
We have been creating some draft Wiki pages, that I'm hoping will be added to the wiki here by the next release.
I have added a printing page to it, and for now just copied some data into it from the reference config and what was mentioned on this page. I hope to clean it up a bit more in the next days. If you have anything to add or correct, let me know.
https://github.com/Wengier/dosbox-x-wiki/wiki/Guide:Setting-up-printing-in-DOSBox%E2%80%90X
My observations are:—
The first line says DOSBox-X has support for printing to either a real parallel printer, or to a __text__, PS (PostScript) or PNG file. whereas elsewhere it gives the options of BMP, PS or PNG.
Note: On Linux, __similar to other dosbox config paths__, the use of ~ in paths is not supported. My conf file contains the lines mapperfile=~/.dosbox/mapper-0.83.2.map, captures=~/capture and mount c: ~/.dos and they all work so it seems as if it not working for docpath is unique to that.
Besides that I would suggest adding the fact that you have to supply fonts for it to work.
What I've found out about printing can be seen here: https://github.com/ThePillenwerfer/dosbox-x-32-bit/blob/master/README.md, though it's based on fiddling about rather than knowledge. Feel free to copy any of it that you feel is of use.
The above isn't meant to be critical; writing documentation is a thankless task.
Thanks for that. I will have a look at it. I noticed both here and on vogons that there is a lot of confusion as to how to get printing working in DOSBox. Unfortunately I don't have a real parallel printer or even a PC with legacy parallel port any longer, so I need to rely on reports from others.
The fonts is something that I did not understand, I had noticed it in the source code though.
@ThePillenwerfer did you ever try something like
[parallel]
parallel1=file dev:/dev/parport0
Since supposedly this works on Windows with a real LPT port:
[parallel]
parallel1=file dev:lpt1
I'll give it a try if I can find a suitable cable.
It's beyond my non-existent programming skills but it would be nice if it could also be set to dev:usb or dev:192.168.0.xxx.
The ideal would be if it worked with CUPS like vDOSPlus integrates with the Windows printing mechanism.
Would it be possible to add a function whereby if parellel1=file is set and instruction can be given as to what to do with the file? Something like:—
parellel1=file
file_process=lpr $THEFILE
or
file_process=cp $THEFILE /some/directory
I think the widespread confusion about DOSBox printing isn't helped by the forks that do it defaulting to it's being disabled.
Found a cable and tried dir >lpt1 and got:—
LOG: Parallel 1: Failed to open /dev/parport0
LOG: 17898832 ERROR PIC:Event queue full
repeated dozens of times.
Trying ls > dev/parport0 from a Linux terminal gets:—
ls > /dev/parport0
bash: /dev/parport0: Permission denied
The Daum document has this to say:—
The parallel port device is passed. Security attributes may have to be changed.
Example: parallel1=reallpt realport:/dev/parport0
but gives no instructions.
As I've now referred to it twice it seems as well to attach the Daum document.
Daum Printing.pdf
Yeah your user needs to have permission to print. Just try to temporarily give full permissions.
sudo chmod 777 /dev/parport0
It should get reset when your reboot.
OK, tried that. No error but no action from the printer either. I did follow dir >lpt1 with echo ^L > lpt1.
I can't make it do anything from a Linux terminal either:—
joe@HP:~$ ls > /dev/parport0
ls: write error: Invalid argument
joe@HP:~$ echo hello >/dev/parport0
bash: echo: write error: Invalid argument
HOWEVER, parallel1=reallpt realport:/dev/parport0 does work.
Which FONTS did you end up using on Linux?
For courier.ttf, I will probably use /usr/share/fonts/liberation-mono/LiberationMono-Regular.ttf
But not sure yet for the others.
I am thinking of submitting a patch to DOSBox-X to have it automatically attempt to use system fonts if no FONTS directory is found. But for that to work, I need to have a mapping of the fonts to standard system fonts on Linux and Windows. And for some like ocra.ttf it seems it will be a problem.
Also, can you also show me the output of
ls -l /dev/parport0
I want to know which user/group is the default owner. And which distro are you using?
ls -l /dev/parport0:—
crwxrwxrwx 1 root lp 99, 0 May 7 17:46 /dev/parport0
I'm on Debian 9.12 32-bit.
I've got the original Daum-supplied fonts but for courier.ttf I linked to my hacked version of Courier New — I hacked it to make it less spindly and added some extra characters. How you use any of the others I don't know. I agree that LiberationMono, LiberationSans and LiberationSerif would be good for courier.ttf, roman.ttf and sansserif.ttf. On Windows they could be cour.ttf [Courier New], times.ttf and arial.ttf. PERSONALLY I wouldn't worry about script and ocra.
There's already something about fontpath in the code but it's all commented out.
Ok, for fixing the permissions on /dev/partport0 properly you need to add your user to the "lp" group.
sudo usermod -a -G lp username
Here is what I wrote for the fonts so far:
https://github.com/Wengier/dosbox-x-wiki/wiki/Guide:Setting-up-printing-in-DOSBox%E2%80%90X#setting-up-fonts-for-the-emulated-printer
That looks great to me.
Back in my Windows days I never got on with DOSPRN and had better results with WinPrint. Of course that probably says more about my ignorance than the software, and changes have probably been made to either or both since. WinPrint is also Open Source, which may matter to some people.
@ThePillenwerfer
I think I'm close to done. Please have another look when you can.
p.s. why do you say that the draft wiki pages are Windows oriented? I wrote the majority of it, and I can assure you that it is more Linux then Windows as that is my default platform. I typically need to boot a Windows system specifically to try something.
Nothing to add about the printing as it seems to cover all that I've discovered.
As for the wiki being Windows-centric it's the installation that doesn't seem to cover Linux very well. To start DOSBox-X it says to run dosbox-x.exe, which a Linux user isn't going to get far with. Also there's nothing about the complications of Linux systems caused by there being so many variants. Ubuntu and the like don't use .rpm packages so you've either got to extract the binary or build it yourself. The latter would be especially useful for Version 83.1 as that hasn't got any Linux binaries attached and the instructions in README.md have an error: I spent ages trying to find the package libfluidsynth-devffmpeg before I realised it should be libfluidsynth-dev and ffmpeg. As previously said, I'm no programmer☺.
Besides that on Linux the .conf file seems to have to be in ~/.dosbox to be used by default rather than "in the current directory or in your user directory;" I would assume my user directory to be /home/joe rather than /home/joe/.dosbox. I've tried moving mine to /home/joe, opened a terminal in that directory, loaded DOSBox-X and the .conf file didn't take effect even though it was in the current directory when I typed dosbox-x to launch it.
That reminds me: when I was testing my real parallel port earlier I had to install DOSBox-X on that PC and it ignored the ~/.dosbox/dosbox-x.conf file. Running dosbox-x -printconf revealed it was looking for `.~/dosbox/dosbox-0.83.2.conf'. I'd better open new Issue on that though.
On behalf of current and future users, Thank you for your efforts.
@ThePillenwerfer Ok, your talking about the Wiki landing page. That is a page I did not create myself, it was created by @Wengier who primarily uses Windows.
When I have a moment I may have a look at that page to see if I can make it a bit more generic, or give Linux examples.
I also admit that I may expect Linux users to be more technical then Windows users in the instructions. So if I need to give a path example, I may in some cases only give a Windows example as I expect that Linux users normally understand how to adjust it.
I don't do the packaging, but you could submit a feature request asking for a binary tar.gz file if that makes it easier. You can also install an RPM file on debian with "alien" (not sure if it is installed by default) as such: sudo alien -i package_file.rpm.
As to the default path, that should be ~/.dosbox but you can specify a different config with dosbox-x -conf myconf.conf.
The default config file, as I understood it, should become ~/.dosbox/dosbox-x.conf, but for now it is still looking for a versioned config file.
DOSBox-X will load the dosbox-x.conf file from the current directory for all platforms (Windows, Linux, etc). Then it will try to load the .conf file from the user directory. The latest code will use the user directory ~/.dosbox-x rather than ~/.dosbox.