public class PDF
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
int |
add_page_to_outline(java.lang.String title) |
int |
add_page_to_outline(java.lang.String title,
double pos,
int parentId) |
int |
add_page_to_outline(java.lang.String title,
int parentId) |
boolean |
arc(double x1,
double y1,
double r,
double a,
double b)
Creates a counterclockwise arg
|
boolean |
arcn(double x1,
double y1,
double r,
double a,
double b)
Creates a clockwise arc
|
boolean |
begin_document(java.lang.String fileName,
java.lang.String optList) |
boolean |
begin_page_ext(double width,
double height,
java.lang.String opt) |
boolean |
begin_page(double width,
double height) |
int |
charCount(double width,
PDFFont font,
double size) |
boolean |
circle(double x1,
double y1,
double r)
Creates a circle
|
boolean |
clip()
Appends the current path to the clipping path.
|
boolean |
close() |
boolean |
closepath_fill_stroke()
Closes the path strokes
|
boolean |
closepath_stroke()
Closes the path strokes
|
boolean |
closepath()
Closes the path
|
boolean |
concat(double a,
double b,
double c,
double d,
double e,
double f)
Concatenates the matrix
|
boolean |
continue_text(java.lang.String text)
Displays text
|
boolean |
curveto_b(double x1,
double y1,
double x2,
double y2)
Draws a bezier curve
|
boolean |
curveto_e(double x1,
double y1,
double x2,
double y2)
Draws a bezier curve
|
boolean |
curveto(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Draws a bezier curve
|
boolean |
delete() |
boolean |
end_document(java.lang.String optList) |
boolean |
end_page_ext(java.lang.String optlist) |
boolean |
end_page() |
boolean |
endpath()
Ends the path
|
boolean |
fill_stroke()
Fills
|
boolean |
fill()
Fills
|
PDFEmbeddedFile |
fit_embedded_file(Path path,
double x,
double y,
double width,
double height)
open image
|
boolean |
fit_image(PDFImage img,
double x,
double y,
java.lang.String opt) |
Value |
get_buffer(Env env)
Returns the result as a string.
|
java.lang.String |
get_errmsg()
Returns the error message.
|
int |
get_errnum()
Returns the error number.
|
java.lang.String |
get_parameter(java.lang.String name,
double modifier)
Returns the value for a parameter.
|
double |
get_value(java.lang.String name,
double modifier)
Returns the value for a parameter.
|
boolean |
initgraphics(Env env) |
boolean |
lineto(double x,
double y)
Sets the graphics position.
|
PDFFont |
load_font(java.lang.String name,
java.lang.String encoding,
java.lang.String opt)
Loads a font for later use.
|
PDFImage |
load_image(java.lang.String type,
Path file,
java.lang.String optlist)
open image
|
boolean |
moveto(double x,
double y)
Sets the graphics position.
|
PDFImage |
open_image_file(java.lang.String type,
Path file,
java.lang.String stringParam,
int intParam)
open image
|
boolean |
rect(double x,
double y,
double width,
double height)
Creates a rectangle
|
boolean |
restore()
Restores the graphics state.
|
boolean |
rotate(double pDeg)
rotates the coordinates
|
boolean |
save()
Saves the graphics state.
|
boolean |
scale(double sx,
double sy)
scales the coordinates
|
boolean |
set_info(java.lang.String key,
java.lang.String value) |
boolean |
set_parameter(java.lang.String key,
java.lang.String value) |
boolean |
set_text_pos(double x,
double y)
Sets the text position.
|
boolean |
set_value(java.lang.String key,
double value) |
boolean |
setcolor(java.lang.String fstype,
java.lang.String colorspace,
double c1,
double c2,
double c3,
double c4)
Sets the color
|
boolean |
setdash(double b,
double w)
Sets the dashing
|
boolean |
setdashpattern(Env env,
java.lang.String optlist)
Sets the dashing
|
boolean |
setflat(Env env,
double flatness)
Sets the flatness
|
boolean |
setfont(PDFFont font,
double size)
Sets the current font
|
boolean |
setgray_fill(double g)
Sets the color to a grayscale
|
boolean |
setgray_stroke(double g)
Sets the color to a grayscale
|
boolean |
setgray(double g)
Sets the color to a grayscale
|
boolean |
setlinecap(Env env,
int cap)
Sets the linecap style
|
boolean |
setlinejoin(Env env,
int linejoin)
Sets the linejoin style
|
boolean |
setlinewidth(double w)
Sets the line width
|
boolean |
setmatrix(Env env,
double a,
double b,
double c,
double d,
double e,
double f)
Sets the matrix style
|
boolean |
setmiterlimit(Env env,
double v)
Sets the miter limit
|
boolean |
setrgbcolor_fill(double r,
double g,
double b)
Sets the fill color to a rgb
|
boolean |
setrgbcolor_stroke(double r,
double g,
double b)
Sets the color to a rgb
|
boolean |
setrgbcolor(double r,
double g,
double b)
Sets the color to a rgb
|
boolean |
setsolid()
Removes dashing
|
boolean |
shading_pattern(Env env,
int shading,
java.lang.String optlist)
Sets the shading pattern
|
int |
shading(Env env,
java.lang.String type,
double x1,
double y1,
double x2,
double y2,
double c1,
double c2,
double c3,
double c4,
java.lang.String optlist)
Define a blend
|
boolean |
shfill(Env env,
int shading)
Fill with a shading object.
|
boolean |
show_boxed(java.lang.String text,
double x,
double y,
double width,
double height,
java.lang.String mode,
java.lang.String feature)
Displays text
|
boolean |
show_xy(java.lang.String text,
double x,
double y)
Displays text
|
boolean |
show(java.lang.String text)
Displays text
|
boolean |
skew(double aDeg,
double bDeg)
Skews the coordinates
|
double |
stringheight(java.lang.String string,
PDFFont font,
double size) |
double |
stringwidth(java.lang.String string,
PDFFont font,
double size)
Returns the length of a string for a font.
|
boolean |
stroke()
Draws the graph
|
java.lang.String |
toString() |
boolean |
translate(double tx,
double ty)
translates the coordinates
|
public PDF(Env env)
public boolean begin_document(java.lang.String fileName, java.lang.String optList) throws java.io.IOException
java.io.IOException
public boolean begin_page(double width, double height) throws java.io.IOException
java.io.IOException
public boolean begin_page_ext(double width, double height, java.lang.String opt) throws java.io.IOException
java.io.IOException
public int add_page_to_outline(java.lang.String title)
public int add_page_to_outline(java.lang.String title, int parentId)
public int add_page_to_outline(java.lang.String title, double pos, int parentId)
public boolean set_info(java.lang.String key, java.lang.String value)
public boolean set_parameter(java.lang.String key, java.lang.String value)
public boolean set_value(java.lang.String key, double value)
public java.lang.String get_errmsg()
public int get_errnum()
public java.lang.String get_parameter(java.lang.String name, double modifier)
public double get_value(java.lang.String name, double modifier)
public boolean initgraphics(Env env)
public PDFFont load_font(java.lang.String name, java.lang.String encoding, java.lang.String opt) throws java.io.IOException
name
- the font name, e.g. Helveticaencoding
- the font encoding, e.g. winansiopt
- any optionsjava.io.IOException
public boolean setdash(double b, double w)
b
- black lengthw
- which lengthpublic boolean setsolid()
public boolean setdashpattern(Env env, java.lang.String optlist)
public boolean setflat(Env env, double flatness)
public boolean setlinecap(Env env, int cap)
public boolean setlinejoin(Env env, int linejoin)
public boolean setfont(PDFFont font, double size) throws java.io.IOException
name
- the font name, e.g. Helveticaencoding
- the font encoding, e.g. winansiopt
- any optionsjava.io.IOException
public boolean setmatrix(Env env, double a, double b, double c, double d, double e, double f)
public boolean setmiterlimit(Env env, double v)
public boolean shading_pattern(Env env, int shading, java.lang.String optlist)
public int shading(Env env, java.lang.String type, double x1, double y1, double x2, double y2, double c1, double c2, double c3, double c4, java.lang.String optlist)
public boolean shfill(Env env, int shading)
public double stringwidth(java.lang.String string, PDFFont font, double size)
public double stringheight(java.lang.String string, PDFFont font, double size)
public int charCount(double width, PDFFont font, double size)
public boolean set_text_pos(double x, double y)
public boolean fill()
public boolean closepath()
public boolean clip()
public boolean closepath_stroke()
public boolean closepath_fill_stroke()
public boolean fill_stroke()
public boolean endpath()
public boolean curveto(double x1, double y1, double x2, double y2, double x3, double y3)
public boolean curveto_b(double x1, double y1, double x2, double y2)
public boolean curveto_e(double x1, double y1, double x2, double y2)
public boolean arc(double x1, double y1, double r, double a, double b)
public boolean arcn(double x1, double y1, double r, double a, double b)
public boolean circle(double x1, double y1, double r)
public boolean lineto(double x, double y)
public boolean moveto(double x, double y)
public boolean rect(double x, double y, double width, double height)
public boolean setgray_stroke(double g)
public boolean setgray_fill(double g)
public boolean setgray(double g)
public boolean setrgbcolor_stroke(double r, double g, double b)
public boolean setrgbcolor_fill(double r, double g, double b)
public boolean setrgbcolor(double r, double g, double b)
public boolean setcolor(java.lang.String fstype, java.lang.String colorspace, double c1, double c2, double c3, double c4)
public boolean setlinewidth(double w)
public boolean concat(double a, double b, double c, double d, double e, double f)
public PDFImage open_image_file(java.lang.String type, Path file, java.lang.String stringParam, int intParam) throws java.io.IOException
java.io.IOException
public PDFImage load_image(java.lang.String type, Path file, java.lang.String optlist) throws java.io.IOException
java.io.IOException
public boolean fit_image(PDFImage img, double x, double y, java.lang.String opt)
public PDFEmbeddedFile fit_embedded_file(Path path, double x, double y, double width, double height) throws java.io.IOException
java.io.IOException
public boolean skew(double aDeg, double bDeg)
a
- degrees to skew the x axisb
- degrees to skew the y axispublic boolean scale(double sx, double sy)
sx
- amount to scale the x axissy
- amount to scale the y axispublic boolean translate(double tx, double ty)
tx
- amount to translate the x axisty
- amount to translate the y axispublic boolean rotate(double pDeg)
p
- amount to rotatepublic boolean save()
public boolean restore()
public boolean show(java.lang.String text)
public boolean show_boxed(java.lang.String text, double x, double y, double width, double height, java.lang.String mode, java.lang.String feature)
public boolean show_xy(java.lang.String text, double x, double y)
public boolean stroke()
public boolean continue_text(java.lang.String text)
public boolean end_page()
public boolean end_page_ext(java.lang.String optlist)
public boolean end_document(java.lang.String optList) throws java.io.IOException
java.io.IOException
public boolean close() throws java.io.IOException
java.io.IOException
public boolean delete() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object