|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpdftron.PDF.ElementBuilder
public class ElementBuilder
ElementBuilder is used to build new PDF.Elements (e.g. image, text, path, etc) from scratch. In conjunction with ElementWriter, ElementBuilder can be used to create new page content.
| Constructor Summary | |
|---|---|
ElementBuilder()
Instantiates a new element builder. |
|
| Method Summary | |
|---|---|
void |
arcTo(double xr,
double yr,
double rx,
boolean isLargeArc,
boolean sweep,
double endX,
double endY)
Draw an arc from the current point to the end point. |
void |
arcTo(double x,
double y,
double width,
double height,
double start,
double extent)
Draw an arc with the specified parameters (upper left corner, width, height and angles). |
void |
closePath()
Closes the current subpath. |
Element |
createEllipse(double cx,
double cy,
double rx,
double ry)
Create an ellipse (or circle, if rx == ry) path Element. |
Element |
createForm(Obj form)
Create a Form XObject Element. |
Element |
createForm(Page page)
Create a Form XObject Element using the content of the existing page. |
Element |
createForm(Page page,
PDFDoc doc)
Create a Form XObject Element using the content of the existing page. |
Element |
createGroupBegin()
Create e_group_begin Element (i.e. |
Element |
createGroupEnd()
Create e_group_end Element (i.e. |
Element |
createImage(Image img)
Create a content image Element out of a given document Image. |
Element |
createImage(Image img,
double x,
double y,
double hscale,
double vscale)
Create a content image Element out of a given document Image with the lower left corner at (x, y), and scale factors (hscale, vscale). |
Element |
createImage(Image img,
Matrix2D mtx)
Create a content image Element out of a given document Image. |
Element |
createPath(double[] points,
byte[] seg_types)
Create a path Element using given path segment data. |
Element |
createRect(double x,
double y,
double width,
double height)
Create a rectangle path Element. |
Element |
createShading(Shading sh)
Create a shading Element. |
Element |
createTextBegin()
Start a text block ('BT' operator in PDF content stream). |
Element |
createTextBegin(Font font,
double font_sz)
Start a text block ('BT' operator in PDF content stream). |
Element |
createTextEnd()
Ends a text block. |
Element |
createTextNewLine()
Create e_text_new_line Element (i.e. |
Element |
createTextNewLine(double dx,
double dy)
Create e_text_new_line Element (i.e. |
Element |
createTextRun(java.lang.String text_data)
Create a new text run. |
Element |
createTextRun(java.lang.String text_data,
Font font,
double font_sz)
Create a text run using the given font. |
Element |
createUnicodeTextRun(java.lang.String text_data)
Create a new Unicode text run. |
void |
curveTo(double cx1,
double cy1,
double cx2,
double cy2,
double x2,
double y2)
Draw a Bezier curve from the current point to the given point (x2, y2) using (cx1, cy1) and (cx2, cy2) as control points. |
void |
destroy()
Frees the native memory of the object. |
void |
ellipse(double cx,
double cy,
double rx,
double ry)
Add an ellipse (or circle, if rx == ry) to the current path as a complete subpath. |
void |
lineTo(double x,
double y)
Draw a line from the current point to the given point. |
void |
moveTo(double x,
double y)
Set the current point. |
void |
pathBegin()
Starts building a new path Element that can contain an arbitrary sequence of lines, curves, and rectangles. |
Element |
pathEnd()
Finishes building of the path Element. |
void |
rect(double x,
double y,
double width,
double height)
Add a rectangle to the current path as a complete subpath. |
void |
reset()
Resets the graphics state of this Element to the default graphics state (i.e. |
void |
reset(GState gs)
The function sets the graphics state of this Element to the given value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ElementBuilder()
throws PDFNetException
PDFNetException| Method Detail |
|---|
public void destroy()
throws PDFNetException
PDFNetException
public void reset()
throws PDFNetException
PDFNetException
public void reset(GState gs)
throws PDFNetException
gs - the given graphics state
PDFNetException
public Element createImage(Image img)
throws PDFNetException
img - the given documen image
PDFNetException
public Element createImage(Image img,
Matrix2D mtx)
throws PDFNetException
img - the given document imagemtx - the image transformation matrix.
PDFNetException
public Element createImage(Image img,
double x,
double y,
double hscale,
double vscale)
throws PDFNetException
img - the give document imagex - the x coordinate of the lower left corner of the imagey - the y coordinate of the lower left corner of the imagehscale - the horizontal scale factorvscale - the vertical scale factor
PDFNetException
public Element createGroupBegin()
throws PDFNetException
PDFNetException
public Element createGroupEnd()
throws PDFNetException
PDFNetException
public Element createShading(Shading sh)
throws PDFNetException
sh - the sh
PDFNetException
public Element createForm(Obj form)
throws PDFNetException
form - a Form XObject content stream
PDFNetException
public Element createForm(Page page)
throws PDFNetException
page - A page used to create the Form XObject.
PDFNetException
public Element createForm(Page page,
PDFDoc doc)
throws PDFNetException
page - A page used to create the Form XObject.doc - Destination document for the Form XObject.
PDFNetException
public Element createTextBegin(Font font,
double font_sz)
throws PDFNetException
font - the font to usefont_sz - the font size
PDFNetException
public Element createTextBegin()
throws PDFNetException
PDFNetException
public Element createTextEnd()
throws PDFNetException
PDFNetException
public Element createTextRun(java.lang.String text_data,
Font font,
double font_sz)
throws PDFNetException
text_data - the text contentfont - the given fontfont_sz - the font size
PDFNetException
public Element createTextRun(java.lang.String text_data)
throws PDFNetException
text_data - the text content
PDFNetException
public Element createUnicodeTextRun(java.lang.String text_data)
throws PDFNetException
text_data - the text content
PDFNetException
public Element createTextNewLine(double dx,
double dy)
throws PDFNetException
dx - the x coordinate of the new linedy - the y coordinate of the new line
PDFNetException
public Element createTextNewLine()
throws PDFNetException
PDFNetException
public Element createPath(double[] points,
byte[] seg_types)
throws PDFNetException
points - the points consists of the pathseg_types - the segment type
PDFNetException
public Element createRect(double x,
double y,
double width,
double height)
throws PDFNetException
x - the x coordinate of the lower left cornery - the y coordinate of the lower left cornerwidth - the width of the rectangleheight - the height of the rectangle
PDFNetException
public Element createEllipse(double cx,
double cy,
double rx,
double ry)
throws PDFNetException
cx - the x coordinate of the ellipse centercy - the y coordinate of the ellipse centerrx - the width of rectangle containing the ellipsery - the height of rectangle containing the ellipse
PDFNetException
public void pathBegin()
throws PDFNetException
PDFNetException
public Element pathEnd()
throws PDFNetException
PDFNetException
public void rect(double x,
double y,
double width,
double height)
throws PDFNetException
x - the x coordinate of the rectangley - the y coordinate of the rectanglewidth - the width of the rectangleheight - the height of the rectangle
PDFNetException
public void moveTo(double x,
double y)
throws PDFNetException
x - the x coordinate of the current pointy - the y coordinate of the current point
PDFNetException
public void lineTo(double x,
double y)
throws PDFNetException
x - the x coordinate of the given pointy - the y coordinate of the given point
PDFNetException
public void curveTo(double cx1,
double cy1,
double cx2,
double cy2,
double x2,
double y2)
throws PDFNetException
cx1 - the x coordinate of the control point 1cy1 - the y coordinate of the control point 1cx2 - the x coordinate of the control point 2cy2 - the y coordinate of the control point 2x2 - the x coordinate of the end pointy2 - the y coordinate of the end point
PDFNetException
public void arcTo(double x,
double y,
double width,
double height,
double start,
double extent)
throws PDFNetException
x - the x coordinates of the lower left corner of the ellipse encompassing rectangley - the y coordinates of the lower left corner of the ellipse encompassing rectanglewidth - the width of the full ellipse (not considering the angular extents).height - the height of the full ellipse (not considering the angular extents).start - starting angle of the arc in degreesextent - angular extent of the arc in degrees
PDFNetException
public void arcTo(double xr,
double yr,
double rx,
boolean isLargeArc,
boolean sweep,
double endX,
double endY)
throws PDFNetException
xr - the x radius for the arcyr - the y radius for the arcrx - x-axis rotation in degreesisLargeArc - indicates if smaller or larger arc is chosen
1 - one of the two larger arc sweeps is chosen
0 - one of the two smaller arc sweeps is chosensweep - direction in which arc is drawn (1 - clockwise, 0 - counterclockwise)endX - the x coordinate of the end pointendY - the y coordinate of the end point
PDFNetException
public void ellipse(double cx,
double cy,
double rx,
double ry)
throws PDFNetException
cx - the x coordinate of the center of the ellipsecy - the y coordinate of the center of the ellipserx - the x radii of the ellipsery - the y radii of the ellipse
PDFNetException
public void closePath()
throws PDFNetException
PDFNetException
|
© 2002-2011 PDFTron Systems Inc. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||