Highlighted
Absent Member.
Absent Member.
1300 views

[archive] Printing bitmap image

[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
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing bitmap image

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.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing bitmap image

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.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Printing bitmap image

If you use win$printer routines, remember to open the printer prior to loading the bitmap with w$bitmap, to ensure the proper resolution.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.