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

5. PrintCell procedure

CREATE OR REPLACE procedure test5 is
-- PrintCell procedure
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.SetPrintFont('Arial',null,12); -- set font attributes: family: Arial, style: regular, font size: 12

plpdf.PrintCell(50,10,'Hello World! 1','0'); -- print text: cell size:50*10, no frame
plpdf.PrintCell(50,10,'Hello World! 2','1'); -- print text: cell size:50*10, full frame

plpdf.LineBreak(20); -- line break, height is 20

plpdf.PrintCell(50,10,'Hello World! 1','0',1); -- print text: cell size:50*10, no frame, new line
plpdf.PrintCell(50,10,'Hello World! 2','0',0); -- print text: cell size:50*10, no frame, no new line

plpdf.LineBreak(20); -- line break, height is 20

plpdf.PrintCell(50,10,'Hello World World!','1',1,'L'); -- print text: cell size:50*10, frame, new line, Align: left (default)
plpdf.PrintCell(50,10,'Hello World World!','1',1,'R'); -- print text: cell size:50*10, frame, new line, Align: right
plpdf.PrintCell(50,10,'Hello World World!','1',1,'C'); -- print text: cell size:50*10, frame, new line, Align: center
plpdf.PrintCell(50,10,'Hello World World!','1',1,'J'); -- print text: cell size:50*10, frame, new line, Align: force justification

plpdf.LineBreak(20); -- line break, height is 20

plpdf.SetColor4Filling(200,220,255); -- set default background color
plpdf.PrintCell(50,10,'Hello World!','1',1,'L',1); -- print text: cell size:50*10, frame, new line, Align: left (default), fill background
plpdf.PrintCell(50,10,'Hello World!','1',1,'L',0); -- print text: cell size:50*10, frame, new line, Align: left (default), no fill background

plpdf.LineBreak(20); -- line break, height is 20

plpdf.SetPrintFont('Arial','U',12); -- set font attributes: family: Arial, style: underline, font size: 12
plpdf.PrintCell(50,10,'Hello World!','1',1,'L',0,'http://www.google.com'); -- print text: cell size:50*10, frame, new line, Align: left (default), no fill background, with link

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: test5.prc

Result: test5.pdf

spacer
pl/sql pdf
mod_plsql pdf