Supported PDF Printing Functions

Not all of the functions in the libharu API are currently implemented in the C$PDF library routine. If you attempt to call an op-code for a function that is not implemented, you receive the following error:

Invalid or missing parameter to C$PDF

The following op-codes and their parameters are currently supported; cross-reference them with the libharu API documentation for full details on calling each function:

Note: op-codes without a return value, simply return a SIGNED-INT or PIC S9(9) COMP-5 data item indicating success (zero) or failure (non-zero) of the call.
HPDF-ADDPAGE
Parameters: None
Returns: HPDF-DOC handle
HPDF-ANNOTATION-SETBORDERSTYLE
Parameters:
1 Annotation handle
2 Subtype
3 Width
4 Dash-On
5 Dash-Off
6 Dash-Phase
HPDF-CREATEOUTLINE
Parameters:
1 HPDF-DOC handle
2 Parent (may be null)
3 Title
4 Encoder handle (may be null or omitted)
Returns: outline handle
HPDF-DESTINATION-SETXYZ
Parameters:
1 Destination handle
2 Left
3 Top
4 Zoom
HPDF-FREE
Parameters:
1 HPDF-DOC handle
HPDF-GETCURRENTENCODER
Parameters:
1 HPDF-DOC handle
Returns: current encoder handle
HPDF-GETENCODER
Parameters:
1 HPDF-DOC handle
2 Encoder name
Returns: encoder handle
HPDF-GETERROR
Parameters:
1 HPDF-DOC handle
2 Error detail (output, optional)
Returns: error code
HPDF-GETFONT
Parameters:
1 HPDF-DOC handle
2 Font name
Encoding name (optional)
Returns: font handle (not compatible with ACUCOBOL-GT graphical font handles)
HPDF-IMAGE-ADDSMASK
Parameters:
1 Image handle
2 Image mask handle
HPDF-IMAGE-GETBITSPERCOMPONENT
Parameters:
1 Image handle
When HPDF-IMAGE-GETHEIGHT succeeds, it returns the number of bits. Otherwise, it returns 0.
HPDF-IMAGE-GETCOLORSPACE
Parameters:
1 Image handle
2 Color space name

PIC X(10) or larger

Returns: Color space name.
HPDF-IMAGE-GETHEIGHT
Parameters:
1 Image handle
HPDF-IMAGE-GETSIZE
Parameters:
1 Image handle
2 Size of image
Note: This parameter must be of the definition:
01 hpdf-point.
   03 hpdf-width s9(6)v999 comp-5.
   03 hpdf-height s9(6)v999 comp-5.
We recommend that you use HPDF-IMAGE-GETSIZE2 instead, as it performs the same function but has the additional capability of returning a libharu error code (and not simply a non-zero integer on failure), if required.
HPDF-IMAGE-GETSIZE2
Parameters:
1 Image handle
2 Size of image
Note: This parameter must be of the definition:
01 hpdf-point.
   03 hpdf-width s9(6)v999 comp-5.
   03 hpdf-height s9(6)v999 comp-5.
Returns: libharu error code (if applicable)
HPDF-IMAGE-GETWIDTH
Parameters:
1 Image handle
Returns: Width of image
HPDF-IMAGE-LOADRAW1BITIMAGEFROMMEM
Parameters:
1 Image handle
HPDF-IMAGE-SETCOLORMASK
Parameters:
1 Image handle
2 The lower limit of Red
3 The upper limit of Red
4 The lower limit of Green
5 The upper limit of Green
6 The lower limit of Blue
The upper limit of Blue
HPDF-IMAGE-SETMASKIMAGE
Parameters:
1 Image handle
2 Image mask handle
Retuns: A libharu error code (if applicable)
HPDF-INSERTPAGE
Parameters:
1 HPDF-DOC handle
2 HPDF-PAGE handle
Returns: new HPDF-PAGE handle
HPDF-LINKANNOT-SETBORDERSTYLE
Parameters:
1 Annotation handle
2 Width
3 Dash-On
4 Dash-Off
HPDF-LINKANNOT-SETHIGHLIGHTMODE
Parameters:
1 Annotation handle
2 Mode
HPDF-LOADJPEGIMAGEFROMFILE
Parameters:
1 HPDF-DOC handle
2 Filename
HPDF-LOADJPEGIMAGEFROMMEM
Parameters:
1 HPDF-DOC handle
2 Pointer to image
3 Size
HPDF-LOADPNGIMAGEFROMMEM
Parameters:
1 HPDF-DOC handle
2 Pointer to image
3 Size
HPDF-LOADPNGIMAGEFROMFILE
Parameters:
1 HPDF-DOC handle
2 PNG filename
Returns: image handle (not compatible with ACUCOBOL-GT image handles)
HPDF-LOADPNGIMAGEFROMFILE2
Parameters:
1 HPDF-DOC handle
2 PNG filename
Returns: image handle (not compatible with ACUCOBOL-GT image handles)
HPDF-LOADDRAWIMAGEFROMMEM
Parameters:
1 HPDF-DOC handle
2 Pointer to image
3 Width
4 Height
5 Color space
6 Bits per component
HPDF-LOADRAWIMAGEFROMFILE
Parameters:
1 HPDF-DOC handle
2 Pointer to image
3 Width
4 Height
5 Color space
HPDF-LOADTTFONTFROMFILE
Parameters:
1 HPDF-DOC handle
2 TTF filename
3 TTF embedding
HPDF-LOADTTFONTFROMFILE2
Parameters:
1 HPDF-DOC handle
2 TTC filename
3 TTC index
4 TTC embedding
5 Font name (output)
HPDF-LOADTYPE1FONTFROMFILE
Parameters:
1 HPDF-DOC handle
2 AFM filename
3 PFM filename
4 Font name (output)
HPDF-NEW
Parameters: No parameters
Returns: HPDF-DOC handle
HPDF-OUTLINE-SETDESTINATION
Parameters:
1 HPDF-OUTLINE handle
2 Destination handle
HPDF-OUTLINE-SETOPENED
Parameters:
1 HPDF-OUTLINE handle
2 Opened flag
HPDF-PAGE-BEGINTEXT
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-CLIP
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-CREATEDESTINATION
Parameters:
1 HPDF-PAGE handle
Returns: HDPF-DESTINATION handle
HPDF-PAGE-CREATELINKANNOT
Parameters:
1 HPDF-PAGE handle
2 HPDF-REC item
3 Destination handle
Returns: Annotation handle
HPDF-PAGE-CREATETEXTANNOT
Parameters:
1 HPDF-PAGE handle
2 HPDF-RECT item
3 Text
4 Encoder handle (optional)
Returns: Annotation handle
HPDF-PAGE-ENDTEXT
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-FILL
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-FILLSTROKE
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-GETGMODE
Parameters:
1 HPDF-PAGE handle
Returns: graphics mode
HPDF-PAGE-GETHEIGHT
Parameters:
1 HPDF-PAGE handle
Returns: Page height *1000
HPDF-PAGE-GETWIDTH
Parameters:
1 HPDF-PAGE handle
Returns: Page width *1000
HPDF-PAGE-GRESTORE
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-GSAVE
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-LINETO
Parameters:
1 HPDF-PAGE handle
2 X coord
3 Y coord
HPDF-PAGE-MOVETEXTPOS
Parameters:
1 HPDF-PAGE handle
2 X coord
3 Y coord
HPDF-PAGE-MOVETO
Parameters:
1 HPDF-PAGE handle
2 X coord
3 Y coord
HPDF-PAGE-RECTANGLE
Parameters:
1 HPDF-PAGE handle
2 X coord
3 Y coord
4 Width
5 Height
HPDF-PAGE-SETDASH
Parameters:
1 HPDF-PAGE handle
2 Number of dash pattern parameters (0-8)
3 Dash pattern parameters
4 Phase (optional)
HPDF-PAGE-SETFONTANDSIZE
Parameters:
1 HPDF-PAGE handle
2 HPDF-FONT handle
3 Font size
HPDF-PAGE-SETGRAYFILL
Parameters:
1 HPDF-PAGE handle
2 Gray fill percent
HPDF-PAGE-SETGRAYSTROKE
Parameters:
1 HPDF-PAGE handle
2 Gray stroke percent
HPDF-PAGE-SETLINECAP
Parameters:
1 HPDF-PAGE handle
2 Line cap indicator
HPDF-PAGE-SETLINEJOIN
Parameters:
1 HPDF-PAGE handle
2 Line join indicator
HPDF-PAGE-SETLINEWIDTH
Parameters:
1 HPDF-PAGE handle
2 Line width
HPDF-PAGE-SETRGBFILL
Parameters:
1 HPDF-PAGE handle
2 Red value
3 Green value
4 Blue value
HPDF-PAGE-SETRGBSTROKE
Parameters:
1 HPDF-PAGE handle
2 Red value
3 Green value
4 Blue value
HPDF-PAGE-SETSIZE
Parameters:
1 HPDF-PAGE handle
2 Page size indicator
3 Direction
HPDF-PAGE-SETTEXTLEADING
Parameters:
1 HPDF-PAGE handle
2 Text leading value
HPDF-PAGE-SHOWTEXT
Parameters:
1 HPDF-PAGE handle
2 Text
3 Text length in characters (optional)
HPDF-PAGE-SHOWTEXTNEXTLINE
Parameters:
1 HPDF-PAGE handle
2 Text
HPDF-PAGE-STROKE
Parameters:
1 HPDF-PAGE handle
HPDF-PAGE-TEXTOUT
Parameters:
1 HPDF-PAGE handle
2 X
3 Y
4 Text
5 Text length in characters (optional)
HPDF-PAGE-TEXTWIDTH
Parameters:
1 HPDF-PAGE handle
2 Text
3 Text length in characters (optional)
HPDF-PAGE-MEASURETEXT
Parameters:
1 HPDF-PAGE handle
2 Text
3 Width
4 Word wrap flag
5 Actual width (optional)
HPDF-PAGE-TEXTOUT
Parameters:
1 HPDF-PAGE handle
2 X
3 Y
4 Text
5 Text length in characters (optional)
HPDF-PAGE-TEXTWIDTH
Parameters:
1 HPDF-PAGE handle
2 Text
3 Text length in characters (optional)
HPDF-SAVETOFILE
Parameters:
1 HPDF-DOC handle
2 Save filename (may use @[DISPLAY] syntax for thin client)
HPDF-SETCOMPRESSIONMODE
Parameters:
1 HPDF-DOC handle
2 Compression mode
HPDF-SETCURRENTENCODER
Parameters:
1 HPDF-DOC handle
2 Encoder name
HPDF-SETINFOATTR
Parameters:
1 HPDF-DOC handle
2 Info attribute type
3 Info attribute value
HPDF-SETINFODATEATTR
Parameters:
1 HPDF-DOC handle
2 Date attribute indicator
3 HPDF-DATE
HPDF-SETPASSWORD
Parameters:
1 HPDF-DOC handle
2 Owner password
3 User password (optional)
HPDF-SETPERMISSION
Parameters:
1 HPDF-DOC handle
2 Permission type
HPDF-SETVIEWERPREFERENCE
Parameters:
1 HPDF-DOC handle
2 HPDF-Viewer preference value
HPDF-TEXTANNOT-SETICON
Parameters:
1 Annotation handle
2 Icon indicator
HPDF-TEXTANNOT-SETOPENED
Parameters:
1 Annotation handle
2 Open mode
HPDF-USECNSENCODINGS
Parameters:
1 HPDF-DOC handle
HPDF-USECNSFONTS
Parameters:
1 HPDF-DOC handle
HPDF-USECNTENCODINGS
Parameters:
1 HPDF-DOC handle
HPDF-USECNTFONTS
Parameters:
1 HPDF-DOC handle
HPDF-USEJPENCODINGS
Parameters:
1 HPDF-DOC handle
HPDF-USEJPFONTS
Parameters:
1 HPDF-DOC handle
HPDF-USEKRENCODINGS
Parameters:
1 HPDF-DOC handle
HPDF-USEKRFONTS
Parameters:
1 HPDF-DOC handle
HPDF-USEUTFENCODINGS
Parameters:
1 HPDF-DOC handle