Package com.pdflib
Class pdflib
- java.lang.Object
-
- com.pdflib.pdflib
-
public final class pdflib extends java.lang.ObjectPDFlib -- a library for generating PDF on the fly. Note that this is only a syntax summary. It covers several products: PDFlib Lite, PDFlib, PDFlib+PDI, and PDFlib Personalization Server (PPS). Not all features are available in all products, although dummies for all missing API functions are provided. A comparison which details function availability in different products is available at http://www.pdflib.com. For complete information please refer to the PDFlib API reference manual which is available in the PDF file PDFlib-manual.pdf in the PDFlib distribution.- Version:
- 7.0.5p3
- Author:
- Thomas Merz
-
-
Constructor Summary
Constructors Constructor Description pdflib()Create a new PDFlib object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate_item(int id)Activate a previously created structure element or other content item.intadd_bookmark(java.lang.String text, int parent, int open)Deprecated.Use PDF_create_bookmark().voidadd_launchlink(double llx, double lly, double urx, double ury, java.lang.String filename)Deprecated.Use PDF_create_action() and PDF_create_annotation().voidadd_locallink(double llx, double lly, double urx, double ury, int page, java.lang.String optlist)Deprecated.Use PDF_create_action() and PDF_create_annotation().voidadd_nameddest(java.lang.String name, java.lang.String optlist)Create a named destination on an arbitrary page in the current document.voidadd_note(double llx, double lly, double urx, double ury, java.lang.String contents, java.lang.String title, java.lang.String icon, int open)Deprecated.Use PDF_create_annotation().voidadd_pdflink(double llx, double lly, double urx, double ury, java.lang.String filename, int page, java.lang.String optlist)Deprecated.Use PDF_create_action() and PDF_create_annotation().intadd_table_cell(int table, int column, int row, java.lang.String text, java.lang.String optlist)Add a cell to a new or existing table.intadd_textflow(int textflow, java.lang.String text, java.lang.String optlist)Create a Textflow object, or add text and explicit options to an existing Textflow.voidadd_thumbnail(int image)Add an existing image as thumbnail for the current page.voidadd_weblink(double llx, double lly, double urx, double ury, java.lang.String url)Deprecated.Use PDF_create_action() and PDF_create_annotation().voidarc(double x, double y, double r, double alpha, double beta)Draw a counterclockwise circular arc segment.voidarcn(double x, double y, double r, double alpha, double beta)Draw a clockwise circular arc segment.voidattach_file(double llx, double lly, double urx, double ury, java.lang.String filename, java.lang.String description, java.lang.String author, java.lang.String mimetype, java.lang.String icon)Deprecated.Use PDF_create_annotation().intbegin_document(java.lang.String filename, java.lang.String optlist)Create a new PDF file subject to various options.voidbegin_font(java.lang.String name, double a, double b, double c, double d, double e, double f, java.lang.String optlist)Start a Type 3 font definition.voidbegin_glyph(java.lang.String glyphname, double wx, double llx, double lly, double urx, double ury)Start a glyph definition for a Type 3 font.intbegin_item(java.lang.String tag, java.lang.String optlist)Open a structure element or other content item with attributes supplied as options.voidbegin_layer(int layer)Start a layer for subsequent output on the page (requires PDF 1.5).voidbegin_page(double width, double height)Deprecated.Use PDF_begin_page_ext().voidbegin_page_ext(double width, double height, java.lang.String optlist)Add a new page to the document, and specify various options.intbegin_pattern(double width, double height, double xstep, double ystep, int painttype)Start a pattern definition.intbegin_template(double width, double height)Deprecated.Use PDF_begin_template_ext().intbegin_template_ext(double width, double height, java.lang.String optlist)Start a template definition.voidcircle(double x, double y, double r)Draw a circle.voidclip()Use the current path as clipping path, and terminate the path.voidclose()Deprecated.Use PDF_end_document().voidclose_image(int image)Close an image.voidclose_pdi(int doc)Deprecated.Use PDF_close_pdi_document().voidclose_pdi_document(int doc)Close all open PDI page handles, and close the input PDF document.voidclose_pdi_page(int page)Close the page handle, and free all page-related resources.voidclosepath()Close the current path.voidclosepath_fill_stroke()Close the path, fill, and stroke it.voidclosepath_stroke()Close the path, and stroke it.voidconcat(double a, double b, double c, double d, double e, double f)Apply a transformation matrix to the current coordinate system.voidcontinue_text(java.lang.String text)Print text at the next line.intcreate_3dview(java.lang.String username, java.lang.String optlist)Create a 3D view (requires PDF 1.6).intcreate_action(java.lang.String type, java.lang.String optlist)Create an action which can be applied to various objects and events.voidcreate_annotation(double llx, double lly, double urx, double ury, java.lang.String type, java.lang.String optlist)Create a rectangular annotation on the current page.intcreate_bookmark(java.lang.String text, java.lang.String optlist)Create a bookmark subject to various options.voidcreate_field(double llx, double lly, double urx, double ury, java.lang.String name, java.lang.String type, java.lang.String optlist)Create a form field on the current page subject to various options.voidcreate_fieldgroup(java.lang.String name, java.lang.String optlist)Create a form field group subject to various options.intcreate_gstate(java.lang.String optlist)Create a graphics state object subject to various options.voidcreate_pvf(java.lang.String filename, byte[] data, java.lang.String optlist)Create a named virtual read-only file from data provided in memory.intcreate_textflow(java.lang.String text, java.lang.String optlist)Create a Textflow object from text contents, inline options, and explicit options.voidcurveto(double x1, double y1, double x2, double y2, double x3, double y3)Draw a Bezier curve from the current point, using 3 more control points.intdefine_layer(java.lang.String name, java.lang.String optlist)Create a new layer definition (requires PDF 1.5).voiddelete()Delete a PDFlib object and free all internal resources.intdelete_pvf(java.lang.String filename)Delete a named virtual file and free its data structures (but not the contents).voiddelete_table(int table, java.lang.String optlist)Delete a table and all associated data structures.voiddelete_textflow(int textflow)Delete a Textflow and all associated data structures.voidencoding_set_char(java.lang.String encoding, int slot, java.lang.String glyphname, int uv)Add a glyph name and/or Unicode value to a custom encoding.voidend_document(java.lang.String optlist)Close the generated PDF document and apply various options.voidend_font()Terminate a Type 3 font definition.voidend_glyph()Terminate a glyph definition for a Type 3 font.voidend_item(int id)Close a structure element or other content item.voidend_layer()Deactivate all active layers (requires PDF 1.5).voidend_page()Deprecated.Use PDF_end_page_ext().voidend_page_ext(java.lang.String optlist)Finish a page, and apply various options.voidend_pattern()Finish a pattern definition.voidend_template()Finish a template definition.voidendpath()End the current path without filling or stroking it.voidfill()Fill the interior of the path with the current fill color.intfill_imageblock(int page, java.lang.String blockname, int image, java.lang.String optlist)Fill an image block with variable data according to its properties.intfill_pdfblock(int page, java.lang.String blockname, int contents, java.lang.String optlist)Fill a PDF block with variable data according to its properties.voidfill_stroke()Fill and stroke the path with the current fill and stroke color.intfill_textblock(int page, java.lang.String blockname, java.lang.String text, java.lang.String optlist)Fill a text block with variable data according to its properties.intfindfont(java.lang.String fontname, java.lang.String encoding, int options)Deprecated.Use PDF_load_font().voidfit_image(int image, double x, double y, java.lang.String optlist)Place an image or template on the page, subject to various options.voidfit_pdi_page(int page, double x, double y, java.lang.String optlist)Place an imported PDF page on the page subject to various options.java.lang.Stringfit_table(int table, double llx, double lly, double urx, double ury, java.lang.String optlist)Fully or partially place a table on the page.java.lang.Stringfit_textflow(int textflow, double llx, double lly, double urx, double ury, java.lang.String optlist)Format the next portion of a Textflow into a rectangular area.voidfit_textline(java.lang.String text, double x, double y, java.lang.String optlist)Place a single line of text at position (x, y) subject to various options.java.lang.Stringget_apiname()Get the name of the API function which threw the last exception or failed.byte[]get_buffer()Get the contents of the PDF output buffer.java.lang.Stringget_errmsg()Get the text of the last thrown exception or the reason of a failed function call.intget_errnum()Get the number of the last thrown exception or the reason of a failed function call.java.lang.Stringget_parameter(java.lang.String key, double modifier)Get the contents of some PDFlib parameter with string type.java.lang.Stringget_pdi_parameter(java.lang.String key, int doc, int page, int reserved)Deprecated.Use PDF_pcos_get_string().doubleget_pdi_value(java.lang.String key, int doc, int page, int reserved)Deprecated.Use PDF_pcos_get_number().doubleget_value(java.lang.String key, double modifier)Get the value of some PDFlib parameter with numerical type.doubleinfo_font(int font, java.lang.String keyword, java.lang.String optlist)Query detailed information about a loaded font.doubleinfo_matchbox(java.lang.String boxname, int num, java.lang.String keyword)Query information about a matchbox on the current page.doubleinfo_table(int table, java.lang.String keyword)Retrieve table information related to the most recently placed table instance.doubleinfo_textflow(int textflow, java.lang.String keyword)Query the current state of a Textflow.doubleinfo_textline(java.lang.String text, java.lang.String keyword, java.lang.String optlist)Perform textline formatting and query the resulting metrics.voidinitgraphics()Reset all color and graphics state parameters to their defaults.voidlineto(double x, double y)Draw a line from the current point to another point.intload_3ddata(java.lang.String filename, java.lang.String optlist)Load a 3D model from a disk-based or virtual file (requires PDF 1.6).intload_font(java.lang.String fontname, java.lang.String encoding, java.lang.String optlist)Search for a font and prepare it for later use.intload_iccprofile(java.lang.String profilename, java.lang.String optlist)Search for an ICC profile, and prepare it for later use.intload_image(java.lang.String imagetype, java.lang.String filename, java.lang.String optlist)Open a disk-based or virtual image file subject to various options.intmakespotcolor(java.lang.String spotname)Find a built-in spot color name, or make a named spot color from the current fill color.voidmoveto(double x, double y)Set the current point.intopen_CCITT(java.lang.String filename, int width, int height, int BitReverse, int K, int BlackIs1)Deprecated.Use PDF_load_image().intopen_file(java.lang.String filename)Deprecated.Use PDF_begin_document().intopen_image(java.lang.String imagetype, java.lang.String source, byte[] data, long length, int width, int height, int components, int bpc, java.lang.String params)Deprecated.Use PDF_load_image() with virtual files.intopen_image_file(java.lang.String imagetype, java.lang.String filename, java.lang.String stringparam, int intparam)Deprecated.Use PDF_load_image().intopen_pdi(java.lang.String filename, java.lang.String optlist, int reserved)Deprecated.Use PDF_open_pdi_document().intopen_pdi_document(java.lang.String filename, java.lang.String optlist)Open a disk-based or virtual PDF document and prepare it for later use.intopen_pdi_page(int doc, int pagenumber, java.lang.String optlist)Prepare a page for later use with PDF_fit_pdi_page().doublepcos_get_number(int doc, java.lang.String path)Get the value of a pCOS path with type number or boolean.byte[]pcos_get_stream(int doc, java.lang.String optlist, java.lang.String path)Get the contents of a pCOS path with type stream, fstream, or string.java.lang.Stringpcos_get_string(int doc, java.lang.String path)Get the value of a pCOS path with type name, string or boolean.voidplace_image(int image, double x, double y, double scale)Deprecated.Use PDF_fit_image().voidplace_pdi_page(int page, double x, double y, double sx, double sy)Deprecated.Use PDF_fit_pdi_page().intprocess_pdi(int doc, int page, java.lang.String optlist)Process certain elements of an imported PDF document.voidrect(double x, double y, double width, double height)Draw a rectangle.voidrestore()Restore the most recently saved graphics state from the stack.voidresume_page(java.lang.String optlist)Resume a page to add more content to it.voidrotate(double phi)Rotate the coordinate system.voidsave()Save the current graphics state to a stack.voidscale(double sx, double sy)Scale the coordinate system.voidset_border_color(double red, double green, double blue)Deprecated.Use PDF_create_annotation().voidset_border_dash(double b, double w)Deprecated.Use PDF_create_annotation().voidset_border_style(java.lang.String style, double width)Deprecated.Use PDF_create_annotation().voidset_gstate(int gstate)Activate a graphics state object.voidset_info(java.lang.String key, java.lang.String value)Fill document information field key with value.voidset_layer_dependency(java.lang.String type, java.lang.String optlist)Define hierarchical, group and lock condition among layers (requires PDF 1.5).voidset_parameter(java.lang.String key, java.lang.String value)Set some PDFlib parameter with string type.voidset_text_pos(double x, double y)Set the position for text output on the page.voidset_value(java.lang.String key, double value)Set the value of some PDFlib parameter with numerical type.voidsetcolor(java.lang.String fstype, java.lang.String colorspace, double c1, double c2, double c3, double c4)Set the current color space and color.voidsetdash(double b, double w)Set the current dash pattern.voidsetdashpattern(java.lang.String optlist)Set a dash pattern defined by an option list.voidsetflat(double flatness)Set the flatness parameter.voidsetfont(int font, double fontsize)Set the current font in the specified size.voidsetlinecap(int linecap)Set the linecap parameter.voidsetlinejoin(int linejoin)Set the linejoin parameter.voidsetlinewidth(double width)Set the current linewidth.voidsetmatrix(double a, double b, double c, double d, double e, double f)Explicitly set the current transformation matrix.voidsetmiterlimit(double miter)Set the miter limit.voidsetpolydash(float[] dasharray)Deprecated.Use PDF_setdashpattern().intshading(java.lang.String shtype, double x0, double y0, double x1, double y1, double c1, double c2, double c3, double c4, java.lang.String optlist)Define a blend from the current fill color to another color (requires PDF 1.4).intshading_pattern(int shading, java.lang.String optlist)Define a shading pattern using a shading object (requires PDF 1.4).voidshfill(int shading)Fill an area with a shading, based on a shading object (requires PDF 1.4).voidshow(java.lang.String text)Print text in the current font and size at the current position.intshow_boxed(java.lang.String text, double left, double bottom, double width, double height, java.lang.String hmode, java.lang.String feature)Deprecated.Use PDF_fit_textline() or PDF_fit_textflow().voidshow_xy(java.lang.String text, double x, double y)Print text in the current font.voidskew(double alpha, double beta)Skew the coordinate system.doublestringwidth(java.lang.String text, int font, double fontsize)Calculate the width of text in an arbitrary font.voidstroke()Stroke the path with the current color and line width, and clear it.voidsuspend_page(java.lang.String optlist)Suspend the current page so that it can later be resumed.voidtranslate(double tx, double ty)Translate the origin of the coordinate system.
-
-
-
Constructor Detail
-
pdflib
public pdflib() throws PDFlibExceptionCreate a new PDFlib object.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
-
Method Detail
-
activate_item
public final void activate_item(int id) throws PDFlibExceptionActivate a previously created structure element or other content item.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_bookmark
public final int add_bookmark(java.lang.String text, int parent, int open) throws PDFlibExceptionDeprecated.Use PDF_create_bookmark().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_launchlink
public final void add_launchlink(double llx, double lly, double urx, double ury, java.lang.String filename) throws PDFlibExceptionDeprecated.Use PDF_create_action() and PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_locallink
public final void add_locallink(double llx, double lly, double urx, double ury, int page, java.lang.String optlist) throws PDFlibExceptionDeprecated.Use PDF_create_action() and PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_nameddest
public final void add_nameddest(java.lang.String name, java.lang.String optlist) throws PDFlibExceptionCreate a named destination on an arbitrary page in the current document.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_note
public final void add_note(double llx, double lly, double urx, double ury, java.lang.String contents, java.lang.String title, java.lang.String icon, int open) throws PDFlibExceptionDeprecated.Use PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_pdflink
public final void add_pdflink(double llx, double lly, double urx, double ury, java.lang.String filename, int page, java.lang.String optlist) throws PDFlibExceptionDeprecated.Use PDF_create_action() and PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_table_cell
public final int add_table_cell(int table, int column, int row, java.lang.String text, java.lang.String optlist) throws PDFlibExceptionAdd a cell to a new or existing table.- Returns:
- A table handle which can be used in subsequent table-related calls.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_textflow
public final int add_textflow(int textflow, java.lang.String text, java.lang.String optlist) throws PDFlibExceptionCreate a Textflow object, or add text and explicit options to an existing Textflow.- Returns:
- A textflow handle, or -1 on error.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_thumbnail
public final void add_thumbnail(int image) throws PDFlibExceptionAdd an existing image as thumbnail for the current page.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
add_weblink
public final void add_weblink(double llx, double lly, double urx, double ury, java.lang.String url) throws PDFlibExceptionDeprecated.Use PDF_create_action() and PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
arc
public final void arc(double x, double y, double r, double alpha, double beta) throws PDFlibExceptionDraw a counterclockwise circular arc segment.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
arcn
public final void arcn(double x, double y, double r, double alpha, double beta) throws PDFlibExceptionDraw a clockwise circular arc segment.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
attach_file
public final void attach_file(double llx, double lly, double urx, double ury, java.lang.String filename, java.lang.String description, java.lang.String author, java.lang.String mimetype, java.lang.String icon) throws PDFlibExceptionDeprecated.Use PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_document
public final int begin_document(java.lang.String filename, java.lang.String optlist) throws PDFlibExceptionCreate a new PDF file subject to various options.- Returns:
- -1 on error, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_font
public final void begin_font(java.lang.String name, double a, double b, double c, double d, double e, double f, java.lang.String optlist) throws PDFlibExceptionStart a Type 3 font definition.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_glyph
public final void begin_glyph(java.lang.String glyphname, double wx, double llx, double lly, double urx, double ury) throws PDFlibExceptionStart a glyph definition for a Type 3 font.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_item
public final int begin_item(java.lang.String tag, java.lang.String optlist) throws PDFlibExceptionOpen a structure element or other content item with attributes supplied as options.- Returns:
- An item handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_layer
public final void begin_layer(int layer) throws PDFlibExceptionStart a layer for subsequent output on the page (requires PDF 1.5).- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_page
public final void begin_page(double width, double height) throws PDFlibExceptionDeprecated.Use PDF_begin_page_ext().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_page_ext
public final void begin_page_ext(double width, double height, java.lang.String optlist) throws PDFlibExceptionAdd a new page to the document, and specify various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_pattern
public final int begin_pattern(double width, double height, double xstep, double ystep, int painttype) throws PDFlibExceptionStart a pattern definition.- Returns:
- A pattern handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_template
public final int begin_template(double width, double height) throws PDFlibExceptionDeprecated.Use PDF_begin_template_ext().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
begin_template_ext
public final int begin_template_ext(double width, double height, java.lang.String optlist) throws PDFlibExceptionStart a template definition.- Returns:
- A template handle which can be used in subsequent image-related calls, especially PDF_ fit_image().
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
circle
public final void circle(double x, double y, double r) throws PDFlibExceptionDraw a circle.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
clip
public final void clip() throws PDFlibExceptionUse the current path as clipping path, and terminate the path.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
close
public final void close() throws PDFlibExceptionDeprecated.Use PDF_end_document().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
close_image
public final void close_image(int image) throws PDFlibExceptionClose an image.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
close_pdi
public final void close_pdi(int doc) throws PDFlibExceptionDeprecated.Use PDF_close_pdi_document().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
close_pdi_document
public final void close_pdi_document(int doc) throws PDFlibExceptionClose all open PDI page handles, and close the input PDF document.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
close_pdi_page
public final void close_pdi_page(int page) throws PDFlibExceptionClose the page handle, and free all page-related resources.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
closepath
public final void closepath() throws PDFlibExceptionClose the current path.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
closepath_fill_stroke
public final void closepath_fill_stroke() throws PDFlibExceptionClose the path, fill, and stroke it.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
closepath_stroke
public final void closepath_stroke() throws PDFlibExceptionClose the path, and stroke it.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
concat
public final void concat(double a, double b, double c, double d, double e, double f) throws PDFlibExceptionApply a transformation matrix to the current coordinate system.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
continue_text
public final void continue_text(java.lang.String text) throws PDFlibExceptionPrint text at the next line.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_3dview
public final int create_3dview(java.lang.String username, java.lang.String optlist) throws PDFlibExceptionCreate a 3D view (requires PDF 1.6).- Returns:
- A 3D view handle, or -1 on error.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_action
public final int create_action(java.lang.String type, java.lang.String optlist) throws PDFlibExceptionCreate an action which can be applied to various objects and events.- Returns:
- An action handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_annotation
public final void create_annotation(double llx, double lly, double urx, double ury, java.lang.String type, java.lang.String optlist) throws PDFlibExceptionCreate a rectangular annotation on the current page.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_bookmark
public final int create_bookmark(java.lang.String text, java.lang.String optlist) throws PDFlibExceptionCreate a bookmark subject to various options.- Returns:
- A handle for the generated bookmark.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_field
public final void create_field(double llx, double lly, double urx, double ury, java.lang.String name, java.lang.String type, java.lang.String optlist) throws PDFlibExceptionCreate a form field on the current page subject to various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_fieldgroup
public final void create_fieldgroup(java.lang.String name, java.lang.String optlist) throws PDFlibExceptionCreate a form field group subject to various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_gstate
public final int create_gstate(java.lang.String optlist) throws PDFlibExceptionCreate a graphics state object subject to various options.- Returns:
- A graphics state handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_pvf
public final void create_pvf(java.lang.String filename, byte[] data, java.lang.String optlist) throws PDFlibExceptionCreate a named virtual read-only file from data provided in memory.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
create_textflow
public final int create_textflow(java.lang.String text, java.lang.String optlist) throws PDFlibExceptionCreate a Textflow object from text contents, inline options, and explicit options.- Returns:
- A Textflow handle, or -1 on error.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
curveto
public final void curveto(double x1, double y1, double x2, double y2, double x3, double y3) throws PDFlibExceptionDraw a Bezier curve from the current point, using 3 more control points.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
define_layer
public final int define_layer(java.lang.String name, java.lang.String optlist) throws PDFlibExceptionCreate a new layer definition (requires PDF 1.5).- Returns:
- A layer handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_layer_dependency
public final void set_layer_dependency(java.lang.String type, java.lang.String optlist) throws PDFlibExceptionDefine hierarchical, group and lock condition among layers (requires PDF 1.5).- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
delete
public final void delete()
Delete a PDFlib object and free all internal resources. Never throws any PDFlib exception.
-
delete_pvf
public final int delete_pvf(java.lang.String filename) throws PDFlibExceptionDelete a named virtual file and free its data structures (but not the contents).- Returns:
- -1 if the virtual file exists but is locked, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
delete_table
public final void delete_table(int table, java.lang.String optlist) throws PDFlibExceptionDelete a table and all associated data structures.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
delete_textflow
public final void delete_textflow(int textflow) throws PDFlibExceptionDelete a Textflow and all associated data structures.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
encoding_set_char
public final void encoding_set_char(java.lang.String encoding, int slot, java.lang.String glyphname, int uv) throws PDFlibExceptionAdd a glyph name and/or Unicode value to a custom encoding.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_document
public final void end_document(java.lang.String optlist) throws PDFlibExceptionClose the generated PDF document and apply various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_font
public final void end_font() throws PDFlibExceptionTerminate a Type 3 font definition.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_glyph
public final void end_glyph() throws PDFlibExceptionTerminate a glyph definition for a Type 3 font.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_item
public final void end_item(int id) throws PDFlibExceptionClose a structure element or other content item.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_layer
public final void end_layer() throws PDFlibExceptionDeactivate all active layers (requires PDF 1.5).- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_page
public final void end_page() throws PDFlibExceptionDeprecated.Use PDF_end_page_ext().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_page_ext
public final void end_page_ext(java.lang.String optlist) throws PDFlibExceptionFinish a page, and apply various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_pattern
public final void end_pattern() throws PDFlibExceptionFinish a pattern definition.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
end_template
public final void end_template() throws PDFlibExceptionFinish a template definition.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
endpath
public final void endpath() throws PDFlibExceptionEnd the current path without filling or stroking it.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fill
public final void fill() throws PDFlibExceptionFill the interior of the path with the current fill color.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fill_imageblock
public final int fill_imageblock(int page, java.lang.String blockname, int image, java.lang.String optlist) throws PDFlibExceptionFill an image block with variable data according to its properties.- Returns:
- -1 on error, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fill_pdfblock
public final int fill_pdfblock(int page, java.lang.String blockname, int contents, java.lang.String optlist) throws PDFlibExceptionFill a PDF block with variable data according to its properties.- Returns:
- -1 on error, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fill_stroke
public final void fill_stroke() throws PDFlibExceptionFill and stroke the path with the current fill and stroke color.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fill_textblock
public final int fill_textblock(int page, java.lang.String blockname, java.lang.String text, java.lang.String optlist) throws PDFlibExceptionFill a text block with variable data according to its properties.- Returns:
- -1 on error, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
findfont
public final int findfont(java.lang.String fontname, java.lang.String encoding, int options) throws PDFlibExceptionDeprecated.Use PDF_load_font().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fit_image
public final void fit_image(int image, double x, double y, java.lang.String optlist) throws PDFlibExceptionPlace an image or template on the page, subject to various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fit_pdi_page
public final void fit_pdi_page(int page, double x, double y, java.lang.String optlist) throws PDFlibExceptionPlace an imported PDF page on the page subject to various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fit_table
public final java.lang.String fit_table(int table, double llx, double lly, double urx, double ury, java.lang.String optlist) throws PDFlibExceptionFully or partially place a table on the page.- Returns:
- A string which specifies the reason for returning.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fit_textflow
public final java.lang.String fit_textflow(int textflow, double llx, double lly, double urx, double ury, java.lang.String optlist) throws PDFlibExceptionFormat the next portion of a Textflow into a rectangular area.- Returns:
- A string which specifies the reason for returning.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
fit_textline
public final void fit_textline(java.lang.String text, double x, double y, java.lang.String optlist) throws PDFlibExceptionPlace a single line of text at position (x, y) subject to various options.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
get_apiname
public final java.lang.String get_apiname()
Get the name of the API function which threw the last exception or failed.- Returns:
- Name of an API function.
-
get_buffer
public final byte[] get_buffer() throws PDFlibExceptionGet the contents of the PDF output buffer.- Returns:
- A buffer full of binary PDF data for consumption by the client.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
get_errmsg
public final java.lang.String get_errmsg()
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.
-
get_errnum
public final int get_errnum()
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.
-
get_parameter
public final java.lang.String get_parameter(java.lang.String key, double modifier) throws PDFlibExceptionGet the contents of some PDFlib parameter with string type.- Returns:
- The string value of the parameter as a hypertext string.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
get_pdi_parameter
public final java.lang.String get_pdi_parameter(java.lang.String key, int doc, int page, int reserved) throws PDFlibExceptionDeprecated.Use PDF_pcos_get_string().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
get_pdi_value
public final double get_pdi_value(java.lang.String key, int doc, int page, int reserved) throws PDFlibExceptionDeprecated.Use PDF_pcos_get_number().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
get_value
public final double get_value(java.lang.String key, double modifier) throws PDFlibExceptionGet the value of some PDFlib parameter with numerical type.- Returns:
- The numerical value of the parameter.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
info_font
public final double info_font(int font, java.lang.String keyword, java.lang.String optlist) throws PDFlibExceptionQuery detailed information about a loaded font.- Returns:
- The value of some font property as requested by keyword.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
info_matchbox
public final double info_matchbox(java.lang.String boxname, int num, java.lang.String keyword) throws PDFlibExceptionQuery information about a matchbox on the current page.- Returns:
- The value of some matchbox parameter as requested by keyword.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
info_table
public final double info_table(int table, java.lang.String keyword) throws PDFlibExceptionRetrieve table information related to the most recently placed table instance.- Returns:
- The value of some table parameter as requested by keyword.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
info_textline
public final double info_textline(java.lang.String text, java.lang.String keyword, java.lang.String optlist) throws PDFlibExceptionPerform textline formatting and query the resulting metrics.- Returns:
- The value of some text metric value as requested by keyword.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
info_textflow
public final double info_textflow(int textflow, java.lang.String keyword) throws PDFlibExceptionQuery the current state of a Textflow.- Returns:
- The value of some Textflow parameter as requested by keyword.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
initgraphics
public final void initgraphics() throws PDFlibExceptionReset all color and graphics state parameters to their defaults.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
lineto
public final void lineto(double x, double y) throws PDFlibExceptionDraw a line from the current point to another point.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
load_3ddata
public final int load_3ddata(java.lang.String filename, java.lang.String optlist) throws PDFlibExceptionLoad a 3D model from a disk-based or virtual file (requires PDF 1.6).- Returns:
- A 3D handle, or -1 on error.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
load_font
public final int load_font(java.lang.String fontname, java.lang.String encoding, java.lang.String optlist) throws PDFlibExceptionSearch for a font and prepare it for later use.- Returns:
- A font handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
load_iccprofile
public final int load_iccprofile(java.lang.String profilename, java.lang.String optlist) throws PDFlibExceptionSearch for an ICC profile, and prepare it for later use.- Returns:
- A profile handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
load_image
public final int load_image(java.lang.String imagetype, java.lang.String filename, java.lang.String optlist) throws PDFlibExceptionOpen a disk-based or virtual image file subject to various options.- Returns:
- An image handle, or -1 on error.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
makespotcolor
public final int makespotcolor(java.lang.String spotname) throws PDFlibExceptionFind a built-in spot color name, or make a named spot color from the current fill color.- Returns:
- A color handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
moveto
public final void moveto(double x, double y) throws PDFlibExceptionSet the current point.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_CCITT
public final int open_CCITT(java.lang.String filename, int width, int height, int BitReverse, int K, int BlackIs1) throws PDFlibExceptionDeprecated.Use PDF_load_image().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_file
public final int open_file(java.lang.String filename) throws PDFlibExceptionDeprecated.Use PDF_begin_document().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_image
public final int open_image(java.lang.String imagetype, java.lang.String source, byte[] data, long length, int width, int height, int components, int bpc, java.lang.String params) throws PDFlibExceptionDeprecated.Use PDF_load_image() with virtual files.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_image_file
public final int open_image_file(java.lang.String imagetype, java.lang.String filename, java.lang.String stringparam, int intparam) throws PDFlibExceptionDeprecated.Use PDF_load_image().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_pdi
public final int open_pdi(java.lang.String filename, java.lang.String optlist, int reserved) throws PDFlibExceptionDeprecated.Use PDF_open_pdi_document().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_pdi_document
public final int open_pdi_document(java.lang.String filename, java.lang.String optlist) throws PDFlibExceptionOpen a disk-based or virtual PDF document and prepare it for later use.- Returns:
- A PDI document handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
open_pdi_page
public final int open_pdi_page(int doc, int pagenumber, java.lang.String optlist) throws PDFlibExceptionPrepare a page for later use with PDF_fit_pdi_page().- Returns:
- A page handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
pcos_get_number
public final double pcos_get_number(int doc, java.lang.String path) throws PDFlibExceptionGet the value of a pCOS path with type number or boolean.- Returns:
- The numerical value of the object identified by the pCOS path.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
pcos_get_string
public final java.lang.String pcos_get_string(int doc, java.lang.String path) throws PDFlibExceptionGet 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.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
pcos_get_stream
public final byte[] pcos_get_stream(int doc, java.lang.String optlist, java.lang.String path) throws PDFlibExceptionGet the contents of a pCOS path with type stream, fstream, or string.- Returns:
- The unencrypted data contained in the stream or string.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
place_image
public final void place_image(int image, double x, double y, double scale) throws PDFlibExceptionDeprecated.Use PDF_fit_image().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
place_pdi_page
public final void place_pdi_page(int page, double x, double y, double sx, double sy) throws PDFlibExceptionDeprecated.Use PDF_fit_pdi_page().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
process_pdi
public final int process_pdi(int doc, int page, java.lang.String optlist) throws PDFlibExceptionProcess certain elements of an imported PDF document.- Returns:
- -1 on error, and 1 otherwise.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
rect
public final void rect(double x, double y, double width, double height) throws PDFlibExceptionDraw a rectangle.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
restore
public final void restore() throws PDFlibExceptionRestore the most recently saved graphics state from the stack.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
resume_page
public final void resume_page(java.lang.String optlist) throws PDFlibExceptionResume a page to add more content to it.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
rotate
public final void rotate(double phi) throws PDFlibExceptionRotate the coordinate system.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
save
public final void save() throws PDFlibExceptionSave the current graphics state to a stack.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
scale
public final void scale(double sx, double sy) throws PDFlibExceptionScale the coordinate system.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_border_color
public final void set_border_color(double red, double green, double blue) throws PDFlibExceptionDeprecated.Use PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_border_dash
public final void set_border_dash(double b, double w) throws PDFlibExceptionDeprecated.Use PDF_create_annotation().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_border_style
public final void set_border_style(java.lang.String style, double width) throws PDFlibExceptionDeprecated.Use PDF_create_annotation(). "dashed".- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_gstate
public final void set_gstate(int gstate) throws PDFlibExceptionActivate a graphics state object.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_info
public final void set_info(java.lang.String key, java.lang.String value) throws PDFlibExceptionFill document information field key with value.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_parameter
public final void set_parameter(java.lang.String key, java.lang.String value) throws PDFlibExceptionSet some PDFlib parameter with string type.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_text_pos
public final void set_text_pos(double x, double y) throws PDFlibExceptionSet the position for text output on the page.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
set_value
public final void set_value(java.lang.String key, double value) throws PDFlibExceptionSet the value of some PDFlib parameter with numerical type.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setcolor
public final void setcolor(java.lang.String fstype, java.lang.String colorspace, double c1, double c2, double c3, double c4) throws PDFlibExceptionSet the current color space and color.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setdash
public final void setdash(double b, double w) throws PDFlibExceptionSet the current dash pattern.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setdashpattern
public final void setdashpattern(java.lang.String optlist) throws PDFlibExceptionSet a dash pattern defined by an option list.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setflat
public final void setflat(double flatness) throws PDFlibExceptionSet the flatness parameter.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setfont
public final void setfont(int font, double fontsize) throws PDFlibExceptionSet the current font in the specified size.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setlinecap
public final void setlinecap(int linecap) throws PDFlibExceptionSet the linecap parameter.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setlinejoin
public final void setlinejoin(int linejoin) throws PDFlibExceptionSet the linejoin parameter.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setlinewidth
public final void setlinewidth(double width) throws PDFlibExceptionSet the current linewidth.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setmatrix
public final void setmatrix(double a, double b, double c, double d, double e, double f) throws PDFlibExceptionExplicitly set the current transformation matrix.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setmiterlimit
public final void setmiterlimit(double miter) throws PDFlibExceptionSet the miter limit.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
setpolydash
public final void setpolydash(float[] dasharray) throws PDFlibExceptionDeprecated.Use PDF_setdashpattern().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
shading
public final int shading(java.lang.String shtype, double x0, double y0, double x1, double y1, double c1, double c2, double c3, double c4, java.lang.String optlist) throws PDFlibExceptionDefine a blend from the current fill color to another color (requires PDF 1.4).- Returns:
- A shading handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
shading_pattern
public final int shading_pattern(int shading, java.lang.String optlist) throws PDFlibExceptionDefine a shading pattern using a shading object (requires PDF 1.4).- Returns:
- A pattern handle.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
shfill
public final void shfill(int shading) throws PDFlibExceptionFill an area with a shading, based on a shading object (requires PDF 1.4).- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
show
public final void show(java.lang.String text) throws PDFlibExceptionPrint text in the current font and size at the current position.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
show_boxed
public final int show_boxed(java.lang.String text, double left, double bottom, double width, double height, java.lang.String hmode, java.lang.String feature) throws PDFlibExceptionDeprecated.Use PDF_fit_textline() or PDF_fit_textflow().- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
show_xy
public final void show_xy(java.lang.String text, double x, double y) throws PDFlibExceptionPrint text in the current font.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
skew
public final void skew(double alpha, double beta) throws PDFlibExceptionSkew the coordinate system.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
stringwidth
public final double stringwidth(java.lang.String text, int font, double fontsize) throws PDFlibExceptionCalculate the width of text in an arbitrary font.- Returns:
- The width of text.
- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
stroke
public final void stroke() throws PDFlibExceptionStroke the path with the current color and line width, and clear it.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
suspend_page
public final void suspend_page(java.lang.String optlist) throws PDFlibExceptionSuspend the current page so that it can later be resumed.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
translate
public final void translate(double tx, double ty) throws PDFlibExceptionTranslate the origin of the coordinate system.- Throws:
PDFlibException- PDF output cannot be finished after an exception.
-
-