0

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

2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by venkat0904
0

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

0

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
$pdf = pdf_new();
pdf_open_file($pdf, "filename.pdf");
pdf_begin_page($pdf, 595, 842);  //sets pdf size 595*842 is A4
$png_image = pdf_open_png($pdf, "image.png");  //image that u want to embed. u can also use pdf_open_image instead
pdf_place_image($pdf, $png_image, 200, 300, 1.0);  //parameters: pdf file, image file, x pos, y pos, scale
pdf_close_image($pdf, $png_image);
pdf_end_page($pdf);
pdf_close($pdf);

hope this helps.. cheers !!

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

Edited by venkat0904: n/a

0

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

0

nice..

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.