473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

creating pdf using pdf_new()

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

any help is greatly appreciated,

thanks so much in advance!

=======================

<?
$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);

?>
Jul 22 '05 #1
1 1515
sorry
clicked on wrong group
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: michael nieuwenhuizen | last post by:
<newbie alert> hello, just started with PHP last week, and i tried to create a pdf, but i get the error message: Fatal error: Call to undefined function: pdf_new() the php files starts...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
17
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
0
by: raji20 | last post by:
Hello Guys, Im using pdflib for generating pdf, It is working fine, when I used a single page pdf as the template, but when I use a pdf with two pages I dont know how to write in first page and...
1
by: pratibharaut | last post by:
Hello friends, I am trying to create PDF file on linux but got the error for the function PDF_new() undefined function. So I find the libpdf-php.so . and put it into /etc/PHP folder but since...
9
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
1
by: mukeshrasm | last post by:
<?php // create new document pdf_new(); $pdf = pdf_new(); pdf_open_file($pdf); pdf_begin_page($pdf, 500, 700); // define a font $font = pdf_findfont($pdf, "Courier", "host", 0);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.