944,113 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1519
  • PHP RSS
Nov 6th, 2009
0

PHP to png, png to pdf

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
waknash is offline Offline
3 posts
since Nov 2009
Nov 7th, 2009
0

Solved already

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
waknash is offline Offline
3 posts
since Nov 2009
Nov 7th, 2009
0
Re: PHP to png, png to pdf
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:
PHP Syntax (Toggle Plain Text)
  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 !!

Click to Expand / Collapse  Quote originally posted by waknash ...
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; Nov 7th, 2009 at 5:09 am.
Reputation Points: 13
Solved Threads: 21
Junior Poster
venkat0904 is offline Offline
186 posts
since Oct 2009
Nov 10th, 2009
0
Re: PHP to png, png to pdf
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
waknash is offline Offline
3 posts
since Nov 2009
Nov 10th, 2009
0
Re: PHP to png, png to pdf
nice..
Click to Expand / Collapse  Quote originally posted by waknash ...
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
Reputation Points: 13
Solved Threads: 21
Junior Poster
venkat0904 is offline Offline
186 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Browser can't find files after changing permissions
Next Thread in PHP Forum Timeline: getting variable without extension





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC