Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Font named Control used in a VFP report

Status
Not open for further replies.

cfsjohn

Programmer
Sep 1, 2016
59
0
6
US
I have a POS app. Many years ago I embedded control characters in a VFP report to make the EPSON TM-T88V receipt printer execute the cutter. Below you will see a screen print of my report. Notice the small g is placed at 2 places in the report. If you look at the properties of that object it has a font of Control. If you click the elipses... there is no such font to select. Perhaps a font named Control was something that I used to have on an earlier development workstation or the font named Control is something that comes with Foxpro but I just don't recall how to set a label's font to Control or perhaps it was a font that came with the receipt printer? I really do not recall. The issue I am having: As long as I run my app from a local workstation or server the cutter on the printer cuts the receipt at each place where those little g's exist in the report. If I run my app over terminal services (so via RDP) the cutter does not work. So I guess I would summarize that control characters embedded in the report do not work over RDP.

controlchars_fkcd8b.jpg


Thanks,
John
 
 https://files.engineering.com/getfile.aspx?folder=a5ac46f7-9d51-4934-870f-d5cd5f6b1daa&file=controlchars.jpg
There is no font named Control that comes with VFP, and none that comes by default with Windows. Given that the label properties window only allows you to specify a font that actually exists, there must have been a font with that name on the system when the report was created.

In any case, I can't seen how setting a label to a particular font could cause it to send a control code to the printer. Are you sure there are no control codes actually embedded in the label? Although that wouldn't explain why it is working locally but not over RDP.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The only font I know is specific to earlier fox versions is FoxFont.

If you look into VFPs Home folder you will have installation logs in "Visual FoxPro 9.0 Professional - English\Logs" the largest file has each sgtep of the installation regarding which files are copied where.
There is no ttf in all the log and the only font related line in the msi log I find is related to - foxfont.fon:

MSI (s) (44:14) [18:44:14:848]: Executing op: FileCopy(SourceName=foxfont.fon|foxfont.fon,SourceCabKey=FL_foxfont_fon_____X86.3643236F_FC70_11D3_A536_0090278A1BB8,DestName=foxfont.fon,Attributes=0,FileSize=16596...

Which means a control font is not coming with VFP. At least not VFP9.

The other thing is that a report will only pass through characters 1:1 to the Generic/Text printer. Perhaps the printer also came with a driver that is quite 1:1 and based on some escape sequence control codes, but I don't know without having that printer. I just guess your report is pretty much depending on it and the correct driver to push this through, or you actually only need to print with REPORT FORM... TO FILE and that file then is forwarded to >PRN or whatever. Yout application code should tell you how that FRX ws or is used, shouldn't it?




Chriss
 
one thing is for sure about an EXE used remotely by RDP: Whenever your software uses something attached to a client in the usual non-remote environment, then that would need special configuration to map a remote client side port or printer to the terminal server running your exe. Otherwise you can only print to printers in the server network, not to the POS printer in the shop.

I would ask DevOps, if there are any in your or your customers company that know how to do that. It's not impossible, but it's not just a default. I think there is a section in the RDP connection about shared hardware/ports/drives.

A probably fast track workaround would be to work via PDF. I know POS printers that actually in special cases print a contract in PDF form to the POS system receipt printer.

Chriss
 
If you are using a Generic/Text Only driver, that would imply that the control codes are embedded in the report. According to the documentation for the EPSON TM-T88V, there is a code to control the paper cutter, but it is a secret. That's right. The manual says, "To use ESC/POS commands, you need to agree to a nondisclosure contract first and obtain the ESC/POS Application Programming Guide. Ask your dealer for details."

I would assume that you didn't do that, and therefore that you are using an Epson-specific driver, such as the EPSON Advanced Printer Driver. According to the docs, "this driver has controls specific to POS, such as controls for paper cut, a cash drawer, or customer display."

If that's right, it looks likely that the driver is installed on your local system, but for some reason it is not being found over RDP.

What happens if you do GETPRINTER() or APRINTERS() both locally and over RDP? Can you see anything that looks like an Epson driver.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike Lewis said:
the control codes are embedded in the report
g would speak for ESC+g or something in that direction. You should look into the label caption. It could be set to an expression like =CHR(27)+"g" or ((CHR(27)+"g") and only the g is visible in the FRX layout.

But since FRXes usually don't just output the label text as pure text but use the printer driver (usually GDI printer driver) and set the font and send the caption to print in that font, the ESC wouldn't go directly to the printer. Since it's non-printable you will simply get a g printed. Unless the Epson driver turn that into PCL or whatever printer codes.

Chriss
 
I wrote this app back in 2000 and it has been modified just about every day since then. It's a loooooong history. We have been running the app over RDP for several years now. Printing over RDP has been a challenge but we have very few issues now. With regard to this specific printing issue, I believe I did get help from Epson to get this accomplished and I also believe we used a generic text driver. Somewhere along the years, I quit dealing with the hardware and I kinda sorta believe the person that does that started used something like the Easy Print or advanced printer drivers. That's probably where this became an issue. Reaching out to Epson is a pain. Everything is so proprietary and it might take a week to get to speak with the correct person. I was really hoping some of you guys would just happen to know what that font named Control meant and that is was something I had simply forgotten. Obviously that is not so. I have found another solution. It turns out the printer has a setting that causes the cutter to cut at the end of a print job. That part is working. Notice the receipt/report that I showed you is really 2 receipts in one. The top section is a detailed receipt (each item purchased) and a place for a signature then the "cutter command" then a summary receipt. What'n not working is the cut between the detailed receipt and the summary. I can split this into 2 reports one for just the detailed section and then one for the summary . That way the cutter runs at the end of both reports and voila, problem solved. I do appreciate your input,
John
 
John, good to see you've found a solution. I can't speak for Chris, but I'm sure I wouldn't have been able to solve it.

This point about the Epson information being proprietary - and having to sign a non-disclosure agreement to see the control codes - I find that extraordinary. I wonder when they adopted that policy. Back in the day, I had several Epson manuals lying around the office, with all the codes clearly documented.

Actually, I just found a list of the codes on-line. I see there is one called "Select cut mode and cut paper", which happens to be GS V. I wonder if that's where the "g" comes from. (But this is a cap. G and yours is lower-case.) I better not say anything more on the subject in case they sue me <g>.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Indeed, an automatic cut after each print job is a good solution and I'd also split that report in two.

Chriss
 
Chris, Actually it was separate reports until somewhere back in the turbulent time, I made it a single report. The moral of the story is that there is a good reason why you should never buy a tv with a built-in VCR player. You may end up with a betamax :)
 
Very true. Regarding VFP features of reports you have the reportlistener. That couldd also do wonders, perhaps. But if the a solution is to go back to the original nature of two reports, that's by far best.
Also, if you ever wanted to print these in succession without a print job end in the middle, you can use NOPAGEEJECT on the first. It simply keeps the current print job open and the next report adds to it.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top