2012年12月3日月曜日

image raw data or svg into pdf?!

Hi!
Is there any idea to add GD2 raw data or SVG into a PDF File? I have a
customer that want's to get this problem realized.
If any of you guys are able to to help me further according this
problem, I would thank you kindly.

with kind regards


=>
Hi Tamer,
FPDF supports PNG and JPEG formats, that are on the local file system.
If you want to use an image from a different source such as raw GD data
you will need to output the pdf to a temp file, and then reference that
temp file in the the FPDF image method.

For PNG images the alpha channel is not supported (transparency).

Example
1.
<?php
2.
require("fpdf/fpdf.php"); // Load the fpdf library
3.

4.
$pdf=new FPDF(); // Create a new
instance of the fpdf object
5.
$pdf->AddPage(); // Add Page 1
6.

7.
$pdf->Image("php.png", 40, 40); // Place the file
php.png 40 mm across, and 40 mm down the page
8.
$pdf->Output(); // Output the PDF
9.
?>

More information and examples for FPDF is available from:
http://www.fpdf.org
http://www.phpmaniac.net/wiki/index.php/Create_PDF

I'll try to get an example up on how to add content to an existing PDF
in the next couple of days, but you probably want look at fpdi which I
have used with excellent results.

http://www.setasign.de/products/pdf-php-solutions/fpdi/

--
Hope this helps, Cheers

0 件のコメント:

コメントを投稿