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

Chr(27)+Chr(15) for condensed printing in FPD26

Status
Not open for further replies.

mstrcmtr

Programmer
Nov 14, 2007
103
PK
Chr(27)+Chr(15) Used for condensed printing in FPD26

Printing condensed okay on Printer Cannon BJC-1000 with parallel port but now Cannon cartridge not available as well as printer obsolete

Anyone know the list of substitutes Printers supported Parallel port as well as Condensed printing in FPD26

Tried HP Laserjet 1320 but not supporting condensed printing in FPD26
 
Rather than looking for a compatible printer, it would make much more sense to stop using control codes and switch instead to using a Windows printer driver and Windows fonts.

Connect your Laserjet (or any other modern printer) to the USB port or a local network. Then install its printer driver. To get the effect of condensed print, either use a smaller print size, or select a condensed font. For example, if your normal font is Arial, then use Arial Narrow for the condensed print.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Sure, if the whole report text should be condensed, that's also simple in a normal FRX report.

I also second Mike for the long run. For whatever details your report has, you can surely solve your reporting with FRXes. Many people never did any other reporting.

I can imagine using control codes on some printer directly doesn't only allow to switch to condensed for a whole report, you can switch between all kinds of different font styles at any time, in the middle of a sentence, etc.

When it comes to variety of printing in font styles not only per report control, but within a passage of text, then you may automate Word and print the doc(x) resulting from that. Create HTML and automate a browser to print that, use RTF and embed an RTF control in a VFP report to print that, etc.

Besides, I don't find it, but there is some extension to VFP reports supporting a set of some markup tags. Not many, and as far as I remember neither switching font type nor size, but that should in principle be extensible to also do that. Surely is based on report listener, which in detail allows you to render things via GDI+ with control over every pixel, in extreme.

Bye, Olaf.



 
If you really want to stay with control codes, you could use your Laserjet, but install the Windows Generic/Text Only printer driver. Then search on-line for the PCL5 Printer Language Manual. That will show you the HP codes, including the equivalent of the code for condensed print.

But I really don't recommend this solution, except as a short-term measure. Much better to use a modern printer driver and the appropriate fonts.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I think this is just a case of a misplaced thread

I am assuming that he has an old application, originally written for FPD, that is now running under VFP. If that's not the case, then you're right, Atlopes. It should be posted in the "old versions" forum.

But the solution would still be the same as in my previous post: download for the PCL5 Printer Language Manual, and use whichever codes are specified there for condensed print.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Me said:
download for the PCL5 Printer Language Manual, and use whichever codes are specified there for condensed print

To save you the trouble, I've just done that. The relative codes are specified on p. 136.

To turn on condensed print:

[tt]<esc>(s4S[/tt]

To turn off condensed print:

[tt]<esc>(s0S[/tt]

where [tt]<esc>[/tt] stands for the escape character - CHR(27).

Actually, it's slightly more complicated than that, because you might need to consider the difference between the primary and the secondary font. The manual explains that in detail.

And, of course, this won't work if you are running your FPD app under Windows with a Windows printer driver. If that's the case, refer back to the earlier posts in this thread.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top