AS_PDF, generating a PDF-document with some plsql
I’ve written a small package (1500 lines). But with this package you can generate a PDF-document with a few lines of PL/SQL code. It’s small because it lacks some functionality. It can only use the standard PDF fonts, and that means that it can only use the WINDOWS-1252 encoding/characterset. But besides that it’s fairly complete.
For instance.
begin as_pdf_mini.init; as_pdf_mini.write( 'Some text with a newline-character included at this " " place.' ); as_pdf_mini.write( 'Normally text written with as_pdf_mini.write() is appended after the previous text. But the text wraps automaticly to a new line.' ); as_pdf_mini.write( 'But you can place your text at any place', -1, 700 ); as_pdf_mini.write( 'you want', 100, 650 ); as_pdf_mini.write( 'You can even align it, left, right, or centered', p_y => 600, p_alignment => 'right' ); as_pdf_mini.save_pdf; end;
And
begin
as_pdf_mini.init;
for i in 1 .. 10
loop
as_pdf_mini.horizontal_line( 30, 700 - i * 15, 100, i );
end loop;
for i in 1 .. 10
loop
as_pdf_mini.vertical_line( 150 + i * 15, 700, 100, i );
end loop;
for i in 0 .. 255
loop
as_pdf_mini.horizontal_line( 330, 700 - i, 100, p_line_color => to_char( i, 'fm0x' ) || to_char( i, 'fm0x' ) || to_char( i, 'fm0x' ) );
end loop;
as_pdf_mini.save_pdf;
end;
And jpg and png images, from a url, the file-system or from a database blob can be included:
And to show the standard PDF fonts
begin as_pdf_mini.init; as_pdf_mini.write( 'The mini version of AS_PDF is restricted to the 14 standard PDF-fonts and the WINDOWS-1252 encoding.' ); as_pdf_mini.set_font( 'helvetica' ); as_pdf_mini.write( 'helvetica, normal: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, 700 ); as_pdf_mini.set_font( 'helvetica', 'I' ); as_pdf_mini.write( 'helvetica, italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'helvetica', 'b' ); as_pdf_mini.write( 'helvetica, bold: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'helvetica', 'BI' ); as_pdf_mini.write( 'helvetica, bold italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'times' ); as_pdf_mini.write( 'times, normal: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, 625 ); as_pdf_mini.set_font( 'times', 'I' ); as_pdf_mini.write( 'times, italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'times', 'b' ); as_pdf_mini.write( 'times, bold: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'times', 'BI' ); as_pdf_mini.write( 'times, bold italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'courier' ); as_pdf_mini.write( 'courier, normal: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, 550 ); as_pdf_mini.set_font( 'courier', 'I' ); as_pdf_mini.write( 'courier, italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'courier', 'b' ); as_pdf_mini.write( 'courier, bold: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'courier', 'BI' ); as_pdf_mini.write( 'courier, bold italic: ' || 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); -- as_pdf_mini.set_font( 'courier' ); as_pdf_mini.write( 'symbol:', -1, 475 ); as_pdf_mini.set_font( 'symbol' ); as_pdf_mini.write( 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); as_pdf_mini.set_font( 'courier' ); as_pdf_mini.write( 'zapfdingbats:', -1, -1 ); as_pdf_mini.set_font( 'zapfdingbats' ); as_pdf_mini.write( 'The quick brown fox jumps over the lazy dog. 1234567890', -1, -1 ); -- as_pdf_mini.set_font( 'times', 'N', 20 ); as_pdf_mini.write( 'times, normal with fontsize 20pt', -1, 400 ); as_pdf_mini.set_font( 'times', 'N', 6 ); as_pdf_mini.write( 'times, normal with fontsize 5pt', -1, -1 ); as_pdf_mini.save_pdf; end;
Or you can write a procedure: refcursor in, pdf out
The package: as_pdf_mini
But see also it successor as_pdf3
Related posts:
- How to use weak ref cursors and bulk collects into a table of objects to clean up data
- New in Oracle 11g: Read Only Tables
- Oracle 11g – Generating PL/SQL Compiler Warnings (Java style) using PL/Scope
- Courtesy of Tom Kyte: Generating rows in SQL with the CUBE statement – no dummy table or table function required
- Creating a shuttlebox in Apex
This entry was posted by Anton Scheffer on October 20, 2010 at 9:28 pm, and is filed under Database, Devel. + PL/SQL tools, General. Follow any responses to this post through RSS 2.0.You can skip to the end and leave a response. Pinging is currently not allowed.
-
Leave a Reply Cancel reply
-
-
#3 written by Franco G. 1 year ago1
Hi Anton
First of all tank you very much for your usefull work.
I had a problem with some browser that not recongnized the pdf file.
I solved the problem with a little modification to a “show” procedure and i’d like to know your opinion about it.
—- original “show” function
procedure show_pdf
is
begin
finish_pdf;
owa_util.mime_header( ‘application/pdf’, false );
htp.print( ‘Content-Length: ‘ || dbms_lob.getlength( pdf_doc ) );
htp.print( ‘Content-disposition: inline’ );
htp.print( ‘Content-Description: Generated by as_xslfo2pdf’ );
owa_util.http_header_close;
wpg_docload.download_file( pdf_doc );
dbms_lob.freetemporary( pdf_doc );
end;
—— modified “show” function
procedure show_pdf (p_name in varchar2)
is
begin
finish_pdf;
owa_util.mime_header( ‘application/pdf’, false );
htp.print( ‘Content-Length: ‘ || dbms_lob.getlength( pdf_doc ) );
– modified and added line
htp.print( ‘Content-disposition: attachment; filename=”‘||p_name||’”‘ );
htp.print( ‘Content-type: application/pdf’ );
—-
htp.print( ‘Content-Description: Generated by as_xslfo2pdf’ );
owa_util.http_header_close;
wpg_docload.download_file( pdf_doc );
dbms_lob.freetemporary( pdf_doc );
end;
 -
#5 written by Mike 1 year ago
-
#7 written by Mohammed Haris 1 year ago1
-
#9 written by Tom 1 year ago1
Anton,
Thank you this has resolved this problem. Unfortunately now I am looking at one that makes no sense to me. Instead of the following lines ending up generating 1 line in the PDF they generate multiple lines on different pages. The intent is that I output the header and footer on each page and then start outputting the body. Any ideas on what is causing this?
– this is the page header
as_pdf2a.write(‘Output by XYZ’,p_y=>500, p_x=>350); –, p_alignment=> ‘center’);
– This is the page footer
as_pdf2a.write(‘Date: ‘||TO_CHAR(pi_as_of,’dd-MON-rr HH:MI AM’),p_y=>40, p_x=>30, p_alignment=> ‘left’);
as_pdf2a.set_font(p_family=> ‘TIMES’, p_style=> ‘N’, p_fontsize_pt=> 18);
as_pdf2a.write(‘Output by XYZ’,p_y=>40, p_x=>350, p_alignment=> ‘center’);
as_pdf2a.set_font(p_family=> ‘TIMES’, p_style=> ‘N’, p_fontsize_pt=> 10);
as_pdf2a.write(‘Page: ‘||pi_page_nbr,p_y=>40, p_x=>740, p_alignment=> ‘right’); -
#11 written by Tom 1 year ago1
Anton,
I have been using your as_pdf_mini package for a prototype that I am working on. Once you get use to the addressing scheme it works quite well. Unfortunately I have run into what I think is a bug and wanted to run it past you.
I have a large varchar2(4000) text field that I am trying to display. The first several lines of the field are quite long. Each line has a CR/LF at the end then a blank line that just has a CR/LF. The lines start wrapping as I would expect but then the calculations that the write function performs doesn’t take into account that a line might wrap more than one time. When that occurs the lines end up overlapping.
I generated 500 words through lipsum.com and pasted that into a variable in your example1. When you do that the problem is apparent. Any thoughts on how to correct this?
Thanks,
Tom-
#12 written by Anton Scheffer 1 year ago1
I would say, upgrade to version 2a, http://technology.amis.nl/blog/wp-content/images/as_pdf2a.txt
Not complete backward compatible, but much better
-
-
-
#16 written by Naing 1 year ago
Anton,
Great package.
I think someone has asked this already…
In one of you examples you have
t_logo varchar2(32767) :=
‘/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkS’ ||….
Â
where the text string is an image of the AMIS logo. Â How or what tools did you use to convert the image (logo) in to the text string?
Â
Â-
#17 written by Anton Scheffer 1 year ago
declare
bf bfile;
x blob;
img varchar2(32767);
begin
bf := bfilename( ‘MY_DIR’, ‘amis_logo.jpg’ );
dbms_lob.open( bf, dbms_lob.LOB_READONLY );
dbms_lob.createtemporary( x, true );
dbms_lob.loadfromfile( x, bf, dbms_lob.LOBMAXSIZE );
dbms_lob.close( bf );
img := utl_raw.cast_to_varchar2( utl_encode.base64_encode( x ) );
dbms_lob.freetemporary( x );
dbms_output.put_line( replace( img, chr(13) || chr(10), ”’ ||’ || chr(13) || chr(10) || ‘ ”’ ) );
end;
-
-
#18 written by Michael Moore 1 year ago
Anton,
I made a slight hack to your code which allows me to add content to previous pages. I found this was necessary to do page numbering such as “Page 3 of  7″ because in my case, there is no way to know that there will be 7 pages until you are actually on page 7.  Thanks for making your code available. I’ve learned a lot just by reading it.. -
#19 written by francesco 1 year ago
Hi anton, I update You about my case. I find the problem!
IN PB I use a OLE OBJ , Â when i tstore the image insert other data about the formt (jpg, bitmap etc etc) . I try to load jpg file directly in blob variable and after store it in DB; using this way I diplay correctly my jpg in pdf.
Thank a lot for you suggest.
Have a good Day
Francesco -
#20 written by francesco 1 year ago
thans Anton, using your Script I obtain :
Â
Not Null
length15872
this is not a jpg I can handle
this is also not a jpg I can handleNot Null
length15872
this is not a jpg I can handle
this is also not a jpg I can handle
Â
I open the jpg (original) file with hex editor, the file start with : FF D8 ( a bitmap is true?) , the hex of the DB start with “D0 CF”.
I use PowerBuilder application to put the image into db; i think pb manipulate the data . I investigate in this way.
thanks a lot, have a good Day
FrancescoÂ
 -
#21 written by francesco 1 year ago
Sorry Anton, I’m crazy….
the correct code is:declare
v_blob blob;
begin
as_pdf_mini.init;
as_pdf_mini.set_format(‘A4′,’L');
select c2 into v_blob from test where c1=’a';
if v_blob is null  then
as_pdf_mini.write(‘NULLLLLL’, 10,10);
else
as_pdf_mini.write(‘Not Null’, 10,10);
as_pdf_mini.put_image(v_blob, 10,100,400,300);
end if;
as_pdf_mini.save_pdf (null,’a.pdf’);
end;
In the pdf I find the ‘not null’ string only.
thanks Francesco-
#22 written by Anton Scheffer 1 year ago
@francesco
You can with this script check if your jpg is a realy a jpg, or a least a jpg as_pdf_mini can handle:
declare
v_blob blob;
begin
select c2 into v_blob from test where c1=’a';
if v_blob is null then
dbms_output.put_line(‘NULLLLLL’);
else
dbms_output.put_line(‘Not Null’);
dbms_output.put_line( ‘length’ || dbms_lob.getlength( v_blob ) );
if ( dbms_lob.substr( v_blob, 2, 1 ) != hextoraw( ‘FFD8′ ) — SOI Start of Image
or dbms_lob.substr( v_blob, 2, dbms_lob.getlength( v_blob ) – 1 ) != hextoraw( ‘FFD9′ ) — EOI End of Image
)
then
dbms_output.put_line( ‘this is not a jpg I can handle’ );
end if;
if dbms_lob.substr( v_blob, 2, 3 ) not in ( hextoraw( ‘FFE0′ ) — a APP0 jpg
, hextoraw( ‘FFE1′ ) — a APP1 jpg
)
then
dbms_output.put_line( ‘this is also not a jpg I can handle’ );
end if;
end if;
end;
-
-
#23 written by francesco 1 year ago
Hi anton. I create a test case.
Create table test vith (c1 varchar2(10),c2 blob));
Insert a jpg in c2 with c1=’a’.
after I run:—————————————————-
declare
v_blob blob;
begin
as_pdf_mini.init;
select c1 into v_blob from test where c1=’a';
dbms_output.put_line(sql%rowcount);
as_pdf_mini.put_image(v_blob, 50,50,400,300);
as_pdf_mini.save_pdf (‘mydir’,'a.pdf’);
end;
—————————————————-
After the a.pdf is created but wothout img. Â Can you help me to understand what happen? thanks a lot francesco
 -
#26 written by francesco 1 year ago
Hi  Anton, I nee your help to solve this problem. I have a table  with a long row data type (contain jpg ).  I want to insert the image into a pdf.
My code:
v_blob blob;
..
Select speall_img  into v_blob from spe_Alleg where rowid = r.riga;
as_pdf_mini.put_image(v_blob, 10,10,400,300);
but The plsql return an error:ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
ORA-06512: at line 350Can You help me? Thanks a lot Francesco
-
#28 written by Anton Scheffer 1 year ago
@franseco
If you have a oracle DIRECTORY, you have a place on the filesystem of your oracle database. and if you have on that place a image file you can use the procedure put_image to put that image in your pdf.
 procedure put_image(
   p_dir => ‘yourDirectory’
 , p_file_name => ‘yourImage.jpg’
 , p_x => 100
 , p_y => 400
); -
#30 written by AJ GOLDEN 1 year ago
-
#31 written by Anton Scheffer 1 year ago
@AJ GOLDEN
If you look in the code of the plugin you can see a line “t_pdf := as_pdf2.get_pdf;”
At that point you have the generated PDF in a blob t_pdf. And you can store that blob in the DB.
For this plugin I used as_pdf2. It’s almost the same as as_pdf_mini, but some procedures added (for different ttf-fonts), some things removed.
-
-
#32 written by AJ GOLDEN 1 year ago
-
#36 written by Brenda 1 year ago
Hi Anton,
It seems like we now know what is happening. The third server where we’re getting the error that I mentioned before, has a verisign security certificate, unlike the other two servers. And we think, that may be causing the error. If you don’t mind me asking, does the as_pdf_mini support this kind of security certificates? the only reason why I ask is because there are other images loaded in the webservice (but not the pdf) and those ones don’t seem to give any trouble.
Thank you so much again!!!
Best regards,
Brenda -
#37 written by Brenda 1 year ago
Hi Anton,
Have you ever run into an error like this:
Error RA-06512: at “SYS.UTL_HTTP”, line 1029 ORA-06512: at “SYS.HTTPURITYPE”, line 70 ORA-06512: at “SOLTRAMUSR.AS_PDF_MINI”, line 1324 ORA-06512: at “WWWUSER.SWGPDFUTIL”, line 665
It’s just that, I have been generating a PDF in two servers already, and up to now, everything is still fine in those two servers, but now I passed everything into a third one, and when I try to load an image into the PDF with the “put_image” function (that’s line 665), I get this error, and haven’t changed anything from one server to the other.
This is line 665:
as_pdf_mini.put_image( p_url =>Â lsPathImagenes, p_x => .01, p_y => .01, p_width => 615, p_height => 855);
I already verified the path, and it is where the image is supposed to be, I checked that the file is there, and it is.
Ring any bells?
Thanks in advance,
Best regards,
Brenda -
-
-
Hi Anton,
thanks for the great package! I really enjoyed using it and I though that I could also contribute a little bit
1. adler32
The function suffers quite a lot of performance hit due to dbms_lob.substr, when you have PDF with a lot of images it really starts to add up… I did a version which is 6x-10x faster:
Â
function adler32(
p_src in blob
) return varchar2 is
l_buf_size pls_integer := 8192;
l_buffer raw(8192);
s1 pls_integer := 1;
s2 pls_integer := 0;
begin
for i in 1 .. ceil(dbms_lob.getlength(p_src)/l_buf_size)
loop
l_buffer := dbms_lob.substr(p_src, l_buf_size, (i-1)*l_buf_size+1);
for j in 1 .. utl_raw.length(l_buffer)
loop
s1 := mod( s1 + utl_raw.cast_to_binary_integer( utl_raw.substr(l_buffer, j, 1) ), 65521 );
s2 := mod( s2 + s1, 65521);
end loop;
end loop;
Â
return to_char( s2, ‘fm0XXX’ ) || to_char( s1, ‘fm0XXX’ );
end;
Â
2. Repeatedly calling INIT will cause LOB descriptors leaks
That’s caused by dbms_lob.createtemporary( pdf_doc, true ) since init does not check if pdf_doc was already allocated or not. Also I thought that it would be nice for a package to offer an option to clean up any outstanding LOB descriptors without having to call finish_pdf (i.e. in case of handling exception and freeing resources) so I’ve added two procedures:
Â
Â
procedure free_tmp_lob(
p_blob in out blob
) is
begin
if ( nvl(dbms_lob.istemporary(p_blob), 0) = 1 )
then
if ( dbms_lob.isopen(p_blob) = 1)
then
dbms_lob.close(p_blob);
end if;
dbms_lob.freetemporary(p_blob);
end if;
end;
Â
procedure free_lobs is
l_n number;
begin
l_n := pages_tab.first;
while ( l_n is not null )
loop
free_tmp_lob(pages_tab(l_n));
l_n := pages_tab.next(l_n);
end loop;
Â
l_n := images.first;
while ( l_n is not null )
loop
free_tmp_lob(images(l_n).pixels);
l_n := images.next(l_n);
end loop;
Â
free_tmp_lob(pdf_doc);
end;
Then I’ve added free_lobs call to the beginning of init procedure.
3. parse_img adler32 call optimization
parse_img has the following call:img.adler32 := nvl( p_adler32
, adler32( p_blob )
);
the problem is that adler32 is going to be called even if p_adler32 is not null (it might be PL/SQL optimizer setting and/or version dependent but though but I didn’t verify that yet) so I’ve rewritten that part as:if (p_adler32 is null)
then
img.adler32 := adler32( p_blob );
else
img.adler32 := p_adler32;
end if;that’s all for now, keep up with the awesome work!
Â
Â-
#44 written by Anton Scheffer 1 year ago1
@Alex
Thanks for the contributions!!! I’ve noticed that the adler32 function was way to slow when I was loading/embedding ttf-fonts (in another version of the package). I’ve settled for this version of the function
function adler32( p_src in blob )
return varchar2
is
s1 number := 1;
s2 number := 0;
step_size number;
tmp varchar2(32766);
c65521 constant number := 65521;
begin
step_size := trunc( 16383 / dbms_lob.getchunksize( p_src ) ) * dbms_lob.getchunksize( p_src );
for j in 0 .. trunc( ( dbms_lob.getlength( p_src ) – 1 ) / step_size )
loop
tmp := rawtohex( dbms_lob.substr( p_src, step_size, j * step_size + 1 ) );
for i in 1 .. length( tmp ) / 2
loop
s1 := s1 + to_number( substr( tmp, i * 2 – 1, 2 ), ‘xx’ );
if s1 >= c65521
then
s1 := s1 – c65521;
end if;
s2 := s2 + s1;
if s2 >= c65521
then
s2 := s2 – c65521;
end if;
end loop;
end loop;
return to_char( s2, ‘fm0XXX’ ) || to_char( s1, ‘fm0XXX’ );
end;
-
-
#46 written by carsten 1 year ago
hello anton,
thanks for this solution. how can i publish the result of the procedure as_pdf_mini.save_pdf in my apex-application?
after the user klick on a button the process start, create the pdf and save this in the directory on the apex-server. now i’ll like to present the result to download for example.
thanks,
carsten -
#49 written by Brenda 1 year ago
Hi Anton,
Thanks for all your help! It did work the displaying of the accented vowels, apparently the problem was about something else.
In the other hand, I wonder if it has happened to you what I’ve seen with my pdf, even though it has been only occasional. Sometimes, when I show it, it first displays a lot of “garbage” in the browser. I’m not 100% sure, but it seems to happen when a session was left in the middle. Have you seen this before?, is there any additional “cleaning” I should do even though from what I saw in your code, the pdf is created as temporary.
Thank you so much in advance!
Brenda -
#52 written by Brenda 1 year ago
Hello Anton,
I need to print few characters which are part from the extended ASCII table (Ã, É, Ã, Ó, Ú). In html I could do this going with UTF-8, is there a way I could have these in my PDF using your package?, could I specify UTF-8 encoding? So far, I haven’t had any problem with the smallcaps (á,é,Ã,ó,ú) but the capital letters show as weird characters.
Thanks in advance,
Best regards,
Brenda -
#56 written by Brenda 1 year ago
-
#58 written by Brenda 1 year ago
Thanks for your response about the images Anton. I greatly appreciate it. It’s weird though, as we are loading the image as url, and if I do the put_image with the url parameter to all pages, it consumes way too much memory… I guess we’ll have to look for alternatives.
There is one more thing I’d like to ask you…about the rect procedure that is used to build boxes…is there a way to print the line thinner?, I have been trying to give a p_line_width smaller than the default 0.5, but it still gets painted the same thickness.
Thanks in advance!!!
Brenda -
#59 written by Sara 1 year ago
-
#62 written by sara 1 year ago
-
#64 written by Anton Scheffer 1 year ago1
-
#67 written by miki 2 years ago
-
#68 written by Anton Scheffer 2 years ago
@miki No, with this (mini) version of the package you can only use the 14 standard PDF fonts. Loading, parsing and using other (ttf)-fonts would more than double the size of the package. I have that working on my Windows machine with an UTF-8 database, but it isn’t code I will publish. Far to much trouble with people wich use a database with a different characterset and a different OS.
-
-
#69 written by miki 2 years ago
-
#71 written by Anton Scheffer 2 years ago
Use one of the overloaded procedures put_image. The package header contains an example.
procedure put_image(
   p_dir in varchar2
 , p_file_name in varchar2
 , p_x in number
 , p_y in number
 , p_width in number := null
 , p_height in number := null
 );
–
 procedure put_image(
   p_url in varchar2
 , p_x in number
 , p_y in number
 , p_width in number := null
 , p_height in number := null
 );
–
 procedure put_image(
   p_img in blob
 , p_x in number
 , p_y in number
 , p_width in number := null
 , p_height in number := null
 ); -
#78 written by tony miller 2 years ago
How would you propose running a ref cursor or a straight cursor against your process?
I just wrote a small little anonymous block:
declare
cursor cur_Invent is
SELECT ITEM,
DESC1 Description,
TO_CHAR(PRICE5,’$999.99′) Price
FROM TEST_INVENTORY
ORDER BY Desc1;begin
as_pdf_mini.init;FOR Invent_rec in cur_Invent
LOOP
as_pdf_mini.write(Invent_rec.Item||’Â Â Â Â ‘);
as_pdf_mini.write(Invent_rec.Description||’Â ‘);
as_pdf_mini.write(Invent_rec.Price);
END LOOP ;
as_pdf_mini.save_pdf;
End;
and It seemed to hang..
Can you have some alignment of columns using the write function or do I format that myself? Also new lines do we add a new line character to get an end of line written?
Thank you,Tony Miller
LuvMuffin Software
(281) 871-0950
Â-
#79 written by Anton Scheffer 2 years ago
@Tony, The package is the mini-version of a more fullblown package, so the functionality is basic. The package header contains an example procedure refcursor2pdf to display a refcursor. And see the source of my APEX plugin, http://www.apex-plugin.com/oracle-apex-plugins/region-plugin/embedded-pdf_65.html, for a much better example of that procedure.
You can use the parameter p_x of the write procedure to do some column formating, that will work better than appending some spaces behind the text (which might cause the hanging of your code, I will look into that some day). A newline character written to write forces a newline in the PDF.
-
-
#80 written by Erich 2 years ago
-
#82 written by Anton Scheffer 2 years ago
@Estevan, the package header include some examples. See refcursor2pdf for the code I used for image5-2. http://technology.amis.nl/blog/wp-content/images/as_pdf_mini.txtÂ
-
#85 written by Ino 2 years ago
There is also this one:
http://reseau.erasme.org/PL-FPDF,1337?lang=fr
Could have saved you some work
Ino
 - Comment Feed for this Post
- Read an Excel xlsx with PL/SQL
- The Very Very Latest in Database Development – slides from the Expertezed presentation
- The APEX of Business Value… or: the Business Value of APEX? Cloud takes Oracle APEX to new heights!
- Kom kennismaken met AMIS en doe mee met uitdagende projecten
- OOW 2012: The Very Very Latest in Database Development (CON4792)
- Oracle RDBMS 10GR1: solution to avoid character encoding in XML with UPDATEXML
- Reduce occurrence of ORA-04068 while upgrading PL/SQL packages by moving global variables to Application Context
- Valuable Java, JavaScript and ADF resources
- Select a blob across a database link, without getting ORA-22992
- ADF 11g Business components – Create PL/SQL based entities





Anton
thank you very much for your quick reply and for having confirmed that the solution could be fine.
I download the new version of as_pdf but i didn’t see the show_pdf function. Why?
Franco