Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Records to cursor after Specific Word
Message
From
15/08/2017 23:58:03
 
 
To
15/08/2017 13:16:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01653315
Message ID:
01653336
Views:
51
>Sir, The required file is attached.

Hrm... is the same issue you mentioned in thread # 1653261 where you mentioned having a PCL file?

The file enclosed in the ZIP file seems to contain sequences of data that start with ESC ( CHR(27) ) followed by various other characters -- these look like HPCL sequences (i.e. control codes used for Hewlett Packard brand of printers). Here's a partial decode of the data:
* CHR(27)+"*p290Y"    && set X position to 290 pixel
* CHR(27)+"*p1400X"   && set Y position to 1400 pixel
* "Account Number"
* CHR(27)+"(8U"       && Select Roman-8 Symbol Set
* CHR(27)+"(s1P"      && Select proportional space font
* CHR(27)+"(s17H"     && Set pitch to 17
* CHR(27)+"(s8V"      && select 8 point
* CHR(27)+"(s0S"      && select upright font
* CHR(27)+"(s0B"      && select medium weight
* CHR(27)+"(s16602T"  && select typeface #16602
* CHR(27)+"*p290Y"    && set Y position to 290 pixel
* CHR(27)+"*p1750X"   && Set X position to 1750 pixels
* "405651132"
* ...
What you'll need to do is to separate out the control code information from the actual printed data -- which would require you to essentially interpret the data in the same way that the printer would interpret them. This could get a bit involved, since you'll have to have a list of all the patterns you'll have to interpret. Even if you do that -- if the printer model or brand is changed, then you're likely going to have a *completely different* set of control codes to handle (i.e. the control codes would be depend on the printer brand and model) -- and that would be a real big mess.

You might want to consider getting the information in a more generic format -- perhaps you can find out if there's an export option in the software that generated the file? If there isn't any other way than capturing the print output, perhaps you can select the generic text printer as the printer driver when you create the data file to operate on -- which should eliminate a lot of the extra formatting codes you need to handle.

FYI -- the following URL is the reference I used for manual decoding of the data:
http://www.pclviewer.com/resources/reference/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform