*****************************************
* PDFlib <> COBOL short name XREF table *
*****************************************


COBOL name   PDFlib equivalent
----------   ------------------

PDACTITM     PDF_activate_item
PDBEGDOC     PDF_begin_document
PDBEGITM     PDF_begin_item
PDBEGLAY     PDF_begin_layer
PDBEGPAG     PDF_begin_page_ext
PDCREACT     PDF_create_action
PDCREANN     PDF_create_annotation
PDCREBKM     PDF_create_bookmark
PDCREFLD     PDF_create_field
PDCREFG      PDF_create_fieldgroup
PDCRETF      PDF_create_textflow
PDDEFLAY     PDF_define_layer
PDDELTF      PDF_delete_textflow
PDENDDOC     PDF_end_document
PDENDITM     PDF_end_item
PDENDLAY     PDF_end_layer
PDENDPAG     PDF_end_page_ext  // see note!!
PDFITTF      PDF_fit_textflow
PDINFOTF     PDF_info_textflow
PDRESPAG     PDF_resume_page
PDLAYDEP     PDF_set_layer_dependency
PDSUSPAG     PDF_suspend_page
PDUT16T8     PDF_utf16_to_utf8
PDUT8T16     PDF_utf8_to_utf16

New for 7.0:

PDADDTF      PDF_add_textflow
PDINFOTB     PDF_info_table
PDINFOTL     PDF_info_textline
PDINFOMB     PDF_info_matchbox
PDINFOFO     PDF_info_font
PDADDTB      PDF_add_table_cell
PDFITTB      PDF_fit_table
PDDELTB      PDF_delete_table
PDCREA3D     PDF_create_3dview
PDLOAD3D     PDF_load_3ddata
PDBGTEMP     PDF_begin_template_ext
PDCLSPDD     PDF_close_pdi_document
PDOPNPDD     PDF_open_pdi_document
PDPCOSNU     PDF_pcos_get_number
PDPCOSSG     PDF_pcos_get_string
PDPCOSSM     PDF_pcos_get_stream
PDU32T16     PDF_utf32_to_utf16
PDSETIN2     PDF_set_info2


/* NOTE...
   compromise compatibility here: completely
   drop the old functions PDF_begin/end_page() and recycle
   the name PDENDPAG for the new PDF_end_page_ext()
*/


PDLALINK     PDF_add_launchlink
PDLOLINK     PDF_add_locallink
PDNOTE       PDF_add_note
PDPDLINK     PDF_add_pdflink
PDWELINK     PDF_add_weblink
PDATTACH     PDF_attach_file
PDBORCOL     PDF_set_border_color
PDBORDAS     PDF_set_border_dash
PDBORSTY     PDF_set_border_style
PDBGNPAG     PDF_begin_page
PDBOOT       PDF_boot
PDCLOSE      PDF_close
PDDELETE     PDF_delete
PDENDPAG     PDF_end_page
PDGETBUF     PDF_get_buffer
PDNEW        PDF_new
PDOPNFIL     PDF_open_file
PDSHUT       PDF_shutdown
PDERRNUM     PDF_get_errnum
PDERRMSG     PDF_get_errmsg
PDERRAPI     PDF_get_apiname
PDFLIMBL     PDF_fill_imageblock
PDFLPDBL     PDF_fill_pdfblock
PDFLTXBL     PDF_fill_textblock
PDMKSPOT     PDF_makespotcolor
PDSETCOL     PDF_setcolor
PDARC        PDF_arc
PDARCN       PDF_arcn
PDCIRCLE     PDF_circle
PDCLIP       PDF_clip
PDCLSP       PDF_closepath
PDCLSPFS     PDF_closepath_fill_stroke
PDCLSPS      PDF_closepath_stroke
PDCURVTO     PDF_curveto
PDENDPTH     PDF_endpath
PDFILL       PDF_fill
PDFILLST     PDF_fill_stroke
PDLINETO     PDF_lineto
PDMOVETO     PDF_moveto
PDRECT       PDF_rect
PDSTROKE     PDF_stroke
PDSETCHR     PDF_encoding_set_char
PDLODFNT     PDF_load_font
PDSETFNT     PDF_setfont
PDCONCAT     PDF_concat
PDINITGR     PDF_initgraphics
PDRESTOR     PDF_restore
PDROTATE     PDF_rotate
PDSAVE       PDF_save
PDSCALE      PDF_scale
PDSETDAS     PDF_setdash
PDSETDP      PDF_setdashpattern
PDSETFLT     PDF_setflat
PDLCAP       PDF_setlinecap
PDLJOIN      PDF_setlinejoin
PDLWIDTH     PDF_setlinewidth
PDMATRIX     PDF_setmatrix
PDMITER      PDF_setmiterlimit
PDSKEW       PDF_skew
PDTRANS      PDF_translate
PDBKMARK     PDF_add_bookmark
PDADDNMD     PDF_add_nameddest
PDSETINF     PDF_set_info
PDLDICCP     PDF_load_iccprofile
PDTHUMB      PDF_add_thumbnail
PDCLSIMG     PDF_close_image
PDFITIMG     PDF_fit_image
PDLDIMG      PDF_load_image
PDGETPAR     PDF_get_parameter
PDGETVAL     PDF_get_value
PDSETPAR     PDF_set_parameter
PDSETVAL     PDF_set_value
PDBGNPAT     PDF_begin_pattern
PDENDPAT     PDF_end_pattern
PDCLSPDI     PDF_close_pdi
PDCLSPAG     PDF_close_pdi_page
PDFITPDI     PDF_fit_pdi_page
PDGETPP      PDF_get_pdi_parameter
PDGETPV      PDF_get_pdi_value
PDOPNPDI     PDF_open_pdi
PDOPNPAG     PDF_open_pdi_page
PDPROCPD     PDF_process_pdi
PDCREPVF     PDF_create_pvf
PDDELPVF     PDF_delete_pvf
PDSHADNG     PDF_shading
PDSHADPT     PDF_shading_pattern
PDSHFILL     PDF_shfill
PDBGNTMP     PDF_begin_template
PDENDTMP     PDF_end_template
PDCONT       PDF_continue_text
PDCONT2      PDF_continue_text2
PDFITTLN     PDF_fit_textline
PDSETTP      PDF_set_text_pos
PDSHOW       PDF_show
PDSHOW2      PDF_show2
PDSHWBOX     PDF_show_boxed
PDSHOWXY     PDF_show_xy
PDSHWXY2     PDF_show_xy2
PDWIDTH      PDF_stringwidth
PDWIDTH2     PDF_stringwidth2
PDBGNFON     PDF_begin_font
PDBGNGLY     PDF_begin_glyph
PDENDFON     PDF_end_font
PDENDGLY     PDF_end_glyph
PDCREGST     PDF_create_gstate
PDSETGST     PDF_set_gstate



Here are the COBOL equivalents (taken from our HELLO sample) to the 
various C data types you see listed in the cross-reference doc.......
 
 
 
     05  PDFLIB-A4-WIDTH         USAGE COMP-1 VALUE 5.95E+2. // float
 
     05  WS-INT                  PIC S9(9) BINARY.           // int
     05  WS-FLOAT                COMP-1.                     // float
     05  WS-STRING               PIC X(128).                 // const char *
 
     05  P                       PIC S9(9) BINARY.           // long *
     05  RETURN-RC               PIC S9(9) BINARY.           // int *

 



/*
 * ----------------------------------------------------------------------
 * Function prototypes for all supported API functions
 * ----------------------------------------------------------------------
 */

/* Activate a previously created structure element or other content item. */
void
PDF_activate_item(PDF *p, int id);

/* Deprecated, use PDF_create_bookmark(). */
int
PDF_add_bookmark(PDF *p, const char *text, int parent, int open);

/* Deprecated, use PDF_create_bookmark(). */
int
PDF_add_bookmark2(PDF *p, const char *text, int len, int parent, int open);

/* Deprecated, use PDF_create_action() and PDF_create_annotation(). */
void
PDF_add_launchlink(PDF *p, double llx, double lly, double urx, double ury,
    const char *filename);

/* Deprecated, use PDF_create_action() and PDF_create_annotation(). */
void
PDF_add_locallink(PDF *p, double llx, double lly, double urx, double ury,
    int page, const char *optlist);

/* Create a named destination on an arbitrary page in the current document. */
void
PDF_add_nameddest(PDF *p, const char *name, int len, const char *optlist);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_add_note(PDF *p, double llx, double lly, double urx, double ury,
    const char *contents, const char *title, const char *icon, int open);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_add_note2(PDF *p, double llx, double lly, double urx, double ury,
    const char *contents, int len_cont, const char *title, int len_title,
    const char *icon, int open);

/* Deprecated, use PDF_create_action() and PDF_create_annotation(). */
void
PDF_add_pdflink(PDF *p, double llx, double lly, double urx, double ury,
    const char *filename, int page, const char *optlist);

/* Add a cell to a new or existing table.
   Returns: A table handle which can be used in subsequent table-related calls.
*/
int
PDF_add_table_cell(PDF *p, int table, int column, int row, const char *text,
    int len, const char *optlist);

/* Create a Textflow object, or add text and explicit options to an existing
   Textflow.
   Returns: A Textflow handle, or -1 (in PHP: 0) on error.
*/
int
PDF_add_textflow(PDF *p, int textflow, const char *text, int len,
    const char *optlist);

/* Add an existing image as thumbnail for the current page. */
void
PDF_add_thumbnail(PDF *p, int image);

/* Deprecated, use PDF_create_action() and PDF_create_annotation(). */
void
PDF_add_weblink(PDF *p, double llx, double lly, double urx, double ury,
    const char *url);

/* Draw a counterclockwise circular arc segment. */
void
PDF_arc(PDF *p, double x, double y, double r, double alpha, double beta);

/* Draw a clockwise circular arc segment. */
void
PDF_arcn(PDF *p, double x, double y, double r, double alpha, double beta);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_attach_file(PDF *p, double llx, double lly, double urx, double ury,
    const char *filename, const char *description, const char *author,
    const char *mimetype, const char *icon);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_attach_file2(PDF *p, double llx, double lly, double urx, double ury,
    const char *filename, int len_filename, const char *description,
    int len_descr, const char *author, int len_auth, const char *mimetype,
    const char *icon);

/* Create a new PDF file subject to various options.
   Returns: -1 (in PHP: 0) on error, and 1 otherwise.
*/
int
PDF_begin_document(PDF *p, const char *filename, int len, const char *optlist);

/* Create a new PDF document subject to various options. */
typedef size_t (*writeproc_t)(PDF *p1, void *data, size_t size);
void
PDF_begin_document_callback(PDF *p, writeproc_t writeproc, const char *optlist);

/* Start a Type 3 font definition. */
void
PDF_begin_font(PDF *p, const char *fontname, int len,
    double a, double b, double c, double d, double e, double f,
    const char *optlist);

/* Start a glyph definition for a Type 3 font. */
void
PDF_begin_glyph(PDF *p, const char *glyphname, double wx,
    double llx, double lly, double urx, double ury);

/* Open a structure element or other content item with attributes supplied
   as options.
   Returns: An item handle.
*/
int
PDF_begin_item(PDF *p, const char *tag, const char *optlist);

/* Start a layer for subsequent output on the page (requires PDF 1.5). */
void
PDF_begin_layer(PDF *p, int layer);

/* Begin a marked content sequence with or without properties (unsupported). */
void
PDF_begin_mc(PDF *p, const char *tag, const char *optlist);

/* Deprecated, use PDF_begin_page_ext(). */
void
PDF_begin_page(PDF *p, double width, double height);

/* Add a new page to the document, and specify various options. */
void
PDF_begin_page_ext(PDF *p, double width, double height, const char *optlist);

/* Start a pattern definition.
   Returns: A pattern handle.
*/
int
PDF_begin_pattern(PDF *p,
    double width, double height, double xstep, double ystep, int painttype);

/* Deprecated, use PDF_begin_template_ext(). */
int
PDF_begin_template(PDF *p, double width, double height);

/* Start a template definition.
   Returns: A template handle.
*/
int
PDF_begin_template_ext(PDF *p, double width, double height,
    const char *optlist);

/* Deprecated, and not required. */
void
PDF_boot(void);

/* Check the validity of a PDFlib context (unsupported). */
int
PDF_check_context(PDF *p);

/* Draw a circle. */
void
PDF_circle(PDF *p, double x, double y, double r);

/* Use the current path as clipping path, and terminate the path. */
void
PDF_clip(PDF *p);

/* Deprecated, use PDF_end_document(). */
void
PDF_close(PDF *p);

/* Close an image. */
void
PDF_close_image(PDF *p, int image);

/* Deprecated, use PDF_close_pdi_document(). */
void
PDF_close_pdi(PDF *p, int doc);

/* Close all open PDI page handles, and close the input PDF document. */
void
PDF_close_pdi_document(PDF *p, int doc);

/* Close the page handle and free all page-related resources. */
void
PDF_close_pdi_page(PDF *p, int page);

/* Close the current path. */
void
PDF_closepath(PDF *p);

/* Close the path, fill, and stroke it. */
void
PDF_closepath_fill_stroke(PDF *p);

/* Close the path, and stroke it. */
void
PDF_closepath_stroke(PDF *p);

/* Apply a transformation matrix to the current coordinate system. */
void
PDF_concat(PDF *p, double a, double b, double c, double d, double e, double f);

/* Print text at the next line. */
void
PDF_continue_text(PDF *p, const char *text);

/* Same as PDF_continue_text(), but with explicit string length. */
void
PDF_continue_text2(PDF *p, const char *text, int len);

/* Create a 3D view (requires PDF 1.6).
   Returns: A 3D view handle, or -1 (in PHP: 0) on error.
*/
int
PDF_create_3dview(PDF *p, const char *username, int len, const char *optlist);

/* Create an action which can be applied to various objects and events.
   Returns: An action handle.
*/
int
PDF_create_action(PDF *p, const char *type, const char *optlist);

/* Create a rectangular annotation on the current page. */
void
PDF_create_annotation(PDF *p, double llx, double lly, double urx, double ury,
    const char *type, const char *optlist);

/* Create a bookmark subject to various options.
   Returns: A handle for the generated bookmark.
*/
int
PDF_create_bookmark(PDF *p, const char *text, int len, const char *optlist);

/* Create a form field on the current page subject to various options. */
void
PDF_create_field(PDF *p, double llx, double lly, double urx, double ury,
    const char *name, int len, const char *type, const char *optlist);

/* Create a form field group subject to various options. */
void
PDF_create_fieldgroup(PDF *p, const char *name, int len, const char *optlist);

/* Create a graphics state object subject to various options.
   Returns: A graphics state handle.
*/
int
PDF_create_gstate(PDF *p, const char *optlist);

/* Create a named virtual read-only file from data provided in memory. */
void
PDF_create_pvf(PDF *p, const char *filename, int len,
    const void *data, size_t size, const char *optlist);

/* Create a Textflow object from text contents, inline options, and explicit
   options.
   Returns: A Textflow handle, or -1 (in PHP: 0) on error.
*/
int
PDF_create_textflow(PDF *p, const char *text, int len, const char *optlist);

/* Draw a Bezier curve from the current point, using 3 more control points. */
void
PDF_curveto(PDF *p,
    double x_1, double y_1, double x_2, double y_2, double x_3, double y_3);

/* Create a new layer definition (requires PDF 1.5).
   Returns: A layer handle.
*/
int
PDF_define_layer(PDF *p, const char *name, int len, const char *optlist);

/* Delete a PDFlib object and free all internal resources. */
void
PDF_delete(PDF *p);

/* Delete a named virtual file and free its data structures (but not the
   contents).
   Returns: -1 (in PHP: 0) if the virtual file exists but is locked, and
   1 otherwise.
 */
int
PDF_delete_pvf(PDF *p, const char *filename, int len);

/* Delete a table and all associated data structures. */
void
PDF_delete_table(PDF *p, int table, const char *optlist);

/* Delete a Textflow and all associated data structures. */
void
PDF_delete_textflow(PDF *p, int textflow);

/* Add a glyph name and/or Unicode value to a custom encoding. */
void
PDF_encoding_set_char(PDF *p, const char *encoding, int slot,
    const char *glyphname, int uv);

/* Close the generated PDF document and apply various options. */
void
PDF_end_document(PDF *p, const char *optlist);

/* Terminate a Type 3 font definition. */
void
PDF_end_font(PDF *p);

/* Terminate a glyph definition for a Type 3 font. */
void
PDF_end_glyph(PDF *p);

/* Close a structure element or other content item. */
void
PDF_end_item(PDF *p, int id);

/* Deactivate all active layers (requires PDF 1.5). */
void
PDF_end_layer(PDF *p);

/* End the least recently opened marked content sequence (unsupported). */
void
PDF_end_mc(PDF *p);

/* Deprecated, use PDF_end_page_ext(). */
void
PDF_end_page(PDF *p);

/* Finish a page, and apply various options. */
void
PDF_end_page_ext(PDF *p, const char *optlist);

/* Finish a pattern definition. */
void
PDF_end_pattern(PDF *p);

/* Finish a template definition. */
void
PDF_end_template(PDF *p);

/* End the current path without filling or stroking it. */
void
PDF_endpath(PDF *p);

/* Fill the interior of the path with the current fill color. */
void
PDF_fill(PDF *p);

/* Fill an image block with variable data according to its properties.
   Returns: -1 (in PHP: 0) on error, and 1 otherwise.
*/
int
PDF_fill_imageblock(PDF *p, int page, const char *blockname,
    int image, const char *optlist);

/* Fill a PDF block with variable data according to its properties.
   Returns: -1 (in PHP: 0) on error, and 1 otherwise.
*/
int
PDF_fill_pdfblock(PDF *p, int page, const char *blockname,
    int contents, const char *optlist);

/* Fill and stroke the path with the current fill and stroke color. */
void
PDF_fill_stroke(PDF *p);

/* Fill a text block with variable data according to its properties.
   Returns: -1 (in PHP: 0) on error, and 1 otherwise.
*/
int
PDF_fill_textblock(PDF *p, int page, const char *blockname,
    const char *text, int len, const char *optlist);

/* Deprecated, use PDF_load_font(). */
int
PDF_findfont(PDF *p, const char *fontname, const char *encoding, int embed);

/* Place an image or template on the page, subject to various options. */
void
PDF_fit_image(PDF *p, int image, double x, double y, const char *optlist);

/* Place an imported PDF page on the page subject to various options. */
void
PDF_fit_pdi_page(PDF *p, int page, double x, double y, const char *optlist);

/* Fully or partially place a table on the page.
   Returns: A string which specifies the reason for returning.
*/
const char*
PDF_fit_table(PDF *p, int table, double llx, double lly,
    double urx, double ury, const char *optlist);

/* Format the next portion of a Textflow into a rectangular area.
   Returns: A string which specifies the reason for returning.
*/
const char*
PDF_fit_textflow(PDF *p, int textflow, double llx, double lly,
    double urx, double ury, const char *optlist);

/* Place a single line of text at position (x, y) subject to various options. */
void
PDF_fit_textline(PDF *p, const char *text, int len, double x, double y,
    const char *optlist);

/*
 * Retrieve a structure with PDFlib API function pointers (mainly for DLLs).
 * Although this function is published here, it is not supposed to be used
 * directly by clients. Use PDF_new_dl() (in pdflibdl.c).
 */
const PDFlib_api *
PDF_get_api(void);

/* Get the name of the API function which threw the last exception or failed.
   Returns: Name of an API function.
*/
const char*
PDF_get_apiname(PDF *p);

/* Get the contents of the PDF output buffer.
   Returns: A buffer full of binary PDF data for consumption by the client.
*/
const char*
PDF_get_buffer(PDF *p, long *size);

/* Get the text of the last thrown exception or the reason of a failed
   function call.
   Returns: Text containing the description of the most recent error condition.
*/
const char*
PDF_get_errmsg(PDF *p);

/* Get the number of the last thrown exception or the reason of a failed
   function call.
   Returns: The error code of the most recent error condition.
*/
int
PDF_get_errnum(PDF *p);

/* Request the amount of kerning between two characters (unsupported). */
double
PDF_get_kern_amount(PDF *p, int font, int firstchar, int secondchar);

/* Deprecated, use PDF_get_value(). */
int
PDF_get_majorversion(void);

/* Deprecated, use PDF_get_value(). */
int
PDF_get_minorversion(void);

/* Fetch the opaque application pointer stored in PDFlib.
   Returns: The opaque application pointer stored in PDFlib.
*/
void *
PDF_get_opaque(PDF *p);

/* Get the contents of some PDFlib parameter with string type.
   Returns: The string value of the parameter as a hypertext string.
*/
const char*
PDF_get_parameter(PDF *p, const char *key, double modifier);

/* Deprecated, use PDF_pcos_get_string(). */
const char *
PDF_get_pdi_parameter(PDF *p, const char *key, int doc, int page,
    int reserved, int *len);

/* Deprecated, use PDF_pcos_get_number. */
double
PDF_get_pdi_value(PDF *p, const char *key, int doc, int page, int reserved);

/* Get the value of some PDFlib parameter with numerical type.
   Returns: The numerical value of the parameter.
*/
double
PDF_get_value(PDF *p, const char *key, double modifier);

/* Query detailed information about a loaded font.
   Returns: The value of some font property as requested by keyword.
*/
double
PDF_info_font(PDF *p, int font, const char *keyword, const char *optlist);

/* Query information about a matchbox on the current page.
   Returns: The value of some matchbox parameter as requested by keyword.
*/
double
PDF_info_matchbox(PDF *p, const char *boxname, int len, int num,
    const char *keyword);

/* Retrieve table information related to the most recently placed table
   instance.
   Returns: The value of some table parameter as requested by keyword.
*/
double
PDF_info_table(PDF *p, int table, const char *keyword);

/* Query the current state of a Textflow.
   Returns: The value of some Textflow parameter as requested by keyword.
*/
double
PDF_info_textflow(PDF *p, int textflow, const char *keyword);

/* Perform textline formatting and query the resulting metrics.
   Returns: The value of some text metric value as requested by keyword.
*/
double
PDF_info_textline(PDF *p, const char *text, int len, const char *keyword,
    const char *optlist);

/* Reset all color and graphics state parameters to their defaults. */
void
PDF_initgraphics(PDF *p);

/* Draw a line from the current point to another point. */
void
PDF_lineto(PDF *p, double x, double y);

/* Load a 3D model from a disk-based or virtual file (requires PDF 1.6).
   Returns: A 3D handle, or -1 (in PHP: 0) on error.
*/
int
PDF_load_3ddata(PDF *p, const char *filename, int len, const char *optlist);

/* Search for a font and prepare it for later use.
   Returns: A font handle.
*/
int
PDF_load_font(PDF *p, const char *fontname, int len,
    const char *encoding, const char *optlist);

/* Search for an ICC profile and prepare it for later use.
   Returns: A profile handle.
*/
int
PDF_load_iccprofile(PDF *p, const char *profilename, int len,
    const char *optlist);

/* Open a disk-based or virtual image file subject to various options.
   Returns: An image handle, or -1 (in PHP: 0) on error.
*/
int
PDF_load_image(PDF *p, const char *imagetype, const char *filename,
    int len, const char *optlist);

/* Find a built-in spot color name, or make a named spot color from the
   current fill color.
   Returns: A color handle.
*/
int
PDF_makespotcolor(PDF *p, const char *spotname, int reserved);

/* Add a marked content point with or without properties (unsupported). */
void
PDF_mc_point(PDF *p, const char *tag, const char *optlist);

/* Set the current point. */
void
PDF_moveto(PDF *p, double x, double y);

/* Create a new PDFlib object.
   Returns: A handle to a PDFlib object.
*/
PDF *
PDF_new(void);

/* Create a new PDFlib object with client-supplied error handling and memory
   allocation routines.
   Returns: A handle to a PDFlib object.
*/
typedef void  (*errorproc_t)(PDF *p1, int errortype, const char *msg);
typedef void* (*allocproc_t)(PDF *p2, size_t size, const char *caller);
typedef void* (*reallocproc_t)(PDF *p3,
                void *mem, size_t size, const char *caller);
typedef void  (*freeproc_t)(PDF *p4, void *mem);

PDF *
PDF_new2(errorproc_t errorhandler, allocproc_t allocproc,
        reallocproc_t reallocproc, freeproc_t freeproc, void *opaque);

/* Deprecated, use PDF_load_image(). */
int
PDF_open_CCITT(PDF *p, const char *filename, int width, int height,
    int BitReverse, int K, int BlackIs1);

/* Deprecated, use PDF_begin_document(). */
int
PDF_open_file(PDF *p, const char *filename);

/* Deprecated, use PDF_load_image() with virtual files. */
int
PDF_open_image(PDF *p, const char *imagetype, const char *source,
    const char *data, long length, int width, int height, int components,
    int bpc, const char *params);

/* Deprecated, use PDF_load_image(). */
int
PDF_open_image_file(PDF *p, const char *imagetype, const char *filename,
    const char *stringparam, int intparam);

/* Deprecated, use PDF_begin_document_callback(). */
void
PDF_open_mem(PDF *p, writeproc_t writeproc);

/* Deprecated, use PDF_open_pdi_document(). */
int
PDF_open_pdi(PDF *p, const char *filename, const char *optlist, int len);

/* Open a disk-based or virtual PDF document and prepare it for later use.
   Returns: A PDI document handle.
*/
int
PDF_open_pdi_document(PDF *p, const char *filename, int len,
    const char *optlist);

/* Open a PDF document from a custom data source and prepare it for
   later use.
   Returns: A PDI document handle.
*/
int
PDF_open_pdi_callback(PDF *p, void *opaque, size_t filesize,
    size_t (*readproc)(void *opaque, void *buffer, size_t size),
    int (*seekproc)(void *opaque, long offset),
    const char *optlist);

/* Prepare a page for later use with PDF_fit_pdi_page().
   Returns: A page handle.
*/
int
PDF_open_pdi_page(PDF *p, int doc, int pagenumber, const char *optlist);

/* Get the value of a pCOS path with type number or boolean.
   Returns: The numerical value of the object identified by the pCOS path.
*/
double
PDF_pcos_get_number(PDF *p, int doc, const char *path, ...);

/* Get the value of a pCOS path with type name, string or boolean.
   Returns: A string with the value of the object identified by the pCOS path.
*/
const char*
PDF_pcos_get_string(PDF *p, int doc, const char *path, ...);

/* Get the contents of a pCOS path with type stream, fstream, or string.
   Returns: The unencrypted data contained in the stream or string.
*/
const unsigned char *
PDF_pcos_get_stream(PDF *p, int doc, int *length, const char *optlist,
    const char *path, ...);

/* Deprecated, use PDF_fit_image(). */
void
PDF_place_image(PDF *p, int image, double x, double y, double scale);

/* Deprecated, use PDF_fit_pdi_page(). */
void
PDF_place_pdi_page(PDF *p, int page, double x, double y, double sx, double sy);

/* Process certain elements of an imported PDF document.
   Returns: -1 (in PHP: 0) on error, and 1 otherwise.
*/
int
PDF_process_pdi(PDF *p, int doc, int page, const char *optlist);

/* Draw a Bezier curve using relative coordinates (unsupported). */
void
PDF_rcurveto(PDF *p,
    double x_1, double y_1, double x_2, double y_2, double x_3, double y_3);

/* Draw a rectangle. */
void
PDF_rect(PDF *p, double x, double y, double width, double height);

/* Restore the most recently saved graphics state from the stack. */
void
PDF_restore(PDF *p);

/* Resume a page to add more content to it. */
void
PDF_resume_page(PDF *p, const char *optlist);

/* Draw a line from the current point to (cp + (x, y)) (unsupported). */
void
PDF_rlineto(PDF *p, double x, double y);

/* Set the new current point relative the old current point (unsupported). */
void
PDF_rmoveto(PDF *p, double x, double y);

/* Rotate the coordinate system. */
void
PDF_rotate(PDF *p, double phi);

/* Save the current graphics state to a stack. */
void
PDF_save(PDF *p);

/* Scale the coordinate system. */
void
PDF_scale(PDF *p, double sx, double sy);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_set_border_color(PDF *p, double red, double green, double blue);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_set_border_dash(PDF *p, double b, double w);

/* Deprecated, use PDF_create_annotation(). */
void
PDF_set_border_style(PDF *p, const char *style, double width);

/* Activate a graphics state object. */
void
PDF_set_gstate(PDF *p, int gstate);

/* Fill document information field key with value. */
void
PDF_set_info(PDF *p, const char *key, const char *value);

/* Like PDF_set_info(), but with explicit string length. */
void
PDF_set_info2(PDF *p, const char *key, const char *value, int len);

/* Define hierarchical, group, and lock conditions among layers (requires
   PDF 1.5).
*/
void
PDF_set_layer_dependency(PDF *p, const char *type, const char *optlist);

/* Set some PDFlib parameter with string type. */
void
PDF_set_parameter(PDF *p, const char *key, const char *value);

/* Set the position for text output on the page. */
void
PDF_set_text_pos(PDF *p, double x, double y);

/* Set the value of some PDFlib parameter with numerical type. */
void
PDF_set_value(PDF *p, const char *key, double value);

/* Set the current color space and color. */
void
PDF_setcolor(PDF *p, const char *fstype, const char *colorspace,
    double c1, double c2, double c3, double c4);

/* Set the current dash pattern. */
void
PDF_setdash(PDF *p, double b, double w);

/* Set a dash pattern defined by an option list. */
void
PDF_setdashpattern(PDF *p, const char *optlist);

/* Set the flatness parameter. */
void
PDF_setflat(PDF *p, double flatness);

/* Set the current font in the specified size. */
void
PDF_setfont(PDF *p, int font, double fontsize);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setgray(PDF *p, double gray);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setgray_fill(PDF *p, double gray);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setgray_stroke(PDF *p, double gray);

/* Set the linecap parameter. */
void
PDF_setlinecap(PDF *p, int linecap);

/* Set the linejoin parameter. */
void
PDF_setlinejoin(PDF *p, int linejoin);

/* Set the current linewidth. */
void
PDF_setlinewidth(PDF *p, double width);

/* Explicitly set the current transformation matrix. */
void
PDF_setmatrix(PDF *p, double a, double b, double c, double d,
    double e, double f);

/* Set the miter limit. */
void
PDF_setmiterlimit(PDF *p, double miter);

/* Deprecated, use PDF_setdashpattern(). */
void
PDF_setpolydash(PDF *p, float *dasharray, int length);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setrgbcolor(PDF *p, double red, double green, double blue);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setrgbcolor_fill(PDF *p, double red, double green, double blue);

/* Deprecated, use PDF_setcolor(). */
void
PDF_setrgbcolor_stroke(PDF *p, double red, double green, double blue);

/* Define a blend from the current fill color to another color (requires
   PDF 1.4).
   Returns: A shading handle.
*/
int
PDF_shading(PDF *p, const char *shtype, double x_0, double y_0, double x_1,
    double y_1, double c_1, double c_2, double c_3, double c_4,
    const char *optlist);

/* Define a shading pattern using a shading object (requires PDF 1.4).
   Returns: A pattern handle.
*/
int
PDF_shading_pattern(PDF *p, int shading, const char *optlist);

/* Fill an area with a shading, based on a shading object (requires PDF 1.4) */
void
PDF_shfill(PDF *p, int shading);

/* Print text in the current font and size at the current position. */
void
PDF_show(PDF *p, const char *text);

/* Same as PDF_show() but with explicit string length. */
void
PDF_show2(PDF *p, const char *text, int len);

/* Deprecated, use PDF_fit_textline() or PDF_fit_textflow(). */
int
PDF_show_boxed(PDF *p, const char *text, double left, double top,
    double width, double height, const char *hmode, const char *feature);

/* Deprecated, use PDF_fit_textline() or PDF_fit_textflow(). */
int
PDF_show_boxed2(PDF *p, const char *text, int len, double left, double top,
    double width, double height, const char *hmode, const char *feature);

/* Print text in the current font. */
void
PDF_show_xy(PDF *p, const char *text, double x, double y);

/* Same as PDF_show_xy(), but with explicit string length. */
void
PDF_show_xy2(PDF *p, const char *text, int len, double x, double y);

/* Deprecated, and not required. */
void
PDF_shutdown(void);

/* Skew the coordinate system. */
void
PDF_skew(PDF *p, double alpha, double beta);

/* Calculate the width of text in an arbitrary font.
   Returns: The width of text.
*/
double
PDF_stringwidth(PDF *p, const char *text, int font, double fontsize);

/* Same as PDF_stringwidth(), but with explicit string length. */
double
PDF_stringwidth2(PDF *p, const char *text, int len, int font, double fontsize);

/* Stroke the path with the current color and line width, and clear it. */
void
PDF_stroke(PDF *p);

/* Suspend the current page so that it can later be resumed. */
void
PDF_suspend_page(PDF *p, const char *optlist);

/* Translate the origin of the coordinate system. */
void
PDF_translate(PDF *p, double tx, double ty);

/* Convert a string from UTF-16 format to UTF-8.
   Returns: The converted UTF-8 string, starting with the UTF-8 BOM.
*/
const char*
PDF_utf16_to_utf8(PDF *p, const char *utf16string, int len, int *size);

/* Convert a string from UTF-32 format to UTF-16.
   Returns: The converted UTF-16 string.
*/
const char*
PDF_utf32_to_utf16(PDF *p, const char *utf32string, int len,
    const char *ordering, int *size);

/* Convert a string from UTF-8 format to UTF-16.
   Returns: The converted UTF-16 string.
*/
const char*
PDF_utf8_to_utf16(PDF *p, const char *utf8string, const char *ordering,
    int *size);

/* Print text in the current font and size, using individual horizontal
   positions (unsupported).
*/
void
PDF_xshow(PDF *p, const char *text, int len, const double *xadvancelist);

