COBOL Graphic Print Routines Help
Introduction
How
would you like to use COBOL to print images, graphics, charts, shapes, lines, fonts and
colors just like the windows applications you use ? The
ACS Corporation
supplies routines that allow COBOL programs to utilize the MS Windows
Graphic Device Interface for printers. This means COBOL programs can print graphical items
such as:
- Print Text of various size, weight, color and font
This font and
color, or
this font and color,
or this font and color,
and many others.
- Print Forms, photos and Images for logos, invoices,
statments, and various reports. Support for formats of BMP, GIF, PNG, TIF,
or JPEG
- Print Shapes for charts, graphs, and highlighting
using various sizes and colors. Support for rectangles,
circles and ellipses with or without borders
These routines are supported for Windows 98SE thru Vista.
Graphical printing is easy though different from traditional COBOL printing.
Graphical printing is based on a X,Y grid. The X,Y grid covers the width and
height of a sheet of paper. Each X,Y location on the grid is represented by a
point or dot. Whereas traditional COBOL printing is based on spaces, characters
and line feeds.
With this in mind, your typical color printer today will
print at 300 dots per inch or DPI. Given a typical sheet of paper being 8.5
inches by 11 inches. This would equate to 2,550 dots/X axis co-ordinates by
3,300 dots/Y axis co-ordinates. Just the opposite if printing in Landscape mode.
All the drawing routines provided (Such as draw an image,
text, rectangle or ellipse.) will require a X,Y point to complete the desired
task. The X,Y point or co-ordinate will define the top left most point which the
drawing will begin. Co-ordinates X=0,Y=0 mean the function will begin drawing at
the left and topmost piece of the paper. There are no negative X,Y values. For
example on a 300dpi printer, starting X,Y at location 300,300 would indicate one
inch to the right and one inch down on the paper.
It is allowable to draw on top of images, text, rectangles or
ellipses before releasing to print. For example, draw a rectangle then put text
on top of the rectangle such that the text appears inside. Another example, scan
or create an image of an invoice form using your favorite drawing program (like
PhotoShop). Draw that image with the COBOL routine, then put in the variable
data like date, amount, ect by drawing the text on top of that image. This can
greatly reduce the amount of code needed to draw your own form. Hint: JPEG
format is great for pictures. GIF, TIF, or PNG formats are great for forms.
The COBOL programmer will use the following sequence of
routines for graphical printing:
- Call Doc_Start
This starts the print Job. The user will be asked to select
the printer using the standard windows printer dialog box. This routine is
called only once per print job. Upon return, the routine gives you
information about the selected printer (X,Y DPI resolution) and whether or not
the user cancelled the job.
- Call Doc_TextOut, Doc_BitMapOut, ect. (various drawing routines)
These routines perform the desired drawing at the location
specified. Execute as many of these routines as desired per page.
- Call Doc_NewPage
This signals the completion of a page and a new blank page is
now allocated.
- Call Doc_End.
This signals the end of the print job. All pages are released
to the printer. No pages will be printed until this function is called.
Doc_Start must be called to start another print job.
There are parameters associated with each of these functions
that allow the programmer to control the graphics. Such as forcing landscape
mode, color choices, solid or hollow rectangles, ect. Refer to the documentation
on each of the functions for a complete parameter list and explanation.
Any
reference to X or Y parameter is referring to a starting point on the
aforementioned grid or the bottom right most co-ordinates of a binding
rectangle.
Any
reference to width or height is referring to the number of dots to allocate for
a particular function. e.g. how many dots high and how many dots wide for a
ellipse. Allocating dots for width and heights for different printer resolutions
is described in detail below.
A
NULL terminated string is a string of characters that is ended in low-value or a
x'00'.
Doc_Start
The
Doc_Start function is the first function an application calls to start graphic
printing. It displays the Windows Standard Printer Dialog box, initialize a new
page, and sets the page orientation.
Parm 1
DocStart-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that define the
attributes of the printer. These data fields are explained below.
Document-Handle
Identifies the window handle that will own this process This parameter can be NULL or binary zeroes.
Paper-Orientation
Identifies whether the portrait or landscape printing will be used. Predefined
fields of Paper-Portrait, Paper-LandScape and
Paper-Users-Choice have been provided. Paper-Users-Choice lets the
users choose portrait or landscape from the standard printers dialog box.
Paper-Portrait, Paper-LandScape force this mode with no override from
the user.
Printer-Selection
Send print directly to the default printer or prompts for printer selection
using the standard windows dialog box or sends print directly to a specified
printer. Predefined fields of Use-Default-Printer, Prompt-For-Printer,
and Use-Printer-Specified have been provided.
X-Dots-Per-Inch
Is
the printer's resolution on the X axis. This value is set/returned from the routine.
Y-Dots-Per-Inch
Is
the printer's resolution on the X axis. This value is set/returned from the routine.
Printer-Specified
Identifies the name of the printer to that receives print. This is the same name
as seen on the "Printers" control panel function.
Print-Document-Name
This is the name of the print job, you will see, on the print control
window. If not specified it will default to "ACS Corp Print" Programmer's often
put the name of the program generating the print data into this field.
Return Values
A value of zero indicates success. A value of one indicates
the user cancelled out of the Windows Standard Printer Dialog box or failure.
Remarks
Windows has 2 different standard dialog boxes for
printing. If a valid windows handle is specified, one dialog box is displayed.
If the windows handle is NULL or binary zeroes, a different looking dialog box
is displayed. Both dialog boxes perform the same function.
If you choose Printer-Selection of 3 (User-Printer-Specified), you must supply the name of the printer in the Printer-Specified field. All print will be directed to this printer. Many customers use this option to direct print to a printer that is not really a printer. For example, directing print to a printer that creates a PDF file rather than hardcopy. The PDF file can then be emailed around the world. Maybe this PDF file is a status report, sales graph or ???. There are quite a few products that claim to capture print and create a PDF file. We like the product "PDF Factory".
X-Dots-Per-Inch and Y-Dots-Per-Inch are returned from the call. They
identify the resolution of the chosen printer. It could be 300dpi, 600dpi or
greater. Some Printers have a higher Y axis resolution than the X axis. Today
some are as high as 4,800 DPI. If you are developing for printers of varying
resolutions then you must use these parameters to scale the position of your
text and graphics. For example, printing rectangle with a height and width of
300 dots on a 300dpi printer will appear 1/2 the size on a 600dpi printer.
To create the rectangle the same size across all types of
printer resolutions you must use the Dots Per Inch mentioned above to calculate
the desired width and height. You must also think in terms of inches or
fractions of an inch. For example, say you want to create a 1/2 inch wide
rectangle. Multiply
X-Dots-Per-Inch
by .5 to get the number of dots required for 1/2 of an inch. If the printer has
a resolution of 300dpi the product(width) would be 150. If 600dpi the
product(width) would be 300.
Calculating heights, widths and offsets in this manner will
give you a consistent report across varying printer resolutions.
Code Example
SET PAPER-PORTRAIT TO TRUE.
PERFORM DOC-START.
IF RETURN-CODE-NUM = 0
user selected a printer, begin
draw functions
Doc-Start.
Call 'S_Doc_Start' USING BY REFERENCE DocStart-Fields
GIVING RETURN-CODE-NUM.
The Draw Functions are a set of routines that allow the COBOL programmer to output images, lines, rectangles, ellipses, text by font, with borders and colors. The following details each of the drawing functions available.
The Doc_BitMapOut function draws a windows bitmap or image onto the printer page. Samples:
Parm 1 BitMapOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the attributes of the BitMap to be printed. These data fields are
explained below.
BitMapBackGround
Indicates whether the BitMap background should be transparent or not
BitMapOutX
Identifies the X axis position of the top left corner the BitMap will be
aligned.
BitMapOutY
Identifies the Y axis position of the top left corner the BitMap will be
aligned.
BitMapOutWidth
Identifies the output width.
BitMapOutHeight
Identifies the output height.
BitMapOut-String
A
NULL terminated string that identifies the path and name of the BitMap to be
printed.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks.
This function may be called several times for one page.
Printing several BitMaps onto one page.
Only BMP,GIF,TIFF,JPEG and PNG formats are supported at this time.
The quality is dependent on the printer and printer driver. Be aware that BitMaps created viewed on a computer screen can appear much larger than the same BitMap printed. This is due to a typical computer screen displaying images at 72 DotsPerInch and the typical printer rendering images at 300 Dots Per Inch or greater. Create your images accordingly.
BitMapOutWidth and BitMapOutHeight are optional fields. If left zero
the original bitmap pixel width and height will be used. If filled in the
original bitmap will be stretched to these dimensions. This can be used to
create a consistently sized image across multiple printer resolutions. These
fields have no effect on transparent bitmaps. The Doc_Start routine has a
description of how to calculate these fields.
Code Example
MOVE 0 TO BitmapOutX ,
MOVE 0 TO BitMapOutY
SET BitMapTransparent-Yes TO
TRUE
STRING 'C:\InvoiceTemplate.PNG',
x'00' DELIMITED BY SIZE INTO BitMapOut-String
PERFORM Doc-BitMapOut
Doc-BitMapOut.
Call 'S_Doc_BitMapOut' USING BY
REFERENCE BitMapOut-Fields GIVING RETURN-CODE-NUM.
The Doc_TextOut function draws a text string onto the printer page. Samples:
Bold Courier 14pt
Regular Castellar 18pt
Edwardian Script Bold
Normal Goudy Stout
Parm 1 TextOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the attributes of the text to be printed. These data fields are explained
below.
TextOutX
Is the X axis position of the top left corner of the text on the page.
TextOutY
Is
the Y axis position of the top left corner of the text on the page.
TextOut-Alignment
Defines if each line of text will be justified left or right or centered
TextOut-Font
Is
the font used for the text to be printed
TextOut-Weight
Is
the thickness of the text to be printed.
TextOut-Color
Is
the color of the text to be printed.
TextOut-CharacterSize
Is
the size of the characters within the text to be printed.
TextOut-Italic
Indicates whether the text to printed should be italic or not.
TextOut-UnderLine
Iindicates whether the text to printed should be underlined or not.
TextOut-StrikeOut
Indicates whether the text to printed should be struckout or not.
TextOut-String
Is
a NULL terminated string of text to be printed. It represents single or multiple
lines of text.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
The TextOut-String can contain carriage-return, line-feed
(x'0d', x'0a') codes to separate lines. Tab-characters (x'09') are valid and
will expand to the default of 8 spaces. No other traditional COBOL printer codes
are recognized.
The order and size of these data fields should not be
changed.
Some common colors are provided but you may add your own
colors by referring to the Document-Colors data item.
Some common fonts provided but you may add other fonts by referring to the
TextOut-Font data item. Be aware special fonts may not exist on another
persons computer. If this happens you will need to install that font on that
computer. Windows will try to match (as close as it can) a non-existing font,
but the results are not always satisfactory.
Code Example
MOVE 100 TO TextOutX
MOVE 1 TO TextOutY
SET TextOut-Center TO TRUE
STRING 'some purple goes here', x'00'
DELIMITED BY SIZE INTO TextOut-String
SET TextOut-LucidaConsole TO TRUE
MOVE 10 TO TextOut-CharacterSize
SET TextOut-Medium TO TRUE
MOVE Doc-Purple TO TextOut-Color
SET TextOut-Italic-Off TO TRUE
SET TextOut-UnderLine-Off TO TRUE
SET TextOut-StrikeOut-Off TO TRUE
PERFORM Doc-TextOut
Doc-TextOut.
Call 'S_Doc_TextOut' USING BY REFERENCE TextOut-Fields
GIVING RETURN-CODE-NUM.
The Doc_RectangleOut function draws a rectangle onto the printer page. Samples:
Parm 1 RectangleOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the size of the rectangle to be printed. These data fields are explained
below.
RectOut-TopLeftX
Is the X axis position of the top left corner of the rectangle.
RectOut-TopLeftY
Is
the Y axis position of the top left corner of the rectangle.
RectOut-BottomRightX
Is
the X axis position of the bottom right corner of the rectangle.
RectOut-BottomRightY
Is
the Y axis position of the bottom right corner of the rectangle.
RectOut-OutLineWidth
Is
the width of the rectangle's outline. The larger the number the thicker the
outline.
RectOut-OutLineColor
Is
the color of the rectangle's outline.
RectOut-Style
Specifies whether the rectangle will be solid or hollow.
RectOut-FillColor
Is
the color used to fill the rectangle. If the style is "Hollow" this color is
ignored.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
Some common colors are provided but you may add your own colors by referring to
the Document-Colors data item.
Code Example
MOVE 10 TO RectOut-TopLeftX
MOVE 10 TO RectOut-TopLeftY
MOVE 100 TO RectOut-BottomRightX
MOVE 100 TO RectOut-BottomRightY
MOVE 5 TO RectOut-OutLineWidth
MOVE Doc-Purple TO RectOut-OutLineColor
SET RectOut-Solid TO TRUE
MOVE Doc-Yellow TO RectOut-FillColor
PERFORM Doc-RectangleOut
Doc-RectangleOut.
Call 'S_Doc_RectangleOut' USING BY REFERENCE
RectangleOut-Fields GIVING RETURN-CODE-NUM.
The Doc_RoundRectangleOut function draws a rectangle onto the printer page with rounded corners. This function has the same parameters as RectangleOut with two additons. Corner Width and Corner Height. These two additional parameters define the curve of the corners. Samples:
Parm 1 RoundRectangleOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the size of the rectangle to be printed. These data fields are explained
below.
RoundRectOut-TopLeftX
Is
the X axis position of the top left corner of the rectangle.
RoundRectOut-TopLeftY
Is
the Y axis position of the top left corner of the rectangle.
RoundRectOut-BottomRightX
Is
the X axis position of the bottom right corner of the rectangle.
RoundRectOut-BottomRightY
Is
the Y axis position of the bottom right corner of the rectangle.
RoundRectOut-OutLineWidth
Is
the width of the rectangle's outline. The larger the number the thicker the
outline.
RoundRectOut-OutLineColor
Is the color of the rectangle's outline.
RoundRectOut-Style
Specifies whether the rectangle will be solid or hollow.
RoundRectOut-FillColor
Is
the color used to fill the rectangle. If the style is "Hollow" this color is
ignored.
RoundRectOut-CornerWidth
Is
the width of the curve used to round the corners of the rectangle. Larger the
number the larger the curve.
RoundRectOut-CornerHeight
Is
the height of the curve used to round corners of the rectangle. Larger the
number the larger the curve.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
Some common colors are provided but you may add your own
colors by referring to the Document-Colors data item.
Code Example
MOVE 10 TO RoundRectOut-TopLeftX
MOVE 10 TO RoundRectOut-TopLeftY
MOVE 400 TO RoundRectOut-BottomRightX
MOVE 500 TO RoundRectOut-BottomRightY
MOVE 5 TO RoundRectOut-OutLineWidth
Move Doc-Purple TO RoundRectOut-OutLineColor
SET RoundRectOut-Solid TO TRUE
MOVE Doc-Cyan TO RoundRectOut-FillColor
MOVE 50 TO RoundRectOut-CornerWidth
MOVE 80 TO RoundRectOut-CornerHeight
PERFORM Doc-RoundRectangleOut
Doc-RoundRectangleOut.
Call 'S_Doc_RoundRectangleOut' USING BY REFERENCE
RoundRectangleOut-Fields, GIVING RETURN-CODE-NUM.
The Doc_EllipseOut function draws a Ellipse onto the printer page. Samples:
Parm 1 EllipseOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the size of the Ellipse to be printed. These data fields are explained
below.
EllipseOut-TopLeftX
Is
the X axis position of the top left corner of the Ellipse.
EllipseOut-TopLeftY
Is
the Y axis position of the top left corner of the Ellipse.
EllipseOut-BottomRightX
Is
the X axis position of the bottom right corner of the Ellipse.
EllipseOut-BottomRightY
Is
the Y axis position of the bottom right corner of the Ellipse.
EllipseOut-OutLineWidth
Is
the width of the Ellipse's outline. The larger the number the thicker the
outline.
EllipseOut-OutLineColor
Is
the color of the Ellipse's outline.
EllipseOut-Style
Specifies whether the Ellipse will be solid or hollow.
EllipseOut-FillColor
Is
the color used to fill the Ellipse. If the style is "Hollow" this color is
ignored.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
Some common colors are provided but you may add your own
colors by referring to the Document-Colors data item. TIP: To create a circle
make the X,Y co-ordinates equal.
Code Example
MOVE 100 TO EllipOut-TopLeftX
MOVE 100 TO EllipOut-TopLeftY
MOVE 200 TO EllipOut-BottomRightX
MOVE 300 TO EllipOut-BottomRightY
MOVE 5 TO EllipOut-OutLineWidth
Move Doc-Purple TO EllipOut-OutLineColor
SET EllipOut-Solid TO TRUE
MOVE Doc-Yellow TO EllipOut-FillColor
PERFORM Doc-EllipseOut.
Doc-EllipseOut.
Call 'S_Doc_EllipseOut' USING BY REFERENCE EllipseOut-Fields
GIVING RETURN-CODE-NUM.
The Doc_EdgeOut function draws edges onto the printer page. Single edge, right angle edges or rectangle edges can be drawn. It can also draw a rectangle similar to Doc_RectangleOut. Samples:
Parm 1 EdgeOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the size and types of Edges to be printed. These data fields are
explained below.
EdgeOut-TopLeftX
Is
the X axis position of the top left corner of the Edge.
EdgeOut-TopLeftY
Is
the Y axis position of the top left corner of the Edge.
EdgeOut-BottomRightX
Is the X axis position of the bottom right corner of the Edge.
EdgeOut-BottomRightY
Is
the Y axis position of the bottom right corner of the Edge.
EdgeOut-Type
Defines the look of the edge to be printed.
EdgeOut-Edges
Defines which edges of the X,Y co-ordinates are to be printed.
EdgeOut-OutLineWidth
Is
the width of the Edge's outline. The larger the number the thicker the outline.
A value of zero indicates no outline is to be drawn
EdgeOut-OutLineColor
Is
the color of the Edge's outline. EdgeOut-Style specifies whether the Edge will
be solid or hollow.
EdgeOut-FillColor
Is
the color used to fill the Edge. If the style is "Hollow" this color is ignored.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
Some common colors are provided but you may add your own
colors by refering to the Document-Colors data item. TIP: You are
defining the X,Y co-ordinates of a rectangle, then selecting which edges of the
rectangle you wish to print
Code Example
MOVE 10 TO EdgeOut-TopLeftX
MOVE 10 TO EdgeOut-TopLeftY
MOVE 300 TO EdgeOut-BottomRightX
MOVE 300 TO EdgeOut-BottomRightY
SET EdgeOut-Raised TO TRUE
SET EdgeOut-Rectangle TO TRUE
MOVE 5 TO EdgeOut-OutLineWidth
Move Doc-Yellow TO EdgeOut-OutLineColor
SET EdgeOut-Solid TO TRUE
MOVE Doc-Cyan TO EdgeOut-FillColor
PERFORM Doc-EdgeOut.
Doc-EdgeOut.
Call 'S_Doc_EdgeOut' USING BY REFERENCE EdgeOut-Fields
GIVING RETURN-CODE-NUM.
Doc_LineOut
The Doc_LineOut function draws a line onto the printer page. Upto
but not including the destination co-ordinates. The line can be of varying
widths, colors, lengths and types. Samples:
------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-..-
____________________________________
Parm 1 LineOut-Fields
Parameters
Parm 1 Is a reference/pointer to a collection of data fields that
define the characteristics of the line to be printed. These data fields are
explained below.
LineOutType
Is
the style of line you wish to draw.
LineOut-Color
Is the color of the line you wish to draw.
LineOut-Width
Is the width (in dots) of the line you wish to draw.
LineOutFromX
Is
the X axis starting position of the line.
LineOutFromY
Is the Y axis starting position of the line.
LineOutToX
Is
the X axis ending position of the line.
LineOutToY
Is
the Y axis ending position of the line.
Return Value
A value of zero indicates success. A value of one
indicates failure.
Remarks
Some common colors are provided but you may add your
own colors by referring to the Document-Colors data item.
Different line types or colors can be used to graph
different items.
Code Example
SET LineOut-Solid TO TRUE.
MOVE DOC-RED TO LineOut-Color.
MOVE 5 TO LineOut-Width.
MOVE 10 TO LineOutFromX.
MOVE 10 TO LineOutFromY.
MOVE 900 TO LineOutToX.
MOVE 900 TO LineOutToY.
PERFORM Doc-LineOut.
Doc-LineOut.
Call 'S_Doc_LineOut' USING
BY REFERENCE LineOut-Fields,
GIVING RETURN-CODE-NUM.
The Doc_PrintFile function reads a file and prints it to the selected printer.
Parm 1
Is
a reference/pointer to a collection of data fields that define the attributes of
the printer. These data fields are explained in the Doc_Start routine
above.
Parm 2
Is
a reference/pointer to a collection of data fields that define the attributes of
the text to be printed. These data fields are explained in the Doc_TextOut
routine above.
Parm 3
Is
a reference/pointer to a collection of data fields that define the attributes of
a bitmap to be printed. These data fields are explained in the Doc_BitMapOut
routine above.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Remarks
This routine is different from the previous routines as the
normal Doc_Start, Draw routines, Doc_NewPage and Doc_End are not
required.
This routine will perform all the required steps to print the
specified file. Complete with carriage returns, line feeds and page feeds. Most
COBOL print programs can be easily modified to print to a file, then call this
routine.
Scaling of fonts for different resolution printers
(300dpi,600dpi,ect) is done automatically.
This routine is provided for a quick and simple method to allow
COBOL programs to access Windows printers. The previous routines should be
used when superior control of graphics, shapes, and mixed fonts are required.
The print file can contain carriage-return, line-feed, and
page feeds (x'0d', x'0a', x'0c') codes to separate lines. Most COBOL compilers
insert these codes automatically with the advancing page/line option. Any
character less than x'20' (space) other than these 3 characters will be ignored
by the routine.
The file specified should be a single character per byte file
(ASCII). Unicode or wide character files are not supported at this time.
The BitMap is not required. Leaving the BitMapOut-String
field with low-values will cause only the text file to be printed. If the BitMap
is defined, it is printed on every page. This can be used for check logos, ect.
Transparent BitMaps should not be used with this function, as scaling for
varying printer resolution will not be performed.
The order and size of these data fields should not be
changed.
Some common colors are provided but you may add your own
colors by referring to the Document-Colors data item. Some common fonts
provided but you may add other fonts by referring to the TextOut-Font data item.
Be aware special fonts may not exist on another persons
computer. If this happens you will need to install that font on that computer.
Windows will try to match (as close as it can) a non-existing font, but the
results are not always satisfactory.
Code Example
SET PAPER-PORTRAIT TO TRUE.
SET TextOut-Left TO TRUE.
SET TextOut-LucidaConsole TO TRUE.
MOVE 08 TO TextOut-CharacterSize.
SET TextOut-Normal TO TRUE.
MOVE Doc-Green TO TextOut-Color.
SET TextOut-Italic-Off TO TRUE.
SET TextOut-UnderLine-Off TO TRUE.
SET TextOut-StrikeOut-Off TO TRUE.
MOVE 1 TO TextOutX.
MOVE 1 TO TextOutY.
STRING 'your path & name of print file here', x'00'
DELIMITED BY SIZE INTO TextOut-String.
MOVE 300 to BitmapOutX.
MOVE 250 to BitMapOutY.
SET BitMapTransparent-No TO TRUE.
STRING 'Path & name of bitmap file here', x'00'
DELIMITED BY SIZE INTO BitMapOut-String.
PERFORM Doc-PrintFile.
Doc-PrintFile.
Call 'S_Doc_PrintFile' USING BY REFERENCE DocStart-Fields,
BY REFERENCE TextOut-Fields,
BY REFERENCE BitMapOut-Fields
GIVING RETURN-CODE-NUM.
Doc_NewPage
The
Doc_NewPage function creates a new and blank page which the application can draw
upon. The previous page is saved. No pages will print until the Doc-End function
is called. There are no parameters.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Code Example
PERFORM Doc_NewPage.
Doc-NewPage.
Call 'S_Doc_NewPage' GIVING RETURN-CODE-NUM.
The
Doc_End function completes the creation of the document and releases it to the
choosen printer. An application must call this function in order to print. It is
the last function called in the Doc family. There are no parameters.
Return Value
A value of zero indicates success. A value of one indicates
failure.
Code Example
PERFORM Doc_End.
Doc-End.
Call 'S_Doc_End' GIVING RETURN-CODE-NUM.
A COBOL copybook complete with comments, parameters, documentation and sample code is included with the package.