PHP to png, png to pdf

Thread Solved

Join Date: Nov 2009
Posts: 3
Reputation: waknash is an unknown quantity at this point 
Solved Threads: 0
waknash waknash is offline Offline
Newbie Poster

PHP to png, png to pdf

 
0
  #1
21 Days Ago
Hi All,
I'm looking for a technique how to save image generated from php to png/jpg/gif, save the image to the server. Later, I want to include the image file to a pdf file generated from a php code.

I'm referring the image generated php from HERE
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: waknash is an unknown quantity at this point 
Solved Threads: 0
waknash waknash is offline Offline
Newbie Poster

Solved already

 
0
  #2
21 Days Ago
I used curl to save image generated from php. Save into the server and retrieve the image and insert into a pdf file generated by php.

Thx
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 147
Reputation: venkat0904 is an unknown quantity at this point 
Solved Threads: 15
venkat0904's Avatar
venkat0904 venkat0904 is offline Offline
Junior Poster
 
0
  #3
21 Days Ago
I am assuming that u r done with image creation on the fly...
tell me if u need to know how to create image too..
to embed that image into a pdf file use this:
  1. <?php
  2. $pdf = pdf_new();
  3. pdf_open_file($pdf, "filename.pdf");
  4. pdf_begin_page($pdf, 595, 842); //sets pdf size 595*842 is A4
  5. $png_image = pdf_open_png($pdf, "image.png"); //image that u want to embed. u can also use pdf_open_image instead
  6. pdf_place_image($pdf, $png_image, 200, 300, 1.0); //parameters: pdf file, image file, x pos, y pos, scale
  7. pdf_close_image($pdf, $png_image);
  8. pdf_end_page($pdf);
  9. pdf_close($pdf);

hope this helps.. cheers !!

Originally Posted by waknash View Post
Hi All,
I'm looking for a technique how to save image generated from php to png/jpg/gif, save the image to the server. Later, I want to include the image file to a pdf file generated from a php code.

I'm referring the image generated php from HERE
Last edited by venkat0904; 21 Days Ago at 5:09 am.
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: waknash is an unknown quantity at this point 
Solved Threads: 0
waknash waknash is offline Offline
Newbie Poster
 
0
  #4
18 Days Ago
Hi,
Some how the pdf generator cannot take image generated by php. So, I have to save the image generated by php to a directory and grab the image put it in pdf generator.

Wonderful.

Nash
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 147
Reputation: venkat0904 is an unknown quantity at this point 
Solved Threads: 15
venkat0904's Avatar
venkat0904 venkat0904 is offline Offline
Junior Poster
 
0
  #5
18 Days Ago
nice..
Originally Posted by waknash View Post
Hi,
Some how the pdf generator cannot take image generated by php. So, I have to save the image generated by php to a directory and grab the image put it in pdf generator.

Wonderful.

Nash
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC