Skip to main content

I need to print logo as part of an invoice. How can I do that.

I need to print logo as part of an invoice. How can I do that.

"Hello" from Russell. Please allow me to submit an example to you that we have used. This example assumes you are printing to a laser printer and the size if the logo is no larger than 65,000.

First, save the logo into a file (such as "MYLOGO")

SL:
SELECT LOGO ASSIGN TO INPUT LOGOFILE
ORGANIZATION IS BINARY SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.

SELECT PRTFILE ASSIGN TO PRINT "PRINTER"
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.

FD:
FD LOGO LABEL RECORDS ARE OMITTED
RECORD CONTAINS 65000 CHARACTERS
DATA RECORD IS LOGO-RECORD.
01 LOGO-RECORD.
02 LOGO-TEXT PIC X(65000).

FD PRTFILE LABEL RECORDS STANDARD.
01 PRINT-REC PIC X(65000).

Working-Storage:
01 LOGOFILE PIC X(9) VALUE SPACES.
01 PRINT-CODES-LINE.
02 PRINTER-CODE PIC X OCCURS 132 TIMES.


Procedure Division:
OPEN OUTPUT PRTFILE WITH NO REWIND

MOVE SPACES TO PRINT-CODES-LINE
{populate the print record with the codes to reset the printer such as "escape" and "E"}
WRITE PRINT-REC FROM PRINT-CODES-LINE BEFORE 0

MOVE "MYLOGO" TO LOGOFILE
OPEN INPUT LOGO
READ LOGO
WRITE PRINT-REC FROM LOGO-TEXT AFTER 0
CLOSE LOGO

CLOSE PRTFILE.

Of course somewhere in there you will be printing the invoice, but this is how we handle the logos. Maybe not the most efficient way, but it's a way.

Hope this helps.
Thanks.
Russell

I need to print logo as part of an invoice. How can I do that.

"Hello" from Russell. Please allow me to submit an example to you that we have used. This example assumes you are printing to a laser printer and the size if the logo is no larger than 65,000.

First, save the logo into a file (such as "MYLOGO")

SL:
SELECT LOGO ASSIGN TO INPUT LOGOFILE
ORGANIZATION IS BINARY SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.

SELECT PRTFILE ASSIGN TO PRINT "PRINTER"
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.

FD:
FD LOGO LABEL RECORDS ARE OMITTED
RECORD CONTAINS 65000 CHARACTERS
DATA RECORD IS LOGO-RECORD.
01 LOGO-RECORD.
02 LOGO-TEXT PIC X(65000).

FD PRTFILE LABEL RECORDS STANDARD.
01 PRINT-REC PIC X(65000).

Working-Storage:
01 LOGOFILE PIC X(9) VALUE SPACES.
01 PRINT-CODES-LINE.
02 PRINTER-CODE PIC X OCCURS 132 TIMES.


Procedure Division:
OPEN OUTPUT PRTFILE WITH NO REWIND

MOVE SPACES TO PRINT-CODES-LINE
{populate the print record with the codes to reset the printer such as "escape" and "E"}
WRITE PRINT-REC FROM PRINT-CODES-LINE BEFORE 0

MOVE "MYLOGO" TO LOGOFILE
OPEN INPUT LOGO
READ LOGO
WRITE PRINT-REC FROM LOGO-TEXT AFTER 0
CLOSE LOGO

CLOSE PRTFILE.

Of course somewhere in there you will be printing the invoice, but this is how we handle the logos. Maybe not the most efficient way, but it's a way.

Hope this helps.
Thanks.
Russell

I need to print logo as part of an invoice. How can I do that.

Many thanks, I will try this.

I need to print logo as part of an invoice. How can I do that.

Hello Russel,

I'm testing your program, but have trouble with printing (laser). No logo, only hex-codes.
What do I need to do?

Kjell Erik

I need to print logo as part of an invoice. How can I do that.

A couple of questions, please...
Are you printing from a Windows environment or Unix/Linux environment?
If Windows, are the Runtime Configuration entries:
(a) "Printer Enable Esc. Seqs = True"
(b) "Printer Enable Null Esc Seq = False"
(c) "Printer Enable Raw Mode = "True"?

I need to print logo as part of an invoice. How can I do that.

A couple of questions, please...
Are you printing from a Windows environment or Unix/Linux environment?
If Windows, are the Runtime Configuration entries:
(a) "Printer Enable Esc. Seqs = True"
(b) "Printer Enable Null Esc Seq = False"
(c) "Printer Enable Raw Mode = "True"?

I need to print logo as part of an invoice. How can I do that.

Windows.
I send esc seqs to printer (font) in the same program, and that's ok.

I need to print logo as part of an invoice. How can I do that.

Below is a program that I just tested with, which prints the logo as expected (along with the 2 text lines).

My suggestion...
copy your logo file to filename "MYLOGO"
compile the source code program to make sure it compiles ok
run the program.
It will be interesting to see if this works or not. Let me know the results, please.

ID DIVISION.
PROGRAM-ID. PRTLOGO.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
*
>> imp margin-r end
*
FILE-CONTROL.
*
logo SELECT LOGO ASSIGN TO INPUT LOGOFILE
ORGANIZATION IS BINARY SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
*
SELECT PRTFILE ASSIGN TO PRINT "PRINTER"
ORGANIZATION IS SEQUENTIAL
ACCESS IS SEQUENTIAL.
*
*
DATA DIVISION.
FILE SECTION.
*
logo FD LOGO LABEL RECORDS ARE OMITTED
RECORD CONTAINS 65000 CHARACTERS
DATA RECORD IS LOGO-RECORD.
01 LOGO-RECORD.
02 LOGO-TEXT PIC X(65000).
*
FD PRTFILE LABEL RECORDS STANDARD.
01 PRINT-REC PIC X(65000).
*
WORKING-STORAGE SECTION.
01 P-RELEASE PIC X(06) VALUE "v1.0.0".
01 SYS-DATE.
02 SYS-YR PIC 9(4).
02 SYS-MO PIC 99.
02 SYS-DA PIC 99.
01 D-DATE.
02 D-MO PIC 99.
02 FILLER PIC X VALUE "/".
02 D-DA PIC 99.
02 FILLER PIC X VALUE "/".
02 D-YR PIC 9999.
01 WK-SPACING-PRINT-1.
02 WK-SPACING-ESC-1 PIC 999 COMP-1 VALUE 27.
*
01 WK-CHAR-ESC REDEFINES WK-SPACING-PRINT-1.
02 FILLER PIC X.
02 WK-ESC-FIELD PIC X.
*
01 PRINT-CODES-LINE.
02 PRINTER-CODE PIC X OCCURS 132 TIMES.
logo 01 LOGOFILE PIC X(9) VALUE SPACES.
01 P-RESET-PTR-CODE PIC X(2) VALUE "E".

PROCEDURE DIVISION.
MAIN SECTION.
MAIN-RTN.
INITIALIZE SYS-DATE
ACCEPT SYS-DATE FROM CENTURY-DATE
DISPLAY SPACES LINE 1 COL 01 ERASE
MOVE SYS-MO TO D-MO
MOVE SYS-DA TO D-DA
MOVE SYS-YR TO D-YR
DISPLAY D-DATE LINE 01 COL 01
DISPLAY P-RELEASE LINE 01 COL 75
DISPLAY "Print Logo" LINE 02 COL 30
DISPLAY ALL "=" LINE 03 COL 01 SIZE 80 REVERSE

OPEN OUTPUT PRTFILE WITH NO REWIND

* reset printer
MOVE SPACES TO PRINT-CODES-LINE
MOVE "~E~&l6D" TO PRINT-CODES-LINE
INSPECT PRINT-CODES-LINE REPLACING ALL "~" BY WK-ESC-FIELD
WRITE PRINT-REC FROM PRINT-CODES-LINE BEFORE 0

MOVE "MYLOGO" TO LOGOFILE
OPEN INPUT LOGO
READ LOGO
WRITE PRINT-REC FROM LOGO-TEXT AFTER 0
CLOSE LOGO

MOVE SPACES TO PRINT-CODES-LINE
pcl *****Set PCL code: Print 16 lpi
MOVE "~(s10H~&l6D" TO PRINT-CODES-LINE
INSPECT PRINT-CODES-LINE REPLACING ALL "~" BY WK-ESC-FIELD
WRITE PRINT-REC FROM PRINT-CODES-LINE AFTER 0

MOVE SPACES TO PRINT-CODES-LINE
MOVE "~*p0x425Y~(s10h0s0B" TO PRINT-CODES-LINE
INSPECT PRINT-CODES-LINE REPLACING ALL "~" BY WK-ESC-FIELD
WRITE PRINT-REC FROM PRINT-CODES-LINE AFTER 0

* Print Cust Name & Addr
MOVE SPACES TO PRINT-CODES-LINE
MOVE "~(s10H~*p100x537Y" TO PRINT-CODES-LINE
INSPECT PRINT-CODES-LINE REPLACING ALL "~" BY WK-ESC-FIELD
WRITE PRINT-REC FROM PRINT-CODES-LINE

* Print Cust Line 1
MOVE SPACES TO PRINT-REC
MOVE "My Company Name" TO PRINT-REC
WRITE PRINT-REC

MOVE SPACES TO PRINT-REC
MOVE "My Company Address" TO PRINT-REC
WRITE PRINT-REC

WRITE PRINT-REC FROM P-RESET-PTR-CODE AFTER 0
CLOSE PRTFILE.
*
END-PROGRAM.
GOBACK.

I need to print logo as part of an invoice. How can I do that.

Hello rghaile,

For me it didn't work.

Reading logo-file, and 'write print-rec from print-code-line' , the printer pull out pages with control codes.
I use an old compiler running sco-unix.

Kjell Erik

I need to print logo as part of an invoice. How can I do that.

Hello rghaile,

For me it didn't work.

Reading logo-file, and 'write print-rec from print-code-line' , the printer pull out pages with control codes.
I use an old compiler running sco-unix.

Kjell Erik

I need to print logo as part of an invoice. How can I do that.

I use an old compiler under sco-unix. But all program are running from a Windows environment.

I need to print logo as part of an invoice. How can I do that.

You must use the P$ library included in RM/COBOL Runtime.

I need to print logo as part of an invoice. How can I do that.

We can run the example program on Windows and SCO Unix. That sample program, as it exists, prints the logo and 2 text lines for a customer. I can't imagine the compiler as the problem. I have 2 more questions, please...

You stated: "the printer pull out pages with control codes":
#1 Does the printer use PCL6? Not 5 or 5e, it must be PCL 6.

There were 2 text lines in the example program:
My Company Name
My Company Address
#2 Did those 2 lines print?

I'm beginning to suspect I have mislead you regarding storing the logo as a file. Give me a couple of hours to review my notes regarding logos. I apologize for the issues. I will get back with you soon.

I need to print logo as part of an invoice. How can I do that.

We can run the example program on Windows and SCO Unix. That sample program, as it exists, prints the logo and 2 text lines for a customer. I can't imagine the compiler as the problem. I have 2 more questions, please...

You stated: "the printer pull out pages with control codes":
#1 Does the printer use PCL6? Not 5 or 5e, it must be PCL 6.

There were 2 text lines in the example program:
My Company Name
My Company Address
#2 Did those 2 lines print?

I'm beginning to suspect I have mislead you regarding storing the logo as a file. Give me a couple of hours to review my notes regarding logos. I apologize for the issues. I will get back with you soon.

I need to print logo as part of an invoice. How can I do that.

#1 yes - Xerox colorQube 8570N-1
#2 yes

I need to print logo as part of an invoice. How can I do that.

Kjell-Erik,

Would you be willing to email your logo to me? If so, I will do some testing to see if I can get it working within the "hack" program. Then, I could send you the result and ask you to test it. Just let me know at your convenience, please. Thanks!

I need to print logo as part of an invoice. How can I do that.

Yes I can send you the logo. Send me your mailadress to kjell.erik@caratsys.no

I need to print logo as part of an invoice. How can I do that.

Yes I can send you the logo. Send me your mailadress to kjell.erik@caratsys.no