create or replace procedure p11d_tpl is l_tpl_1 plpdf_type.tr_tpl_data; l_tpl_2 plpdf_type.tr_tpl_data; l_blob blob; l_tpl_id_1 number; l_tpl_id_2 number; begin l_tpl_1 := plpdf_parser.LoadTemplate(13); l_tpl_2 := plpdf_parser.LoadTemplate(14); plpdf.init; l_tpl_id_1 := plpdf.InsTemplate(l_tpl_1); l_tpl_id_2 := plpdf.InsTemplate(l_tpl_2); -- 1 plpdf.NewPage; plpdf.useTemplate(l_tpl_id_1); plpdf.SetPrintFont('Courier',null,10); plpdf.SetColor4Text(plpdf_const.Blue); -- Employer name plpdf.PrintText(10,61,'OraNext'); -- Employee name plpdf.PrintText(110,61,'John Hilton'); -- Employer PAYE reference plpdf.PrintText(10,72,'123/123456'); -- Works number /department plpdf.PrintText(110,72,'30'); -- National Insurance number plpdf.PrintText(149,72,'AA123456B'); -- A -- Description of asset plpdf.PrintText(49,91,'Precious Metals'); -- -- Cost/ Market value plpdf.PrintText(114,91,'2,000.00'); -- -- Amount made good or from which tax deducted plpdf.PrintText(141,91,'220.00'); -- -- Cash equivalent plpdf.PrintText(178,91,' 1,980.00'); -- B -- Description of payment plpdf.PrintText(49,103,'Season Tickets'); -- -- plpdf.PrintText(177,103,'22,000.00'); -- -- Tax on notional payments... plpdf.PrintText(177,110,' 2,000.00'); -- C -- -- Gross amount plpdf.PrintText(114,124,'2,000.00'); -- -- Amount made good or from which tax deducted plpdf.PrintText(141,124,'200.00'); -- -- Cash equivalent plpdf.PrintText(178,124,' 1,800.00'); -- D -- -- Cash equivalent plpdf.PrintText(178,135,' 9,900.00'); -- D -- -- Taxable amount plpdf.PrintText(178,150,' 220.00'); -- ...................................... -- 2 plpdf.NewPage; plpdf.useTemplate(l_tpl_id_2); -- ...................................... plpdf.SendDoc(l_blob); -- print /* owa_util.mime_header('application/pdf',false); 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; /