📄 pdflib.h
字号:
PDF_concat(PDF *p, float a, float b, float c, float d, float e, float f);/* Explicitly set the current transformation matrix. */PDFLIB_API void PDFLIB_CALLPDF_setmatrix(PDF *p, float a, float b, float c, float d, float e, float f);/* * ---------------------------------------------------------------------- * p_draw.c: path construction, painting, and clipping * ---------------------------------------------------------------------- *//* Set the current point. */PDFLIB_API void PDFLIB_CALLPDF_moveto(PDF *p, float x, float y);/* Draw a line from the current point to (x, y). */PDFLIB_API void PDFLIB_CALLPDF_lineto(PDF *p, float x, float y);/* Draw a Bezier curve from the current point, using 3 more control points. */PDFLIB_API void PDFLIB_CALLPDF_curveto(PDF *p, float x1, float y1, float x2, float y2, float x3, float y3);/* Draw a circle with center (x, y) and radius r. */PDFLIB_API void PDFLIB_CALLPDF_circle(PDF *p, float x, float y, float r);/* Draw a counterclockwise circular arc from alpha to beta degrees. */PDFLIB_API void PDFLIB_CALLPDF_arc(PDF *p, float x, float y, float r, float alpha, float beta);/* Draw a clockwise circular arc from alpha to beta degrees. */PDFLIB_API void PDFLIB_CALLPDF_arcn(PDF *p, float x, float y, float r, float alpha, float beta);/* Draw a rectangle at lower left (x, y) with width and height. */PDFLIB_API void PDFLIB_CALLPDF_rect(PDF *p, float x, float y, float width, float height);/* Close the current path. */PDFLIB_API void PDFLIB_CALLPDF_closepath(PDF *p);/* Stroke the path with the current color and line width, and clear it. */PDFLIB_API void PDFLIB_CALLPDF_stroke(PDF *p);/* Close the path, and stroke it. */PDFLIB_API void PDFLIB_CALLPDF_closepath_stroke(PDF *p);/* Fill the interior of the path with the current fill color. */PDFLIB_API void PDFLIB_CALLPDF_fill(PDF *p);/* Fill and stroke the path with the current fill and stroke color. */PDFLIB_API void PDFLIB_CALLPDF_fill_stroke(PDF *p);/* Close the path, fill, and stroke it. */PDFLIB_API void PDFLIB_CALLPDF_closepath_fill_stroke(PDF *p);/* Deprecated, use one of the stroke, fill, or clip functions instead. */PDFLIB_API void PDFLIB_CALLPDF_endpath(PDF *p);/* Use the current path as clipping path. */PDFLIB_API void PDFLIB_CALLPDF_clip(PDF *p);/* * ---------------------------------------------------------------------- * p_color.c: color handling * ---------------------------------------------------------------------- *//* Deprecated, use PDF_setcolor(p, "fill", "gray", g, 0, 0, 0) instead. */PDFLIB_API void PDFLIB_CALLPDF_setgray_fill(PDF *p, float gray);/* Deprecated, use PDF_setcolor(p, "stroke", "gray", g, 0, 0, 0) instead. */PDFLIB_API void PDFLIB_CALLPDF_setgray_stroke(PDF *p, float gray);/* Deprecated, use PDF_setcolor(p, "both", "gray", g, 0, 0, 0) instead. */PDFLIB_API void PDFLIB_CALLPDF_setgray(PDF *p, float gray);/* Deprecated, use PDF_setcolor(p, "fill", "rgb", red, green, blue, 0). */PDFLIB_API void PDFLIB_CALLPDF_setrgbcolor_fill(PDF *p, float red, float green, float blue);/* Deprecated, use PDF_setcolor(p, "stroke", "rgb", red, green, blue, 0). */PDFLIB_API void PDFLIB_CALLPDF_setrgbcolor_stroke(PDF *p, float red, float green, float blue);/* Deprecated, use PDF_setcolor(p, "both", "rgb", red, green, blue, 0). */PDFLIB_API void PDFLIB_CALLPDF_setrgbcolor(PDF *p, float red, float green, float blue);/* Make a named spot color from the current color. */PDFLIB_API int PDFLIB_CALLPDF_makespotcolor(PDF *p, const char *spotname, int len);/* Set the current color space and color. type is "fill", "stroke", or "both".*/PDFLIB_API void PDFLIB_CALLPDF_setcolor(PDF *p, const char *fstype, const char *colorspace, float c1, float c2, float c3, float c4);/* * ---------------------------------------------------------------------- * p_pattern.c: pattern definition * ---------------------------------------------------------------------- *//* Start a new pattern definition. */PDFLIB_API int PDFLIB_CALLPDF_begin_pattern(PDF *p, float width, float height, float xstep, float ystep, int painttype);/* Finish a pattern definition. */PDFLIB_API void PDFLIB_CALLPDF_end_pattern(PDF *p);/* * ---------------------------------------------------------------------- * p_template.c: template definition * ---------------------------------------------------------------------- *//* Start a new template definition. */PDFLIB_API int PDFLIB_CALLPDF_begin_template(PDF *p, float width, float height);/* Finish a template definition. */PDFLIB_API void PDFLIB_CALLPDF_end_template(PDF *p);/* * ---------------------------------------------------------------------- * p_image.c: image handling * ---------------------------------------------------------------------- *//* Place an image or template with the lower left corner at (x, y), and scale it. */PDFLIB_API void PDFLIB_CALLPDF_place_image(PDF *p, int image, float x, float y, float scale);/* Use image data from a variety of data sources. Supported types are "jpeg", "ccitt", "raw". Supported sources are "memory", "fileref", "url". len is only used for type="raw", params is only used for type="ccitt". */PDFLIB_API int PDFLIB_CALLPDF_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);/* Open an image file. Supported types are "jpeg", "tiff", "gif", and "png" stringparam is either "", "mask", "masked", or "page". intparam is either 0, the image number of the applied mask, or the page. */PDFLIB_API int PDFLIB_CALLPDF_open_image_file(PDF *p, const char *imagetype, const char *filename, const char *stringparam, int intparam);/* Close an image retrieved with one of the PDF_open_image*() functions. */PDFLIB_API void PDFLIB_CALLPDF_close_image(PDF *p, int image);/* Add an existing image as thumbnail for the current page. */PDFLIB_API void PDFLIB_CALLPDF_add_thumbnail(PDF *p, int image);/* * ---------------------------------------------------------------------- * p_ccitt.c: fax-compressed data processing * ---------------------------------------------------------------------- *//* Open a raw CCITT image. */PDFLIB_API int PDFLIB_CALLPDF_open_CCITT(PDF *p, const char *filename, int width, int height, int BitReverse, int K, int BlackIs1);/* * ---------------------------------------------------------------------- * p_hyper.c: bookmarks and document info fields * ---------------------------------------------------------------------- *//* Add a nested bookmark under parent, or a new top-level bookmark if parent = 0. Returns a bookmark descriptor which may be used as parent for subsequent nested bookmarks. If open = 1, child bookmarks will be folded out, and invisible if open = 0. */PDFLIB_API int PDFLIB_CALLPDF_add_bookmark(PDF *p, const char *text, int parent, int open);/* Fill document information field key with value. key is one of "Subject", "Title", "Creator", "Author", "Keywords", or a user-defined key. */PDFLIB_API void PDFLIB_CALLPDF_set_info(PDF *p, const char *key, const char *value);/* * ---------------------------------------------------------------------- * p_annots.c: file attachments, notes, and links * ---------------------------------------------------------------------- *//* Add a file attachment annotation. icon is one of "graph", "paperclip", "pushpin", or "tag". */PDFLIB_API void PDFLIB_CALLPDF_attach_file(PDF *p, float llx, float lly, float urx, float ury, const char *filename, const char *description, const char *author, const char *mimetype, const char *icon);/* Add a note annotation. icon is one of of "comment", "insert", "note", "paragraph", "newparagraph", "key", or "help". */PDFLIB_API void PDFLIB_CALLPDF_add_note(PDF *p, float llx, float lly, float urx, float ury, const char *contents, const char *title, const char *icon, int open);/* Add a file link annotation (to a PDF target). */PDFLIB_API void PDFLIB_CALLPDF_add_pdflink(PDF *p, float llx, float lly, float urx, float ury, const char *filename, int page, const char *dest);/* Add a launch annotation (to a target of arbitrary file type). */PDFLIB_API void PDFLIB_CALLPDF_add_launchlink(PDF *p, float llx, float lly, float urx, float ury, const char *filename);/* Add a link annotation to a target within the current PDF file. */PDFLIB_API void PDFLIB_CALLPDF_add_locallink(PDF *p, float llx, float lly, float urx, float ury, int page, const char *dest);/* Add a weblink annotation to a target URL on the Web. */PDFLIB_API void PDFLIB_CALLPDF_add_weblink(PDF *p, float llx, float lly, float urx, float ury, const char *url);/* Set the border style for all kinds of annotations. style is "solid" or "dashed". */PDFLIB_API void PDFLIB_CALLPDF_set_border_style(PDF *p, const char *style, float width);/* Set the border color for all kinds of annotations. */PDFLIB_API void PDFLIB_CALLPDF_set_border_color(PDF *p, float red, float green, float blue);/* Set the border dash style for all kinds of annotations. See PDF_setdash(). */PDFLIB_API void PDFLIB_CALLPDF_set_border_dash(PDF *p, float b, float w);/* * ---------------------------------------------------------------------- * p_pdi.c: PDF import (requires the PDI library) * ---------------------------------------------------------------------- *//* Open an existing PDF document and prepare it for later use. */PDFLIB_API int PDFLIB_CALLPDF_open_pdi(PDF *p, const char *filename, const char *stringparam, int intparam);/* Close all open page handles, and close the input PDF document. */PDFLIB_API void PDFLIB_CALLPDF_close_pdi(PDF *p, int doc);/* Prepare a page for later use with PDF_place_pdi_page(). */PDFLIB_API int PDFLIB_CALLPDF_open_pdi_page(PDF *p, int doc, int page, const char *label);/* Place a PDF page with the lower left corner at (x, y), and scale it. */PDFLIB_API void PDFLIB_CALLPDF_place_pdi_page(PDF *p, int page, float x, float y, float sx, float sy);/* Close the page handle, and free all page-related resources. */PDFLIB_API void PDFLIB_CALLPDF_close_pdi_page(PDF *p, int page);/* Get the contents of some PDI document parameter with string type. */PDFLIB_API const char *PDFLIB_CALLPDF_get_pdi_parameter(PDF *p, const char *key, int doc, int page, int index, int *len);/* Get the contents of some PDI document parameter with numerical type. */PDFLIB_API float PDFLIB_CALLPDF_get_pdi_value(PDF *p, const char *key, int doc, int page, int index);/* * ---------------------------------------------------------------------- * p_stream.c: output stream handling * ---------------------------------------------------------------------- *//* Get the contents of the PDF output buffer. The result must be used by the client before calling any other PDFlib function. */PDFLIB_API const char * PDFLIB_CALLPDF_get_buffer(PDF *p, long *size);/* * ---------------------------------------------------------------------- * page size formats * ---------------------------------------------------------------------- *//*Although PDF doesn磘 impose any restrictions on the usable page size,Acrobat implementations suffer from architectural limits concerningthe page size.Although PDFlib will generate PDF documents with page sizes outsidethese limits, the default error handler will issue a warning message.Acrobat 3 minimum page size: 1" = 72 pt = 2.54 cmAcrobat 3 maximum page size: 45" = 3240 pt = 114.3 cmAcrobat 4 minimum page size: 0.25" = 18 pt = 0.635 cmAcrobat 4 maximum page size: 200" = 14400 pt = 508 cm*//* The page sizes are only available to the C and C++ bindings */#define a0_width (float) 2380.0#define a0_height (float) 3368.0#define a1_width (float) 1684.0#define a1_height (float) 2380.0#define a2_width (float) 1190.0#define a2_height (float) 1684.0#define a3_width (float) 842.0#define a3_height (float) 1190.0#define a4_width (float) 595.0#define a4_height (float) 842.0#define a5_width (float) 421.0#define a5_height (float) 595.0#define a6_width (float) 297.0#define a6_height (float) 421.0#define b5_width (float) 501.0#define b5_height (float) 709.0#define letter_width (float) 612.0#define letter_height (float) 792.0#define legal_width (float) 612.0#define legal_height (float) 1008.0#define ledger_width (float) 1224.0#define ledger_height (float) 792.0#define p11x17_width (float) 792.0#define p11x17_height (float) 1224.0#ifdef __cplusplus} /* extern "C" */#endif#endif /* PDFLIB_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -