Module eg_pdf

Generate PDF documents main api Created : 25 April 2010 by <wright@servicelevel.net>.

Behaviours: gen_server.

Authors: wright@servicelevel.net.

Description

Generate PDF documents main api Created : 25 April 2010 by <wright@servicelevel.net>

Function Index

add_start_xref/2
add_trailer/4
add_xref/2
append_stream/2
begin_text/1
bezier/5This moves to X1,Y1 point as its start and then creates a cubic Bezier curve to X4,Y4 using the points in between as the control points.
bezier/9This moves to X1,Y1 point as its start and then creates a cubic Bezier curve to X4,Y4 using the points in between as the control points.
bezier_c/4This takes the current point as its start and then creates a cubic Bezier curve to Point3 using the points in between as the control points.
bezier_v/3This takes the current point as its start and then creates a cubic Bezier curve to Point2 using the current point and Point1 as the control points.
bezier_y/3This takes the current point as its start and then creates a cubic Bezier curve to Point3 using the Point1 and Point3 as the control points.
break_text/1
circle/3
cms/1
code_change/3
color/1 R,G,B = 0-255 This may be useful to lookup the rgb value of the color names.
default_face/0
delete/1clear up - delete pdf building process.
ellipse/3
end_text/1
ensure_font_gets_loaded/2
export/1Export to PDF file format return:.
get_page_no/1Useful for page numbering functions etc.
get_state/1return the state of the server.
get_string_width/3
get_string_width/4This function is a bit expensive, but will stick to the public interface.
grid/3Grid assumes sorted XLists and YList, minimum value first.
handle_call/3
handle_cast/2
handle_info/2
header/0
image/2
image/3
image/4
inBuiltFonts/0
inches/1
init/1
kernedtext/2
line/2
line/3
line/5
lines/2
mirror_xaxis/2
mirror_yaxis/2
move_to/2
new/0Spawn pdf building process.
new_page/1Add current page context to PDF document and start on a new page Note page 1 is already created by default and current page set to it after creation of PDF context.
page_script/2
pagesize/1pagesize returns: bounding box {Xleft, Ybottom, Xright, Ytop} full pages are always = {0, 0, Width, Height}.
pagesize/2create a full page bounding box for a page of size Width x Height.
path/2
picas/1
points/1
poly/2Poly paths should be stroked/closed/filled with separate command.
rectangle/3Stroke a rectangle area.
rectangle/4Stroke a rectangle area.
rectangle/5Stroke a rectangle area.
rectangle/6Stroke a rectangle area.
restore_state/1Pop graphics state.
rotate/2Set rotation in degrees.
round_rect/4
round_top_rect/4
save_state/1Push graphics state.
scale/3
set_author/2set the Author atribute of the PDF.
set_char_space/2
set_dash/2
set_dash/3
set_date/4set the Date atribute of the PDF.
set_fill_color/2
set_fill_color_CMYK/5Set color value range 0 - 1.
set_fill_color_RGB/4Set fill color, value range 0 - 1.
set_fill_gray/2Grayscale fill color; 0.0-Black 1.0-White).
set_font/3
set_keywords/2set the Keywords atribute of the PDF.
set_line_cap/2
set_line_join/2
set_line_width/2
set_miter_limit/2
set_page/2Go to a page already created.
set_pagesize/2
set_pagesize/3
set_stroke_color/2
set_stroke_color_CMYK/5
set_stroke_color_RGB/4
set_stroke_gray/2Grayscale strole color; 0.0-Black 1.0-White).
set_subject/2set the Subject atribute of the PDF.
set_text_leading/2
set_text_pos/3
set_text_rendering/2
set_text_rise/2
set_text_scale/2
set_title/2set the Title atribute of the PDF.
set_word_space/2
skew/3
start_link/1
terminate/2
text/2
text_rotate/2Set text rotation in degrees.
text_rotate_position/4
text_transform/7Change geometry.
textbr/2
transform/7Change geometry.
translate/3
xref/2

Function Details

add_start_xref/2

add_start_xref(F::file:iodevice() | atom(), XrefStartPos::integer()) -> ok | {error, term()}

add_trailer/4

add_trailer(F::file:iodevice() | atom(), Objs::list(), Root::any(), Info::any()) -> ok | {error, term()}

add_xref/2

add_xref(F::file:iodevice() | atom(), Objs::[{term(), term()}]) -> integer()

append_stream/2

append_stream(PID::pdf_server_pid(), String::iolist()) -> ok

begin_text/1

begin_text(PID::pdf_server_pid()) -> ok

bezier/5

bezier(PID::pdf_server_pid(), X2::xy(), X3::xy(), X4::xy(), X5::xy()) -> ok

This moves to X1,Y1 point as its start and then creates a cubic Bezier curve to X4,Y4 using the points in between as the control points. Bezier paths should be stroked/closed/filled with a separate command.

bezier/9

bezier(PID::pdf_server_pid(), X1::number(), Y1::number(), X2::number(), Y2::number(), X3::number(), Y3::number(), X4::number(), Y4::number()) -> ok

This moves to X1,Y1 point as its start and then creates a cubic Bezier curve to X4,Y4 using the points in between as the control points. Bezier paths should be stroked/closed/filled with a separate command.

bezier_c/4

bezier_c(PID::pdf_server_pid(), Point1::xy(), Point2::xy(), Point3::xy()) -> ok

This takes the current point as its start and then creates a cubic Bezier curve to Point3 using the points in between as the control points. Bezier paths should be stroked/closed/filled with a separate command.

bezier_v/3

bezier_v(PID::pdf_server_pid(), Point1::xy(), Point2::xy()) -> ok

This takes the current point as its start and then creates a cubic Bezier curve to Point2 using the current point and Point1 as the control points. Bezier paths should be stroked/closed/filled with a separate command.

bezier_y/3

bezier_y(PID::pdf_server_pid(), Point1::xy(), Point3::xy()) -> ok

This takes the current point as its start and then creates a cubic Bezier curve to Point3 using the Point1 and Point3 as the control points. Bezier paths should be stroked/closed/filled with a separate command.

break_text/1

break_text(PID::pdf_server_pid()) -> ok

circle/3

circle(PID::pdf_server_pid(), X2::xy(), R::number()) -> ok

cms/1

cms(X::number()) -> integer()

code_change/3

code_change(OldVsn, State, Extra) -> any()

color/1

color(Color::atom() | rgb_color()) -> rgb_color()

R,G,B = 0-255 This may be useful to lookup the rgb value of the color names

default_face/0

default_face() -> #face{}

delete/1

delete(PID::pdf_server_pid()) -> ok

clear up - delete pdf building process

ellipse/3

ellipse(PID::pdf_server_pid(), X2::xy(), X3::xy()) -> ok

end_text/1

end_text(PID::pdf_server_pid()) -> ok

ensure_font_gets_loaded/2

ensure_font_gets_loaded(PID::pdf_server_pid(), FontName::string()) -> ok

export/1

export(PID::pdf_server_pid()) -> {PDFDoc::binary(), PageNo::integer()} | none()

Export to PDF file format return:

get_page_no/1

get_page_no(PID::pdf_server_pid()) -> non_neg_integer()

Useful for page numbering functions etc.

get_state/1

get_state(PID) -> any()

return the state of the server

get_string_width/3

get_string_width(Fontname::string(), PointSize::integer(), Str::string()) -> integer()

get_string_width/4

get_string_width(PID::pdf_server_pid(), Fontname::string(), PointSize::integer(), Str::string()) -> integer()

This function is a bit expensive, but will stick to the public interface.

grid/3

grid(PID, XList, YList) -> any()

Grid assumes sorted XLists and YList, minimum value first

handle_call/3

handle_call(X1, From, X3) -> any()

handle_cast/2

handle_cast(X1, X2) -> any()

handle_info/2

handle_info(Info, State) -> any()

header/0

header() -> string()

image/2

image(PID::pdf_server_pid(), FilePath::file:name_all()) -> ok | {error, term()}

image/3

image(PID::pdf_server_pid(), FilePath::file:name_all(), Size::xy()) -> ok | {error, term()}

image/4

image(PID::pdf_server_pid(), FilePath::file:name_all(), X3::xy(), Size::img_size_t()) -> ok | {error, term()}

inBuiltFonts/0

inBuiltFonts() -> any()

inches/1

inches(X::number()) -> integer()

init/1

init(Init) -> any()

kernedtext/2

kernedtext(PID::pdf_server_pid(), Text::string()) -> ok

line/2

line(PID::pdf_server_pid(), From_To::xy1_xy2()) -> ok

line/3

line(PID::pdf_server_pid(), From::xy(), To::xy()) -> ok

line/5

line(PID::pdf_server_pid(), X1::number(), Y1::number(), X2::number(), Y2::number()) -> ok

lines/2

lines(PID::pdf_server_pid(), LineList::[xy1_xy2()]) -> ok

mirror_xaxis/2

mirror_xaxis(PID::pdf_server_pid(), Ytranslate::number()) -> ok

mirror_yaxis/2

mirror_yaxis(PID::pdf_server_pid(), Xtranslate::number()) -> ok

move_to/2

move_to(PID::pdf_server_pid(), P::{number(), number()}) -> ok

new/0

new() -> pdf_server_pid()

Spawn pdf building process

new_page/1

new_page(PID::pdf_server_pid()) -> non_neg_integer() | none()

Add current page context to PDF document and start on a new page Note page 1 is already created by default and current page set to it after creation of PDF context.

page_script/2

page_script(PID::pdf_server_pid(), Script::any()) -> ok

pagesize/1

pagesize(X1::atom()) -> xywh()

pagesize returns: bounding box {Xleft, Ybottom, Xright, Ytop} full pages are always = {0, 0, Width, Height}

pagesize/2

pagesize(Width::integer(), Height::integer()) -> xywh()

create a full page bounding box for a page of size Width x Height

path/2

path(PID::pdf_server_pid(), Type::eg_pdf_op:path_t()) -> ok

picas/1

picas(X::number()) -> number()

points/1

points(X::number()) -> number()

poly/2

poly(PID::pdf_server_pid(), Points::[xy()]) -> ok

Poly paths should be stroked/closed/filled with separate command.

rectangle/3

rectangle(PID::pdf_server_pid(), X2::xy(), X3::xy()) -> ok

Stroke a rectangle area. If Stroke Type is not appended in arguments, explicit stroke command "path(StrokeType)" has to be executed. X, Y designate the lower left corner of the rectangle.

rectangle/4

rectangle(PID::pdf_server_pid(), X2::xy(), X3::xy(), StrokeType::eg_pdf_op:path_t()) -> ok

Stroke a rectangle area. If Stroke Type is not appended in arguments, explicit stroke command "path(StrokeType)" has to be executed. X, Y designate the lower left corner of the rectangle.

rectangle/5

rectangle(PID::pdf_server_pid(), X::number(), Y::number(), WX::number(), WY::number()) -> ok

Stroke a rectangle area. If Stroke Type is not appended in arguments, explicit stroke command "path(StrokeType)" has to be executed. X, Y designate the lower left corner of the rectangle.

rectangle/6

rectangle(PID::pdf_server_pid(), X::number(), Y::number(), WX::number(), WY::number(), Option::eg_pdf_op:path_t()) -> ok

Stroke a rectangle area. If Stroke Type is not appended in arguments, explicit stroke command "path(StrokeType)" has to be executed. X, Y designate the lower left corner of the rectangle.

restore_state/1

restore_state(PID::pdf_server_pid()) -> ok

Pop graphics state

rotate/2

rotate(PID::pdf_server_pid(), Angle::number()) -> ok

Set rotation in degrees.

round_rect/4

round_rect(PID::pdf_server_pid(), Point::xy(), Size::xy(), Radius::number()) -> ok

round_top_rect/4

round_top_rect(PID::pdf_server_pid(), Point::xy(), Size::xy(), Radius::number()) -> ok

save_state/1

save_state(PID::pdf_server_pid()) -> ok

Push graphics state

scale/3

scale(PID::pdf_server_pid(), ScaleX::integer(), ScaleY::integer()) -> ok

set_author/2

set_author(PID::pdf_server_pid(), Author::string()) -> ok

set the Author atribute of the PDF

set_char_space/2

set_char_space(PID::pdf_server_pid(), CS::number()) -> ok

set_dash/2

set_dash(PID::pdf_server_pid(), Mode::eg_pdf_op:line_style()) -> ok

set_dash/3

set_dash(PID::pdf_server_pid(), Array::[number()], Phase::number()) -> ok

set_date/4

set_date(PID::pdf_server_pid(), Year::pos_integer(), Month::pos_integer(), Day::pos_integer()) -> ok

set the Date atribute of the PDF

set_fill_color/2

set_fill_color(PID::pdf_server_pid(), Color::atom() | rgb_color()) -> ok

set_fill_color_CMYK/5

set_fill_color_CMYK(PID::pdf_server_pid(), C::number(), M::number(), Y::number(), K::number()) -> ok

Set color value range 0 - 1

set_fill_color_RGB/4

set_fill_color_RGB(PID::pdf_server_pid(), R::number(), G::number(), B::number()) -> ok

Set fill color, value range 0 - 1

set_fill_gray/2

set_fill_gray(PID::pdf_server_pid(), Gray::number()) -> ok

Grayscale fill color; 0.0-Black 1.0-White)

set_font/3

set_font(PID::pdf_server_pid(), Fontname::string(), Size::integer()) -> ok

set_keywords/2

set_keywords(PID, Keywords) -> any()

set the Keywords atribute of the PDF

set_line_cap/2

set_line_cap(PID::pdf_server_pid(), Mode::eg_pdf_op:line_cap_t()) -> ok

set_line_join/2

set_line_join(PID::pdf_server_pid(), Mode::eg_pdf_op:line_join_t()) -> ok

set_line_width/2

set_line_width(PID::pdf_server_pid(), W::number()) -> ok

set_miter_limit/2

set_miter_limit(PID::pdf_server_pid(), Limit::number()) -> ok

set_page/2

set_page(PID::pdf_server_pid(), PageNo::non_neg_integer()) -> ok

Go to a page already created.

set_pagesize/2

set_pagesize(PID::pdf_server_pid(), Size::atom()) -> ok

set_pagesize/3

set_pagesize(PID::pdf_server_pid(), Width::integer(), Height::integer()) -> ok

set_stroke_color/2

set_stroke_color(PID::pdf_server_pid(), Color::atom() | rgb_color()) -> ok

set_stroke_color_CMYK/5

set_stroke_color_CMYK(PID::pdf_server_pid(), C::number(), M::number(), Y::number(), K::number()) -> ok

set_stroke_color_RGB/4

set_stroke_color_RGB(PID::pdf_server_pid(), R::number(), G::number(), B::number()) -> ok

set_stroke_gray/2

set_stroke_gray(PID::pdf_server_pid(), Gray::number()) -> ok

Grayscale strole color; 0.0-Black 1.0-White)

set_subject/2

set_subject(PID::pdf_server_pid(), Subject::string()) -> ok

set the Subject atribute of the PDF

set_text_leading/2

set_text_leading(PID::pdf_server_pid(), L::number()) -> ok

set_text_pos/3

set_text_pos(PID::pdf_server_pid(), X::number(), Y::number()) -> ok

set_text_rendering/2

set_text_rendering(Pid::pdf_server_pid(), Mode::atom() | integer()) -> ok

set_text_rise/2

set_text_rise(PID::pdf_server_pid(), Rise::integer()) -> ok

set_text_scale/2

set_text_scale(PID::pdf_server_pid(), SC::integer()) -> ok

set_title/2

set_title(PID::pdf_server_pid(), Title::string()) -> ok

set the Title atribute of the PDF

set_word_space/2

set_word_space(PID::pdf_server_pid(), WS::number()) -> ok

skew/3

skew(PID::pdf_server_pid(), XSkewAngle::number(), YSkewAngle::number()) -> ok

start_link/1

start_link(Init) -> any()

terminate/2

terminate(Reason, State) -> any()

text/2

text(PID::pdf_server_pid(), Text::iolist()) -> ok

text_rotate/2

text_rotate(PID::pdf_server_pid(), Angle::number()) -> ok

Set text rotation in degrees.

text_rotate_position/4

text_rotate_position(PID::pdf_server_pid(), X::number(), Y::number(), Angle::number()) -> ok

text_transform/7

text_transform(PID::pdf_server_pid(), A::number(), B::number(), C::number(), D::number(), E::number(), F::number()) -> ok

Change geometry

textbr/2

textbr(PID::pdf_server_pid(), Text::iolist()) -> ok

transform/7

transform(PID::pdf_server_pid(), A::number(), B::number(), C::number(), D::number(), E::number(), F::number()) -> ok

Change geometry

translate/3

translate(PID::pdf_server_pid(), X::number(), Y::number()) -> ok

xref/2

xref(I::integer(), Str::string()) -> iolist()


Generated by EDoc