creating pdf documents using pl/sql create pdf in pl/sql generate pdf in pl/sql
pdf by pl/sql pl/sql Oracle Sql PDF pl/sql pdf generate
tool develop oracle pl/sql download
creating html_db applications
spacer
plsql generate pdf
html_db spacer Home Examples
printemail html_db printed report

14. Draw line

CREATE OR REPLACE procedure test14 is
-- Draw line
l_blob blob;
l_filename varchar2(30) := '123.pdf';
begin
plpdf.init; -- initialize, without parameters means: page orientation: portrait, unit: mm, default page format: A4
plpdf.NewPage; -- begin a new page, without parameters means: page orientation: default (portrait)

plpdf.DrawLine(10,10,10,30); -- draw line: width: default, color: default, start position: x: 10, y: 10, end position x: 10, y: 30
plpdf.SetColor4Drawing(220,50,50); -- set drawing color (RGB)
plpdf.DrawLine(20,10,20,30); -- draw line: width: default, color: previus SetColor4Drawing, start position: x: 20, y: 10, end position x: 20, y: 30
plpdf.SetColor4Drawing(0); -- set drawing color: default
plpdf.DrawLine(30,10,30,30); -- draw line: width: default, color: previus SetColor4Drawing (default), start position: x: 30, y: 10, end position x: 30, y: 30
plpdf.SetLineWidth(0.4); -- set line width: 0.4mm
plpdf.DrawLine(40,10,40,30); -- draw line: width: previus SetLineWidth (0.4mm), color: previus SetColor4Drawing (default), start position: x: 40, y: 10, end position x: 40, y: 30
plpdf.SetColor4Drawing(200,220,255); -- set drawing color (RGB)
plpdf.DrawLine(50,10,50,30); -- draw line: width: previus SetLineWidth (0.4mm), color: previus SetColor4Drawing, start position: x: 50, y: 10, end position x: 50, y: 30

plpdf.SendDoc(l_blob); -- create content

-- print
/*
owa_util.mime_header('application/pdf',false);
htp.p('Content-Disposition: inline; filename="' || l_filename || '"');
htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
owa_util.http_header_close;  
wpg_docload.download_file(l_blob);
*/

-- or store
insert into STORE_BLOB (blob_file, created_date) values (l_blob, sysdate);
commit;
end;
/

Source: test14.prc

Result: test14.pdf

spacer
pl/sql pdf
mod_plsql pdf