Skip to main content

[archive] Printing bitmap image

  • November 4, 2009
  • 6 replies
  • 0 views

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form

6 replies

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
There are a couple of different sample programs distributed with the product that show how to print bitmaps. One is an AcuBench report sample named Report1h, the other is the standard graphprn sample program.

Depending on if you are using AcuBench or not will help determine which you want to look at for the code example.

Hope that helps.

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
There are a couple of different sample programs distributed with the product that show how to print bitmaps. One is an AcuBench report sample named Report1h, the other is the standard graphprn sample program.

Depending on if you are using AcuBench or not will help determine which you want to look at for the code example.

Hope that helps.

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
If you are using WIN$PRINTER to print your invoice the code is relatively simple.

Note: I just ripped this code quickly, so I may be missing some details, but you shoudl get the idea.


COPY "winprint.def".
01 WS-BITMAP-FILE PIC X(40)  VALUE "path to your BMP file".

CALL "W$BITMAP" USING WBITMAP-LOAD, WS-BITMAP-FILE
                        GIVING BITMAP-HANDLE.

| Print a full page bitmap
INITIALIZE WPRTDATA-PRINT-BITMAP.
MOVE BITMAP-HANDLE TO WPRTDATA-BITMAP.
MOVE 1 TO WPRTDATA-BITMAP-ROW.
MOVE 0 TO WPRTDATA-BITMAP-COL.
MOVE 11 TO WPRTDATA-BITMAP-HEIGHT.
MOVE 8.5 TO WPRTDATA-BITMAP-WIDTH.
MOVE WPRTBITMAP-SCALE-INCHES TO WPRTDATA-BITMAP-FLAGS.
CALL "WIN$PRINTER" USING WINPRINT-PRINT-BITMAP,
                                      WINPRINT-DATA.

CALL "W$BITMAP" USING WBITMAP-DESTROY, BITMAP-HANDLE.

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
If you are using WIN$PRINTER to print your invoice the code is relatively simple.

Note: I just ripped this code quickly, so I may be missing some details, but you shoudl get the idea.


COPY "winprint.def".
01 WS-BITMAP-FILE PIC X(40)  VALUE "path to your BMP file".

CALL "W$BITMAP" USING WBITMAP-LOAD, WS-BITMAP-FILE
                        GIVING BITMAP-HANDLE.

| Print a full page bitmap
INITIALIZE WPRTDATA-PRINT-BITMAP.
MOVE BITMAP-HANDLE TO WPRTDATA-BITMAP.
MOVE 1 TO WPRTDATA-BITMAP-ROW.
MOVE 0 TO WPRTDATA-BITMAP-COL.
MOVE 11 TO WPRTDATA-BITMAP-HEIGHT.
MOVE 8.5 TO WPRTDATA-BITMAP-WIDTH.
MOVE WPRTBITMAP-SCALE-INCHES TO WPRTDATA-BITMAP-FLAGS.
CALL "WIN$PRINTER" USING WINPRINT-PRINT-BITMAP,
                                      WINPRINT-DATA.

CALL "W$BITMAP" USING WBITMAP-DESTROY, BITMAP-HANDLE.

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
If you are using WIN$PRINTER to print your invoice the code is relatively simple.

Note: I just ripped this code quickly, so I may be missing some details, but you shoudl get the idea.


COPY "winprint.def".
01 WS-BITMAP-FILE PIC X(40)  VALUE "path to your BMP file".

CALL "W$BITMAP" USING WBITMAP-LOAD, WS-BITMAP-FILE
                        GIVING BITMAP-HANDLE.

| Print a full page bitmap
INITIALIZE WPRTDATA-PRINT-BITMAP.
MOVE BITMAP-HANDLE TO WPRTDATA-BITMAP.
MOVE 1 TO WPRTDATA-BITMAP-ROW.
MOVE 0 TO WPRTDATA-BITMAP-COL.
MOVE 11 TO WPRTDATA-BITMAP-HEIGHT.
MOVE 8.5 TO WPRTDATA-BITMAP-WIDTH.
MOVE WPRTBITMAP-SCALE-INCHES TO WPRTDATA-BITMAP-FLAGS.
CALL "WIN$PRINTER" USING WINPRINT-PRINT-BITMAP,
                                      WINPRINT-DATA.

CALL "W$BITMAP" USING WBITMAP-DESTROY, BITMAP-HANDLE.

[Migrated content. Thread originally posted on 03 November 2009]

Have you ever use Acucobol to print a bitmap image on a report? I don't see how to do this. I have a client who wants a customized invoice to print on blank paper, which I'm good with except for putting his logo on the form
If you use win$printer routines, remember to open the printer prior to loading the bitmap with w$bitmap, to ensure the proper resolution.