You are here: Re: creating pdf's using php « PHP Language « IT news, forums, messages
Re: creating pdf's using php

Posted by John Murtari on 05/16/05 19:10

"Amir" <n@a.com> writes:

> i wrote the following, which causes the script to terminate

> <?
> $pdf = pdf_new();
> pdf_open_file($pdf);
> pdf_set_info($pdf, "author", "test auth");
> pdf_set_info($pdf, "title", "test page");
> pdf_set_info($pdf, "creator", "test creator");
> pdf_set_info($pdf, "subject", "Online test");
> pdf_begin_page($pdf, 450, 450);
>
> $font = pdf_findfont($pdf, "Times-Roman", "winansi",0);
>
> pdf_setfont($pdf, $font, 12);
> pdf_show_xy($pdf, "test text", 5, 20);
>
> pdf_end_page($pdf);
> pdf_close($pdf);
> $buffer = pdf_get_buffer($pdf);
> header("Content-type: application/pdf");
> header("Content-Length: ".strlen($buffer));
> header("Content-Disposition: inline; filename=test.pdf");
>
> echo $buffer;
> pdf_delete($pdf);
>
> ?>

We have a demo of PDF creation with source code
that may help in getting started (May use a different library
package), http://www.thebook-demo.com/php

Hope it helps!
--
John
___________________________________________________________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация