This is a quick and dirty I have used in the past, which can be used in
conjunction with STARTJOB or to write the commands to a text file.
Syntax is
PROGNAME option {TEXTFILEPATH}
e.g. HPCTRL DUMMY C:\temp\HP17CPI.TXT
Then as Dan pointed out add the -h C:\temp\HP17CPI.TXT as part of the SP-CREATE
or SP-DEVICE statement.
ESC = CHAR(27)
CPI17 = ESC:'&k2S'
IF SENTENCE(1) = "MARGIN" THEN
CPI17:= ESC:'&a7L'
END
IF SENTENCE(2) THEN
OPENSEQ SENTENCE(1) TO TEXTPATH ELSE NULL
WRITESEQ CPI17 ON TEXTPATH ELSE STOP 'WRITESEQ'
CLOSESEQ TEXTPATH
END ELSE
PRINT CPI17:
END
From: [email protected] <[email protected]> On Behalf Of Daniel Klein
Sent: Wednesday, July 11, 2018 8:53 AM
To: [email protected]
Subject: Re: FORM QUEUE NAME and FORM QUEUE NUMBER
What Mark was alluding to was to use the -h<file> option with the 'lp' command
when you define the form queue with SP-CREATE, e.g.
SP-CREATE MYQUEUE lp -h<file> -d<device>
where <file> contains the PCL sequence and <device> is the printer name.
You would need to specify the full path to the <file>.
All of this assumes you are on Windows.
To see all of the 'lp' options:
lp -?
On Wed, Jul 11, 2018 at 9:29 AM, Patrick McCann <[email protected]
<mailto:[email protected]> > wrote:
Hi Mark,
Thank you for the information. This sounds like what might be happening.
Can you provide me a quick example of the process you are describing?
That would be very helpful in understanding how to set-up and test it.
Thank you,
Patrick
On Wednesday, July 11, 2018 at 12:45:49 AM UTC-7, Mark Hogden wrote:
We have found that many HP printer will page eject when the basic program is
called to change font etc, and almost always if the reset command is included.
In our experience it's generally more reliable to write out the PCL commands to
files and attach them to the queues using the -h option.
On Jul 11, 2018, at 04:04, Patrick McCann <[email protected]
<mailto:[email protected]> > wrote:
Hi Daniel,
I copied jspform_deflt to jspform_custom following your example.
I then created a small program called HP_PCL_C12L coded like this -
$INCLUDE FILE.LIB.CUS HP.COMMANDS
$INCLUDE FILE.LIB.CUS HP.PCL
*
PRINTER ON
PRINT HP.LANDSCAPE:HP.COMPRESS
PRINT "THIS IS A TEST LINE 1"
PRINT "THIS IS A TEST LINE 2"
*
STOP
END
And another called HP_RESET coded like this -
$INCLUDE FILE.LIB.CUS HP.COMMANDS
$INCLUDE FILE.LIB.CUS HP.PCL
*
PRINT HP.RESET
*
STOP
END
I then added the following to the jspform_custom file
STARTJOB HP_PCL_C12L
and
ENDJOB HP_RESET
Here is my testing and results -
SP-ASSIGN =F4
SP-TYPE F4 custom
LIST PTRS LPTR
On the first page, I do see the two "TEST" lines printed in the HP_PCL_C12L
routine and they print correctly e.g. landscape and compressed print.
That is the only thing on the first page. Almost as if it is its own unique
print job.
Then an empty page
Then the PTRS file listing in portrait and larger print. e.g. normal print.
Then an empty page.
Based on this it does call the HP_PCL_C12L routine from jsform_custom. It just
doesn't work as I expected it to.
I guess I am not understanding something about this flow? Is using a program to
"PRINT" the PCL codes correct?
The other test I tried was printing a job from the Spooler.
SP-ASSIGN =F4
SP-TYPE F4 custom
SP-EDIT 3
Then spool the job.
The results were that ONLY the spooled job printed. It printed portrait and
larger font e.g. normal print
The two "TEST" lines are NOT printed. It appears the HP_PCL_C12L routine is NOT
called from jspform_custom.
Then a blank page
Is my understanding of "The 'set_pcl' and 'reset_pcl' would be your programs
that send the PCL sequences to the printer." correct? I.e. use of a basic
program to send the codes?
Thank you for your help.
Patrick
On Tuesday, July 10, 2018 at 4:25:44 AM UTC-7, Daniel Klein wrote:
Yes, the way this is done is to use a custom form type. Take a look at
'$JBCRELEASEDIR/config/jspform_deflt'.
Use
STARTJOB set_pcl
and
ENDJOB reset_pcl
to set the PCL sequences before and after print job are despooled.
The 'set_pcl' and 'reset_pcl' would be your programs that send the PCL
sequences to the printer.
Don't forget to assign the custom form type to the form queue. For example, if
the form queue is HPLASERJET and the form type is 'jspform_custom' then
SP-TYPE HPLASERJET custom
will assign 'custom' to the HPLASERJET queue.
Daniel Klein
On Fri, Jul 6, 2018 at 11:49 PM, Patrick McCann <[email protected]
<mailto:[email protected]> > wrote:
Again, Thank you Daniel. Very good detailed information. I will put this away
for later reference.
You have helped me get past several hurdles and helped me with my understanding
of the the Spooler.
I have one last hurdle related to printing that I am still trying to figure out
a solution for.
I will go ahead and describe it here for you and any others to offer any
suggestions or possible solutions.
Problem -
I only have one printer. An HP Laserjet 500 MFP M525.
I need to print several different report formats to this printer e.g. 80
column, 132 column, and varying font sizes.
In my previous environment (UniVerse on a Windows 2k Server) I was able to
modify the SP.ASSIGN program to use a file I created.
The SP.ASSIGN was a program that executed the SETPTR command behind the scenes.
SETPTR in that environment had more options than are available in jBASE 5.7.
I was able to utilize these other options to accomplish my requirements. By
reading the file I created that held the options I wanted, everything was
correctly set during assignment of the printer (SP-ASSIGN).
Here are a couple examples of records from the file I created - It held the
printer, page width and length, top and bottom margins, print mode, font type,
size, and the other available options I needed.
I would parse out the forms assignment from the SP-ASSIGN, read the file, get
the options, and execute the SETPTR command with the required options.
0
TOP
.P
TOP
001 HP5SI
002 ,132,59,0,0,
003 GDI,FONTNAME Courier,FONTSIZE 7
004
005
006 132 COLUMN
3
TOP
.P
TOP
001 HP5SI
002
003
004
005 3
006 &HOLD& OUTPUT
BOTTOM
jBASE support mentioned I would need to use jspforms which I will start
researching, but thought I would ask the question now for any
comments/suggestions.
Thank you,
Patrick
On Thursday, July 5, 2018 at 3:22:57 PM UTC-7, Daniel Klein wrote:
You are correct, the 'n' in this case is the channel number and is used with
PRINT ON.
These statement groups are equivalent (using the queue names from my original
post):
SP-ASSIGN 42=VENUS
SP-ASSIGN 52=EARTH
SP-ASSIGN F2 R42
SP-ASSIGN F3 R52
SP-ASSIGN Q2 R42
SP-ASSIGN Q3 R52
SETPTR 42,,,,,,VENUS
SETPTR 52,,,,,,EARTH
[I'm not as fluent with SETPTR but I do know that the first parameter is the
channel. Not sure if I got the right number of commas in there. However, I find
the SP-ASSIGN syntax more intuitive and can do most, if not all, of the things
SETPTR can.]
Once the channels are assigned to the queues, you can do things like this in a
BASIC program
PRINTER ON 42
PRINTER ON 52
PRINT ON 52 "Launch the rocket to VENUS" ;* Prints to the EARTH form queue
PRINT ON 42 "Houston, we have a problem!" ;* prints to the VENUS form queue
Daniel
Don’t believe everything you read on the Internet...unless I wrote it. ;-)
On Thu, Jul 5, 2018 at 1:32 PM, Mark Hogden <[email protected]
<mailto:[email protected]> > wrote:
=fqname is the same as 0=fqname which equates to the default PRINT in JBC
1=fqname is used for PRINT ON 1
You can go up to 99=fqname if memory serves.
On Jul 5, 2018, at 09:24, Patrick McCann <[email protected]
<mailto:[email protected]> > wrote:
Hi Daniel,
Thank you for the excellent and detailed information. It really gives me a good
understanding between the two.
Now having a better understanding of the two I have some follow-up questions I
am hoping you might be able to provide some help on.
I would like to understand the following -
Rn assigns specific report number n. Only valid if an equals sign (=), is not
present in the command line.
Is this command in anyway related to the form queue number? I don't believe so,
but am not sure. I think it is used with "PRINT ON {n}", but would like to know
for sure.
And last, in the following command -
SETPTR {channel},,,,,,BANNER 'Some user text'
Is {channel} in anyway associated with the form queue number or is it just used
to set-up the page characteristics for the "PRINT ON..."?
Thanks again for your help.
Patrick
On Wednesday, July 4, 2018 at 7:47:37 PM UTC-7, Patrick McCann wrote:
Hi,
I am hoping somebody can help make sense of this for me.
I am trying to understand the difference/relationship/etc... between the two. I
have read the documentation and still can't figure it out.
Looking at the following from the documentation, it talks about the queue
number, and only valid if NO (=) sign is present.
Fn assigns specific form queue number n. Only valid if an equals sign (=), is
not present in the command line.
Does every form queue name have an associated form queue number? If so, how it
is defined? Can it be changed? What is the purpose?
Any help on this would be greatly appreciated.
Thank you,
Patrick
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected] <mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected] <mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected] <mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected] <mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected]
<mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected] <mailto:[email protected]>
To unsubscribe, send email to [email protected]
<mailto:[email protected]>
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected]
<mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
---
You received this message because you are subscribed to the Google Groups
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.