Package com.pdflib
Class pdflib
- java.lang.Object
-
- com.pdflib.pdflib
-
public final class pdflib extends java.lang.Object
PDFlib -- 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 void
activate_item(int id)
Activate a previously created structure element or other content item.int
add_bookmark(java.lang.String text, int parent, int open)
Deprecated.Use PDF_create_bookmark().void
add_launchlink(double llx, double lly, double urx, double ury, java.lang.String filename)
Deprecated.Use PDF_create_action() and PDF_create_annotation().void
add_locallink(double llx, double lly, double urx, double ury, int page, java.lang.String optlist)
Deprecated.Use PDF_create_action() and PDF_create_annotation().void
add_nameddest(java.lang.String name, java.lang.String optlist)
Create a named destination on an arbitrary page in the current document.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)
Deprecated.Use PDF_create_annotation().void
add_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().int
add_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.int
add_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.void
add_thumbnail(int image)
Add an existing image as thumbnail for the current page.void
add_weblink(double llx, double lly, double urx, double ury, java.lang.String url)
Deprecated.Use PDF_create_action() and PDF_create_annotation().void
arc(double x, double y, double r, double alpha, double beta)
Draw a counterclockwise circular arc segment.void
arcn(double x, double y, double r, double alpha, double beta)
Draw a clockwise circular arc segment.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)
Deprecated.Use PDF_create_annotation().int
begin_document(java.lang.String filename, java.lang.String optlist)
Create a new PDF file subject to various options.void
begin_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.void
begin_glyph(java.lang.String glyphname, double wx, double llx, double lly, double urx, double ury)
Start a glyph definition for a Type 3 font.int
begin_item(java.lang.String tag, java.lang.String optlist)
Open a structure element or other content item with attributes supplied as options.void
begin_layer(int layer)
Start a layer for subsequent output on the page (requires PDF 1.5).void
begin_page(double width, double height)
Deprecated.Use PDF_begin_page_ext().void
begin_page_ext(double width, double height, java.lang.String optlist)
Add a new page to the document, and specify various options.int
begin_pattern(double width, double height, double xstep, double ystep, int painttype)
Start a pattern definition.int
begin_template(double width, double height)
Deprecated.Use PDF_begin_template_ext().int
begin_template_ext(double width, double height, java.lang.String optlist)
Start a template definition.void
circle(double x, double y, double r)
Draw a circle.void
clip()
Use the current path as clipping path, and terminate the path.void
close()
Deprecated.Use PDF_end_document().void
close_image(int image)
Close an image.void
close_pdi(int doc)
Deprecated.Use PDF_close_pdi_document().void
close_pdi_document(int doc)
Close all open PDI page handles, and close the input PDF document.void
close_pdi_page(int page)
Close the page handle, and free all page-related resources.void
closepath()
Close the current path.void
closepath_fill_stroke()
Close the path, fill, and stroke it.void
closepath_stroke()
Close the path, and stroke it.void
concat(double a, double b, double c, double d, double e, double f)
Apply a transformation matrix to the current coordinate system.void
continue_text(java.lang.String text)
Print text at the next line.int
create_3dview(java.lang.String username, java.lang.String optlist)
Create a 3D view (requires PDF 1.6).int
create_action(java.lang.String type, java.lang.String optlist)
Create an action which can be applied to various objects and events.void
create_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.int
create_bookmark(java.lang.String text, java.lang.String optlist)
Create a bookmark subject to various options.void
create_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.void
create_fieldgroup(java.lang.String name, java.lang.String optlist)
Create a form field group subject to various options.int
create_gstate(java.lang.String optlist)
Create a graphics state object subject to various options.void
create_pvf(java.lang.String filename, byte[] data, java.lang.String optlist)
Create a named virtual read-only file from data provided in memory.int
create_textflow(java.lang.String text, java.lang.String optlist)
Create a Textflow object from text contents, inline options, and explicit options.void
curveto(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.int
define_layer(java.lang.String name, java.lang.String optlist)
Create a new layer definition (requires PDF 1.5).void
delete()
Delete a PDFlib object and free all internal resources.int
delete_pvf(java.lang.String filename)
Delete a named virtual file and free its data structures (but not the contents).void
delete_table(int table, java.lang.String optlist)
Delete a table and all associated data structures.void
delete_textflow(int textflow)
Delete a Textflow and all associated data structures.void
encoding_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.void
end_document(java.lang.String optlist)
Close the generated PDF document and apply various options.void
end_font()
Terminate a Type 3 font definition.void
end_glyph()
Terminate a glyph definition for a Type 3 font.void
end_item(int id)
Close a structure element or other content item.void
end_layer()
Deactivate all active layers (requires PDF 1.5).void
end_page()
Deprecated.Use PDF_end_page_ext().void
end_page_ext(java.lang.String optlist)
Finish a page, and apply various options.void
end_pattern()
Finish a pattern definition.void
end_template()
Finish a template definition.void
endpath()
End the current path without filling or stroking it.void
fill()
Fill the interior of the path with the current fill color.int
fill_imageblock(int page, java.lang.String blockname, int image, java.lang.String optlist)
Fill an image block with variable data according to its properties.int
fill_pdfblock(int page, java.lang.String blockname, int contents, java.lang.String optlist)
Fill a PDF block with variable data according to its properties.void
fill_stroke()
Fill and stroke the path with the current fill and stroke color.int
fill_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.int
findfont(java.lang.String fontname, java.lang.String encoding, int options)
Deprecated.Use PDF_load_font().void
fit_image(int image, double x, double y, java.lang.String optlist)
Place an image or template on the page, subject to various options.void
fit_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.String
fit_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.String
fit_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.void
fit_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.String
get_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.String
get_errmsg()
Get the text of the last thrown exception or the reason of a failed function call.int
get_errnum()
Get the number of the last thrown exception or the reason of a failed function call.java.lang.String
get_parameter(java.lang.String key, double modifier)
Get the contents of some PDFlib parameter with string type.java.lang.String
get_pdi_parameter(java.lang.String key, int doc, int page, int reserved)
Deprecated.Use PDF_pcos_get_string().double
get_pdi_value(java.lang.String key, int doc, int page, int reserved)
Deprecated.Use PDF_pcos_get_number().double
get_value(java.lang.String key, double modifier)
Get the value of some PDFlib parameter with numerical type.double
info_font(int font, java.lang.String keyword, java.lang.String optlist)
Query detailed information about a loaded font.double
info_matchbox(java.lang.String boxname, int num, java.lang.String keyword)
Query information about a matchbox on the current page.double
info_table(int table, java.lang.String keyword)
Retrieve table information related to the most recently placed table instance.double
info_textflow(int textflow, java.lang.String keyword)
Query the current state of a Textflow.double
info_textline(java.lang.String text, java.lang.String keyword, java.lang.String optlist)
Perform textline formatting and query the resulting metrics.void
initgraphics()
Reset all color and graphics state parameters to their defaults.void
lineto(double x, double y)
Draw a line from the current point to another point.int
load_3ddata(java.lang.String filename, java.lang.String optlist)
Load a 3D model from a disk-based or virtual file (requires PDF 1.6).int
load_font(java.lang.String fontname, java.lang.String encoding, java.lang.String optlist)
Search for a font and prepare it for later use.int
load_iccprofile(java.lang.String profilename, java.lang.String optlist)
Search for an ICC profile, and prepare it for later use.int
load_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.int
makespotcolor(java.lang.String spotname)
Find a built-in spot color name, or make a named spot color from the current fill color.void
moveto(double x, double y)
Set the current point.int
open_CCITT(java.lang.String filename, int width, int height, int BitReverse, int K, int BlackIs1)
Deprecated.Use PDF_load_image().int
open_file(java.lang.String filename)
Deprecated.Use PDF_begin_document().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)
Deprecated.Use PDF_load_image() with virtual files.int
open_image_file(java.lang.String imagetype, java.lang.String filename, java.lang.String stringparam, int intparam)
Deprecated.Use PDF_load_image().int
open_pdi(java.lang.String filename, java.lang.String optlist, int reserved)
Deprecated.Use PDF_open_pdi_document().int
open_pdi_document(java.lang.String filename, java.lang.String optlist)
Open a disk-based or virtual PDF document and prepare it for later use.int
open_pdi_page(int doc, int pagenumber, java.lang.String optlist)
Prepare a page for later use with PDF_fit_pdi_page().double
pcos_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.String
pcos_get_string(int doc, java.lang.String path)
Get the value of a pCOS path with type name, string or boolean.void
place_image(int image, double x, double y, double scale)
Deprecated.Use PDF_fit_image().void
place_pdi_page(int page, double x, double y, double sx, double sy)
Deprecated.Use PDF_fit_pdi_page().int
process_pdi(int doc, int page, java.lang.String optlist)
Process certain elements of an imported PDF document.void
rect(double x, double y, double width, double height)
Draw a rectangle.void
restore()
Restore the most recently saved graphics state from the stack.void
resume_page(java.lang.String optlist)
Resume a page to add more content to it.void
rotate(double phi)
Rotate the coordinate system.void
save()
Save the current graphics state to a stack.void
scale(double sx, double sy)
Scale the coordinate system.void
set_border_color(double red, double green, double blue)
Deprecated.Use PDF_create_annotation().void
set_border_dash(double b, double w)
Deprecated.Use PDF_create_annotation().void
set_border_style(java.lang.String style, double width)
Deprecated.Use PDF_create_annotation().void
set_gstate(int gstate)
Activate a graphics state object.void
set_info(java.lang.String key, java.lang.String value)
Fill document information field key with value.void
set_layer_dependency(java.lang.String type, java.lang.String optlist)
Define hierarchical, group and lock condition among layers (requires PDF 1.5).void
set_parameter(java.lang.String key, java.lang.String value)
Set some PDFlib parameter with string type.void
set_text_pos(double x, double y)
Set the position for text output on the page.void
set_value(java.lang.String key, double value)
Set the value of some PDFlib parameter with numerical type.void
setcolor(java.lang.String fstype, java.lang.String colorspace, double c1, double c2, double c3, double c4)
Set the current color space and color.void
setdash(double b, double w)
Set the current dash pattern.void
setdashpattern(java.lang.String optlist)
Set a dash pattern defined by an option list.void
setflat(double flatness)
Set the flatness parameter.void
setfont(int font, double fontsize)
Set the current font in the specified size.void
setlinecap(int linecap)
Set the linecap parameter.void
setlinejoin(int linejoin)
Set the linejoin parameter.void
setlinewidth(double width)
Set the current linewidth.void
setmatrix(double a, double b, double c, double d, double e, double f)
Explicitly set the current transformation matrix.void
setmiterlimit(double miter)
Set the miter limit.void
setpolydash(float[] dasharray)
Deprecated.Use PDF_setdashpattern().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)
Define a blend from the current fill color to another color (requires PDF 1.4).int
shading_pattern(int shading, java.lang.String optlist)
Define a shading pattern using a shading object (requires PDF 1.4).void
shfill(int shading)
Fill an area with a shading, based on a shading object (requires PDF 1.4).void
show(java.lang.String text)
Print text in the current font and size at the current position.int
show_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().void
show_xy(java.lang.String text, double x, double y)
Print text in the current font.void
skew(double alpha, double beta)
Skew the coordinate system.double
stringwidth(java.lang.String text, int font, double fontsize)
Calculate the width of text in an arbitrary font.void
stroke()
Stroke the path with the current color and line width, and clear it.void
suspend_page(java.lang.String optlist)
Suspend the current page so that it can later be resumed.void
translate(double tx, double ty)
Translate the origin of the coordinate system.
-
-
-
Constructor Detail
-
pdflib
public pdflib() throws PDFlibException
Create 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 PDFlibException
Activate 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Create 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Add 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 PDFlibException
Create 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 PDFlibException
Add 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 PDFlibException
Deprecated.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 PDFlibException
Draw 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 PDFlibException
Draw 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 PDFlibException
Deprecated.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 PDFlibException
Create 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 PDFlibException
Start 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 PDFlibException
Start 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 PDFlibException
Open 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 PDFlibException
Start 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 PDFlibException
Deprecated.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 PDFlibException
Add 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 PDFlibException
Start 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 PDFlibException
Deprecated.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 PDFlibException
Start 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 PDFlibException
Draw a circle.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
clip
public final void clip() throws PDFlibException
Use 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 PDFlibException
Deprecated.Use PDF_end_document().- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
close_image
public final void close_image(int image) throws PDFlibException
Close an image.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
close_pdi
public final void close_pdi(int doc) throws PDFlibException
Deprecated.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 PDFlibException
Close 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 PDFlibException
Close 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 PDFlibException
Close the current path.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
closepath_fill_stroke
public final void closepath_fill_stroke() throws PDFlibException
Close the path, fill, and stroke it.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
closepath_stroke
public final void closepath_stroke() throws PDFlibException
Close 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 PDFlibException
Apply 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 PDFlibException
Print 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Create 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 PDFlibException
Draw 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 PDFlibException
Create 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 PDFlibException
Define 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 PDFlibException
Delete 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 PDFlibException
Delete 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 PDFlibException
Delete 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 PDFlibException
Add 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 PDFlibException
Close 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 PDFlibException
Terminate a Type 3 font definition.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
end_glyph
public final void end_glyph() throws PDFlibException
Terminate 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 PDFlibException
Close 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 PDFlibException
Deactivate 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 PDFlibException
Deprecated.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 PDFlibException
Finish a page, and apply various options.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
end_pattern
public final void end_pattern() throws PDFlibException
Finish a pattern definition.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
end_template
public final void end_template() throws PDFlibException
Finish a template definition.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
endpath
public final void endpath() throws PDFlibException
End the current path without filling or stroking it.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
fill
public final void fill() throws PDFlibException
Fill 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 PDFlibException
Fill 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 PDFlibException
Fill 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 PDFlibException
Fill 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 PDFlibException
Fill 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 PDFlibException
Deprecated.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 PDFlibException
Place 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 PDFlibException
Place 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 PDFlibException
Fully 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 PDFlibException
Format 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 PDFlibException
Place 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 PDFlibException
Get 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 PDFlibException
Get 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Get 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 PDFlibException
Query 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 PDFlibException
Query 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 PDFlibException
Retrieve 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 PDFlibException
Perform 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 PDFlibException
Query 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 PDFlibException
Reset 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 PDFlibException
Draw 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 PDFlibException
Load 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 PDFlibException
Search 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 PDFlibException
Search 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 PDFlibException
Open 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 PDFlibException
Find 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 PDFlibException
Set 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Open 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 PDFlibException
Prepare 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 PDFlibException
Get 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 PDFlibException
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.
- 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 PDFlibException
Get 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Process 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 PDFlibException
Draw a rectangle.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
restore
public final void restore() throws PDFlibException
Restore 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 PDFlibException
Resume 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 PDFlibException
Rotate the coordinate system.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
save
public final void save() throws PDFlibException
Save 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 PDFlibException
Scale 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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Deprecated.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 PDFlibException
Activate 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 PDFlibException
Fill 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 PDFlibException
Set 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 PDFlibException
Set 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 PDFlibException
Set 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 PDFlibException
Set 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 PDFlibException
Set the current dash pattern.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setdashpattern
public final void setdashpattern(java.lang.String optlist) throws PDFlibException
Set 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 PDFlibException
Set the flatness parameter.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setfont
public final void setfont(int font, double fontsize) throws PDFlibException
Set 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 PDFlibException
Set the linecap parameter.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setlinejoin
public final void setlinejoin(int linejoin) throws PDFlibException
Set the linejoin parameter.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setlinewidth
public final void setlinewidth(double width) throws PDFlibException
Set 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 PDFlibException
Explicitly set the current transformation matrix.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setmiterlimit
public final void setmiterlimit(double miter) throws PDFlibException
Set the miter limit.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
setpolydash
public final void setpolydash(float[] dasharray) throws PDFlibException
Deprecated.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 PDFlibException
Define 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 PDFlibException
Define 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 PDFlibException
Fill 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 PDFlibException
Print 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 PDFlibException
Deprecated.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 PDFlibException
Print 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 PDFlibException
Skew 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 PDFlibException
Calculate 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 PDFlibException
Stroke 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 PDFlibException
Suspend 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 PDFlibException
Translate the origin of the coordinate system.- Throws:
PDFlibException
- PDF output cannot be finished after an exception.
-
-