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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 9 and mag strip encoder

Status
Not open for further replies.

DSummZZZ

Programmer
Oct 24, 2000
4,250
US
Here's my scenario.
I have a legacy app which was originally developed using FP 2.x which I have almost finished re-developing in VFP9. Part of this app is used for issuing membership/loyalty cards.
On the front of the card is printed the member name and number. On the back is a magnetic strip which is encoded with the member number and a few other bits of data.
The front is printed using whatever Windows font we choose, and the mag strip is encoded using special mag strip fonts developed by the card printer manufacturer which when 'printed' are interpreted by the printer as mag strip encoding rather than an image to be printed on the card.
For the life of me, I can't get VFP9 to encode the mag strip. I had to issue SET REPORTBEHAVIOR 80, print the card, then go back to SET REPORTBEHAVIOR 90 to run other reports.
For lack of a better way to word this question, does anyone know how I can get VFP9 to output encoded data rather than think it should be generating an image?


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave,

Hve you tried printing the encoded data from, say, Microsoft Word? Presumably, you can do that by formatting some text in a Word document with the special mag strip fonts.

The reason I suggest this is that it will at least eliminate VFP as a variable.

Sorry I can't suggest anything else just now.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I don't know how these mag stripe fonts are made and how they differ from normal fonts. Canyou embed some program logic in a font leading to write to a mag stripe rather than printing some shapes? The reportbehaviour 80 differs from 90 by using GDIPlus vs not using it. I would expect the inverse, as gdiplus of course is a normal way to handle graphics in Windows, especially for printers, GDI printers for example, but not only those.

The secret must be the way VFP adresses gdiplus to draw fonts. What kind of font is this, is it a TTF? Or some other type?

Bye, Olaf.
 
Mike,
It's all VFP9. I can encode the cards using any other app. FP 2.x and VFP6 included. It's only VFP9 that it don't work with, unless REPORTBEHAVIOR is set to 80.

Olaf,
That's basically how the fonts work. Some sort of program logic sent to the card printers to let them know they should take what is in the mag strip font field and encode that data on the mag strip. They are not True Type, but manufacturer (DataCard) specific. There are three fonts. One each for track one, track two, and track three.
I'm quite sure GDI+ is intercepting that data rather than letting the printer driver talk to the printer. I just didn't know if there was some way to tell GDI+ to NOT take the font and generate an image from it. Rather, let it pass through to the printer unmodified.

I'm guessing the only way to tell GDI+ to let the info pass is to not use GDI+.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
The question remains, what type of font is this? You can only handle ttf, postscript (type1) opentype and perhaps some other fonts. Printer installed fonts can't be part of an FRX at all, as far as I know. The only way to use printer specific fonts is not using the Windows printer driver model at all and printing in the old FP2.6 style, directly addressing the printer through Generic Text printer driver.

I don't know how you could add some different type of font even in reportbehavior 80, in legacy FRXes, so it seems you're jus lucky it works with the old reportbehavior.

Bye, Olaf.
 
It's only VFP9 that it don't work with, unless REPORTBEHAVIOR is set to 80.

Dave, so are you saying that it does work with REPORTBEHAVIOR 80?

If so, what's wrong with simply setting REPORTBEHAVIOR to 80 before you start printing? Or am I still missing something?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Olaf,
Just to elaborate a bit more as I was totally unfamiliar myself before I used them...
These fonts and printer driver are developed by the printer manufacturer to basically, make the developer's life easier. The printer driver is installed just like any other printer driver, and the fonts are installed just like any other font. Once installed, the font can be selected - just like any other font - from any application be it VFP, MS Word, Excel, ... even Notepad. Just as you would select some text then select say, 'Arial, 10', you can select some text and then select 'Mag Stripe 1', and track 1 of the mag stripe will be encoded with the selected text. Of course, it's up to the user to ensure the data selected is valid for whatever may read the card.
So yes, a field in the report can be defined as 'Mag stripe 1', with a value of '00001234' and that's what will be encoded, after which the member can slip their card in a mag strip reader and member info for '1234' retrieved from a database.

Which leads me to Mike's response...
Yes. It works fine with prior versions. I have used it with 2.5, 2.6, VFP6, and VFP7. I never installed VFP8 so I can't vouch for that. And yes, it will work with VFP9 if I set REPORTBEHAVIOR 80. So you're not missing something, and really it isn't a problem but more of a challenge I was hoping to overcome. I spent a couple days trying to figure out why I couldn't get it work on my computer until it finally clicked in my head that the VFP9 report output may be causing me grief and not some flaw in my system. I thought there may be a way to get around using that setting with a report listener or something, but just using that setting seems to be a more sensible substitute.

Thanks for the consideration though. I appreciate the thought and time spent!


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Well,

is the display of the mag stripe font your only problem in reportbehavior 90? If so, have you thought about resizing report controls to 0 height and/or width and uncheck "expand with overflow"? What is displayed anyway? The data? The text, the number you want to write to the magstripe? What is the difference in the legacy report behavior? How does it not display that font? What really is the phenomenon at all?

Bye, Olaf.
 
Olaf,

What happens is the text, i.e., the numbers to be encoded (member number data such as: 00001234 ) is printed on the face of the card INSTEAD OF encoding the mag strip. If it were encoding the strip along with printing on the face, I could definitely work around it. If I use REPORTBEHAVIOR 80, it does not print on the face and it does encode the mag strip.

How does it not display that font?
The printer driver intercepts the data prior to printing. I'm guessing it would be akin to sending PCL codes.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top