Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution to Printing LPT port in Window 11x64 22H2 22621.2134 #245

Open
Reynold298 opened this issue Oct 24, 2023 · 9 comments
Open

solution to Printing LPT port in Window 11x64 22H2 22621.2134 #245

Reynold298 opened this issue Oct 24, 2023 · 9 comments

Comments

@Reynold298
Copy link

https://learn.microsoft.com/en-us/troubleshoot/windows-server/deployment/enable-plug-play-for-parallel-port-devices

leecher1337 added a commit that referenced this issue Oct 24, 2023
@theliz12x
Copy link

Hi, i've an iusse using an lpt port connected under Win11 via NET USE in the dosprompt.
If i use the LPTX directly in the cmd prompt for example using the command type textfile > LPT3 it works. if i use the LPT3 as a textfile "inside" a dos application, the application get stuck and the print does not start

@leecher1337
Copy link
Owner

You can try with dospr instead
#161

@emendelson
Copy link

emendelson commented Mar 7, 2024

Is it OK to ask a question about dospr here? I'm trying to figure out how to print a file with ESC/P output to an HP LaserJet, and when I enter the command dospr -f epson.seq c:\path\to\file (with the current directory being the one with dospr and epson.seq) the result is that raw code gets printed to my default LaserJet. DOSPrinter.exe prints the expected output, but dospr doesn't. I downloaded from here:

https://www.waldbauer.com/tmp/dl.php?download=dospr

EDIT: I think I didn't take in that it's designed to work with GDI printers, and presumably that's what the problem is here...

@leecher1337
Copy link
Owner

Hi Edward,

If the printer supports ESC/P, you can use the raw mode (-r ), but otherwise -f should work as expected. Maybe the data stream feeded to it contains escap-sequences not in epson.seq file..?
To be able to check this, you can dump your input file here (or send it to me via e-mail) and I can try it with a PDF printer if I get a correct result.
The only prerequisite for dospr is to have the printer working correctly in Windows, as it translates the output to a bitmap that is then spooled to the printer.

@emendelson
Copy link

Hi Ludwig,

I was experimenting to see if I could use dospr to interpret ESC/P data for non-ESC/P printers, for my various WordPerfect and other projects. My printers are all HP LaserJets, which don't have ESC/P support, and, as far as I can see, can't print bitmap data. So I'm probably wasting your time. But here's a small sample output file. DOSPrinter (shareware/commercial) prints it correctly on the LaserJet, so I assume that the data is accurate.

PRNSPL.zip

I don't suppose it's possible to add a switch that creates a PDF (maybe using GhostScript) from the bitmap? Or is that too far away from the scope of the project?

@leecher1337
Copy link
Owner

Hello Edward,

I see [ESC 6] sequence, this sequence seems unknown from what I can see in this manual: https://download.brother.com/welcome/docp000579/cv_td4000_eng_escp_120.pdf

Found it in this implementation:
https://github.com/joncampbell123/dosbox-x/blob/a933f3e6ccf461d58c0989167a66fc02d87670db/src/hardware/parport/printer.cpp#L872

Seems to be "printer upper command characters", from what I can see.

Other commands are indeed not supported, as only ESC/P sequences from printfil were implemented:
https://www.printfil.com/download/epson.seq
So very, very simplicistic implementation for the bare minimum.
Here is a version that contains at least some "advanced" commands. Far from complete, but it can print your sample file:
dospr.zip
Contrary to other opensource projects, dospr drives the Windows GDI printer functions directly instead of using custom bitmap creation routines, so it's pretty fast and simple.
Using it to produce PDF files shouldn't be a big deal, just specify a PDF printer driver with -p, i.e. PDFCreator, FreePDFxp or whatever you prefer.

@emendelson
Copy link

Hello again, and thank you. Obviously, this is progress, but I'm still getting random characters when I print to my LaserJet or any PDF driver:

abc.pdf

I doubt it's worth your time to fix this, as anyone who needs to print ESC/P files can use one of the commercial options.

@leecher1337
Copy link
Owner

You need to specify the full path to epson.seq in -f command, i.e.:

dospr -f c:\temp\epson.seq -s c:\temp\prnspl

and you will get this:
DOSprinter.pdf

@emendelson
Copy link

Of course! I forgot all about the .seq file. Apologies for wasting your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants