Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Printing problem - clipper & PLT files
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 10th November 12:54
piko_kekec
External User
 
Posts: 1
Default Printing problem - clipper & PLT files



Hallo!

I have problems with printing PLT files on HP LaserJet printer. In
fact, I do not know how to include HP-GL/2 code from PLT files in my
clipper code.

Maybe it would be easier to send PRN code from my Clipper code, but I
still do not know how?

I start with:

? CHR(27)+"E" // reset

? CHR(27)+"*c0F" // delete fonts

? CHR(27)+"&l26A" // paper A4

? CHR(27)+"&l0O" // portrait

? CHR(27)+"(17U" // 852 character code

? CHR(27)+"&l1X" // no. of copies

? CHR(27)+"&l142U" // left margin

? CHR(27)+"(s1p11v0s4b4362T" // font

? CHR(27)+"&a0R" // start

...

// and here I want to print my signature (handwrited)

? CHR(27)+"&a42R"

cUkaz := "copy /B signature.prn" ???

Any easy solution?

Best regards!


--
Posted via http://dbforums.com
  Reply With Quote


 


2 10th November 12:54
gabor salai
External User
 
Posts: 1
Default Printing problem - clipper & PLT files



you have to perform two tasks:
a) obtain raster graphics image of desired picture
b) create pcl equivalent of that image

a)
scan your signature and save it as bmp file, only black/white!
use c53 function gbmpload() to get it in memory

b)
here is pcl sequence
??chr(27)+"*t300R" // set resolution, here is 300dpi
??chr(27)+"*p100x200Y" // set starting coo in dots, here is x=100, y=200
??chr(27)+"*r1A" // image will start on current coo
??chr(27)+"*b0M" // you will send uncompressed image data, it is the
simpliest way to work
// you are now going to send each horizontal pixel line from your image
// let linenum be a number of pixel lines in loaded bitmap
for i=1 to linenum
// let pixlin[i] be a sequence of bytes for current pixel line
??chr(27)+"*b"+ltrim(str(len(pixlin[i])))+"W"+pixlin[i]
next
??chr(27)+"*rB" // end of raster data
  Reply With Quote
3 10th November 12:55
klas.engwall
External User
 
Posts: 1
Default Printing problem - clipper & PLT files


Assuming that you really mean that your file is HP-GL/2:

You probably want to print this file several times, so you should try
to embed the HP-GL/2 code in a PCL wrapper and then download it in one
piece to the printer. It looks like you are half-way there already.

Below is a list of commands I once used for a similar purpose. Open
the HP-GL file with a text editor that allows you to input the escape
character directly, and then add something similar to what I did (plus
your own setup code, of course). Please note that I was printing in
landscape mode, so you will have to turn the picture frame around. And
perhaps you need to change its size too. The quotes should of course
be omitted, and there must be no line breaks in the PCL code. All
HP-GL commands must be terminated with a semicolon.

chr(27)+'E' // Reset the printer
chr(27)+'&l26A' // Set paper size to A4
chr(27)+'&l1O' // Landscape orientation
chr(27)+'&l5E' // Top margin 5 lines
chr(27)+'*c7200x5400Y' // Set Picture Frame to 10" by 7.5"
chr(27)+'*p0x0Y' // Move to top left corner
chr(27)+'*c0T' // Set picture frame anchor point at
// current PCL position
chr(27)+'*c10k7.5L' // Set HPGL plot size to 10" by 7.5"
chr(27)+'%1B' // Enter HPGL with pen att current PCL
// position
'IN;' // Initialize
'SP1;' // Select pen # 1

// HP-GL/2 code goes here

chr(27)+'%1A // Enter PCL mode at current HP-GL pen
// position
chr(27)+'E' // Eject paper

You will get a print file that is self-contained and will be printed
and ejected immediately upon download. Adding other things on the same
page requires more work <g>.

Let me know if you need further assistance.

Klas

-------
klas dot engwall at engwall dot com

Spammers, please use this address :-) mailtoostmaster@[127.0.0.1]
  Reply With Quote
4 10th November 12:56
External User
 
Posts: 1
Default Printing problem - clipper & PLT files


Sorry, but kekec is slovene so - don't read it if you don't understand
slovene.


Kekec, ce prav razumem, bi rad printal podpis na laserski tiskalnik.
Mene je ta problem zrl vec kot leto dni.. zdaj pa imam resitev, ki je
relativno preprosta, ce poznas vsaj malo PCL in nic ne stane.. ce te
se zanima, povej. (najboljse, ce pustis emajl - ta moj ni tapravi)
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666