FPDF PDF Creator PNG Image Issue

General discussion on PHP
Post Reply
jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

FPDF PDF Creator PNG Image Issue

Post by jord1322 » Fri Oct 02, 2015 4:26 pm

Hello,

I know it is about another product technically, but I hoped that someone may be able to assist. I'm using FPDF's PDF Creator and although I know I can use JPG (we have and are) images when creating a PDF we want to be able to use PNG imagse. However, every time I attempt to use a PNG image the PDF does not create, it fails and from what I've read it may have something to do with zlib I believe. How do I activate that or what do I need to do to allow the usage of PNGs or can I even?
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: FPDF PDF Creator PNG Image Issue

Post by scottgcampbell » Fri Oct 02, 2015 5:04 pm

What errors are you getting? Can you post something from the php.log or the error you are getting on the screen?
Does your phpinfo() show that zlib is enabled?

Scott

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: FPDF PDF Creator PNG Image Issue

Post by jord1322 » Fri Oct 02, 2015 5:07 pm

phpinfo() is showing that zlib is off. The log oddly is not returning any errors, which is one reason I'm sort of confused, it simply fails to create the PDF when I attempt to use a PNG image.

I attempted to turn zlib on through the Zend Admin panel by typing "on" where it read "off" and save, but that did nothing, it reverted back.
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: FPDF PDF Creator PNG Image Issue

Post by scottgcampbell » Fri Oct 02, 2015 5:13 pm

Does the Configure command show with-zlib, here is what mine has

Code: Select all

'--with-zlib=/zlib-1.2.3/usr/local/zlib-1.2.3' 

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: FPDF PDF Creator PNG Image Issue

Post by jord1322 » Fri Oct 02, 2015 6:14 pm

I'm sorry but could you let me know how to run the configure command from the command line or green screen?
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: FPDF PDF Creator PNG Image Issue

Post by scottgcampbell » Fri Oct 02, 2015 7:59 pm

Sorry, it is in the top of the phpinfo in the "Configure Command" section. Just wondered if maybe it isn't even compiled into your PHP for some reason.

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: FPDF PDF Creator PNG Image Issue

Post by jord1322 » Fri Oct 02, 2015 8:37 pm

My Configure Command has the exact same piece in it.
Thanks,
Jordon Greene
PHP Full Stack Developer
SHOE SHOW, Inc.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: FPDF PDF Creator PNG Image Issue

Post by scottgcampbell » Mon Oct 05, 2015 3:19 pm

Is there something specific that makes you think that it is related to zlib?
Are you able to step through the code once with JPG and once with PNG to see where it might be failing?
Does the PNG have alpha-transparency? that seems to be a common issue (though it might be fixed in newer versions so you might want to check the version you are running).

Post Reply