Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image not working in 11g #2

Open
szamrud opened this issue Jun 11, 2014 · 12 comments
Open

Image not working in 11g #2

szamrud opened this issue Jun 11, 2014 · 12 comments

Comments

@szamrud
Copy link

szamrud commented Jun 11, 2014

Using pl_fpdf I'm able to put image in 10g environment on PDF reports, but when I try the same code in 11g I start getting the error message. look like image part of the code is not working in 11g. Any one has any idea or any solution.

procedure testImg is
img varchar2(2000);
begin
FPDF('P','cm','A4');
openpdf;
AddPage();
SetFont('Arial','B',16);
img := 'http://www.lcw-design.com/jpgAutoc/sigle1.jpg';
Image(img,1, 1, 10);
pl_fpdf.output ();
end testImg;

@Pilooz
Copy link
Owner

Pilooz commented Jul 15, 2014

Hi,
Could you please send the error message you get ?

@szamrud
Copy link
Author

szamrud commented Jul 15, 2014

Hi,
Here is the error, I'm getting.

error

Thanks,
Syed

@padarr
Copy link

padarr commented Oct 16, 2015

I am also having this same issue with images.
I has an issue in the image parser.

Fri, 16 Oct 2015 19:09:20 GMT

Failed to execute target procedure ORA-20100: <B>PL_FPDF error: </B>image : ORA-20100: <B>PL_FPDF error: </B>p_parseImage : ORA-20100: <B>PL_FPDF error: </B>Not a PNG file: http://www.chemeketa.edu/global_files/images/gen/social/facebook1-trans.png
ORA-06512: at "BANINST1.PL_FPDF", line 1948
ORA-06512: at "BANINST1.PL_FPDF", line 3322
ORA-06512: at "BANINST1.RECOGNITION_TEST", line 20
ORA-06512: at line 33

I modified the png_signature and signature_len variables because I noticed tha it wasn't matching what is at the tops of PNG files, looks like it need two more CHR(26) and the char length increased from 8 to 10

png_signature constant varchar2(10)  := chr(137) || 'PNG' || chr(13) || chr(10) || chr(26) || chr(26) || chr(26) || chr(10);
signature_len integer := 10;    

image

Do you have any ideas why this is an issue in 11g ?

@szamrud
Copy link
Author

szamrud commented Oct 16, 2015

I tried every option but it doesn't work for me. I'm using as_pdf3 open source to generate PDFs.

@padarr
Copy link

padarr commented Oct 16, 2015

I'm trying the as_pdf3 but I keep getting an invalid path error when I put
one of the demos in the script?

I could get the pl_fpdf to at least work, just not with images.

@szamrud
Copy link
Author

szamrud commented Oct 16, 2015

pl_fpdf working fine without image, But if you really need image on PDF than only option is as_pdf3. If you search for p_dir and replace the directory name to your oracle directory, hope it will work fine for you.

p_dir varchar2 := 'Oracle Directory'

@padarr
Copy link

padarr commented Oct 16, 2015

Is it trying to save to the database?
What I need it to do is open up a pdf just like the Output() function in
pl_fpdf

@szamrud
Copy link
Author

szamrud commented Oct 16, 2015

For your test you can store in the blob column, for browser you can use as_pdf3.output
CREATE TABLE "TEST_PDF"
( "PDF_FILE" BLOB );

begin
as_pdf3.init;
as_pdf3.write( 'jpg, gif and png images are supported.' );
insert into test_pdf
values (as_pdf3.get_pdf ());
end;

select *
from test_pdf

@padarr
Copy link

padarr commented Oct 16, 2015

I do not see this procedure anywhere in the package. as_pdf3.output doesn't exist in what I downloaded from here https://github.com/mortenbra/alexandria-plsql-utils/tree/master/extras

Is there more that I need to install other than the first two pks and pkb files?

@szamrud
Copy link
Author

szamrud commented Oct 16, 2015

Add this code to your as_pdf3 package spec and body.

procedure output (pb_file blob);

procedure output (pb_file blob) is

lb_file blob;
begin
lb_file := pb_file;
OWA_UTIL.mime_header('application/pdf', FALSE);
HTP.p('Content-Length: ' || DBMS_LOB.getlength(lb_file));
OWA_UTIL.http_header_close;
wpg_docload.download_file(lb_file);
end;

@szamrud
Copy link
Author

szamrud commented Oct 16, 2015

For Browser...

procedure proc_run_report
is
lb_blob blob;
begin
as_pdf3.init;
as_pdf3.write( 'jpg, gif and png images are supported.' );
lb_blob := as_pdf3.get_pdf ();
as_pdf3.output (lb_blob);
end;

@padarr
Copy link

padarr commented Oct 16, 2015

Thank you szamrud... You Rock Sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants