Dùng PHP tạo file .pdf


Sử dụng PHP để tạo file .pdf
<?php
$pdf = pdf_new();
pdf_open_file($pdf, "C:\phpbasic.pdf");
pdf_set_info($pdf, "Author", "Ben Shepherd");
pdf_set_info($pdf, "Title", "Creating a pdf");
pdf_set_info($pdf, "Creator", "Ben Shepherd");
pdf_set_info($pdf, "Subject", "Creating a pdf");
pdf_begin_page($pdf, 595, 842);
$arial = pdf_findfont($pdf, "Arial", "host", 1);
pdf_setfont($pdf, $arial, 14);
pdf_show_xy($pdf, "PHP Group VN",50, 400);
$gif_image = pdf_open_gif($pdf, "phpbasic_logo.gif");
pdf_place_image($pdf, $gif_image, 200, 300, 1.0);
pdf_close_image($pdf, $gif_image);
pdf_end_page($pdf);
pdf_close($pdf);
echo "<A HREF="C:phpbasic.pdf" TARGET="_blank">Open pdf in a new window $user</A>"
?>

Theo phpbasic

Advertisements
By dbglory Posted in PHP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s