473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FPDF

been gleening the user docs for fpdf. there's one simple example for using
the image function. i can't seem to get it to work. has anyone else had
problems with this, and if so, what did you do to diagnose and fix the
problem?

tia,

me
Oct 9 '07 #1
6 5463
"Steve" <no****@example .comwrote in news:cp******** *****@newsfe03. lga:
been gleening the user docs for fpdf. there's one simple example for
using the image function. i can't seem to get it to work. has anyone
else had problems with this, and if so, what did you do to diagnose
and fix the problem?

tia,

me

i've used FPDF and image() successfully... what problems are you having?
Oct 9 '07 #2
"Good Man" <he***@letsgo.c omwrote in message
news:Xn******** *************** *@216.196.97.13 1...
"Steve" <no****@example .comwrote in news:cp******** *****@newsfe03. lga:
>been gleening the user docs for fpdf. there's one simple example for
using the image function. i can't seem to get it to work. has anyone
else had problems with this, and if so, what did you do to diagnose
and fix the problem?

tia,

me


i've used FPDF and image() successfully... what problems are you having?
i just get a blank space where an image should be. there are no errors that
indicate my path is wrong...or anything else. i just get a blank space.
here's my test code:

<?
header('content-type: application/pdf');
require_once 'table.pdf.clas s.php'; // test class to ease table creating
// only calls cell() in fpdf but in a
way
// that make it more html-like in
creation
$imagePath = 'c:/inetpub/wwwroot/toyotaii/images/';
$pdf = new pdfTable();
$pdf->addPage();
$pdf->setFont('Arial ', '', 8);
$image = $pdf->image($imagePa th . 'tccc.logo.jpg' , $pdf->getX(),
$pdf->getY());
$pdf->ln();
$header = array('Country' , 'Capital', 'Area (sq km)', 'Pop.
(thousands)');
$data = $pdf->loadData('coun tries.txt');
$pdf->table($heade r, $data);
$pdf->output();
?>

i did refactor the fpdf class so that all is camel-cased which is our bp for
this customer. however, i tested everything before, during, and after
refactoring to make sure nothing got messed up. at no time did i get an
image.

it's probably just me, but i really didn't find much about using the image
function other than a one line example.

whatever light you can shed will help greatly.

thanks,

me
Oct 9 '07 #3
"Steve" <no****@example .comwrote in news:wT******** ****@newsfe03.l ga:
$image = $pdf->image($imagePa th . 'tccc.logo.jpg' , $pdf->getX(),
$pdf->getY());
two quick troubleshooting things: try assigning variables for $pdf->getX()
and $pdf->getY() and use the variables, and/or try replacing those entirely
with some numerical coordinates just to make sure its being printed
somewhere.

also, i notice that my scripts specify a fourth parameter (the optional
'image width' specification) numerically... if you leave it out, it is
"automatica lly calculated" for better or worse. See if it makes a
difference?

I don't know if you can use actual numbers for your class calls, but most
of the PDFs I've generated with FPDF have a specific place for my images,
thus I am able to use numbers all around ie:

$pdf->Image('image s/receipt300.png' ,10,8,200);
.... to sum up, try replacing variables with numbers, and if it prints, then
the variables are wrong...
FPDF sure does require a lot of trial-and-error time!!!!
Oct 9 '07 #4
"Steve" <no****@example .comwrote in news:wT******** ****@newsfe03.l ga:
i just get a blank space where an image should be. there are no errors
that indicate my path is wrong...or anything else. i just get a blank
space. here's my test code:

<?
header('content-type: application/pdf');
require_once 'table.pdf.clas s.php'; // test class to ease table
creating
// only calls cell() in fpdf but
in a
way
// that make it more html-like in
creation
$imagePath = 'c:/inetpub/wwwroot/toyotaii/images/';
$pdf = new pdfTable();
$pdf->addPage();
$pdf->setFont('Arial ', '', 8);
$image = $pdf->image($imagePa th . 'tccc.logo.jpg' , $pdf->getX(),
$pdf->getY());
And I just noticed this, the function is Image() not image() but perhaps
thats irrelevant if you've camelCased the function definition.
Oct 9 '07 #5

"Good Man" <he***@letsgo.c omwrote in message
news:Xn******** *************** *@216.196.97.13 1...
"Steve" <no****@example .comwrote in news:wT******** ****@newsfe03.l ga:
>$image = $pdf->image($imagePa th . 'tccc.logo.jpg' , $pdf->getX(),
$pdf->getY());

two quick troubleshooting things: try assigning variables for $pdf->getX()
and $pdf->getY() and use the variables, and/or try replacing those
entirely
with some numerical coordinates just to make sure its being printed
somewhere.
the getX and getY calls were from a suggested post i'd come across with
someone else having problems with image(). i put in hard coded values but to
no avail.

also, i notice that my scripts specify a fourth parameter (the optional
'image width' specification) numerically... if you leave it out, it is
"automatica lly calculated" for better or worse. See if it makes a
difference?
yeah, there's a width and height param that are optional. i've hard coded
both, either, and none. still blank space.
I don't know if you can use actual numbers for your class calls, but most
of the PDFs I've generated with FPDF have a specific place for my images,
thus I am able to use numbers all around ie:

$pdf->Image('image s/receipt300.png' ,10,8,200);
yeah, i've tried that too...very frustrating.
... to sum up, try replacing variables with numbers, and if it prints,
then
the variables are wrong...
FPDF sure does require a lot of trial-and-error time!!!!
surprisingly less than what i expected...espe cially since looking at the
source, just getting it up to *some* kind of *good* coding style is a
hurculean task. ;^) anyway, everything i have works with the exception of
image(). it's my first time to generate pdf's in this way and i'm
prototyping reporting functions with pdf output.

before, we'd cheat. we had a pdf print driver on the server and just capture
the normal html and pipe it to the driver to file, and then show/email/etc.
the file. not an option this time.

anyway, thanks for your help.
Oct 9 '07 #6

"Good Man" <he***@letsgo.c omwrote in message
news:Xn******** *************** *@216.196.97.13 1...
"Steve" <no****@example .comwrote in news:wT******** ****@newsfe03.l ga:
>i just get a blank space where an image should be. there are no errors
that indicate my path is wrong...or anything else. i just get a blank
space. here's my test code:

<?
header('conten t-type: application/pdf');
require_once 'table.pdf.clas s.php'; // test class to ease table
creating
// only calls cell() in fpdf but
in a
way
// that make it more html-like in
creation
$imagePath = 'c:/inetpub/wwwroot/toyotaii/images/';
$pdf = new pdfTable();
$pdf->addPage();
$pdf->setFont('Arial ', '', 8);
$image = $pdf->image($imagePa th . 'tccc.logo.jpg' , $pdf->getX(),
$pdf->getY());

And I just noticed this, the function is Image() not image() but perhaps
thats irrelevant if you've camelCased the function definition.
right. that's exactly it. fpfd has been brought into conformance with our
clients best practices...whi ch, part of that is camelCasing interface names
rather than PascalNotation.
Oct 9 '07 #7

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

Similar topics

0
19858
by: madeo | last post by:
hi, i'm looking for some script which would export address labels from a mysql db to pdf ... There's an exapmle, but i'm not able to convert it for using with mysql ... can anybody help? THX a lot Martin :)
4
15739
by: Phillip T. Murphy | last post by:
Not sure if this is the correct forum, but since FPDF is a PHP script, I thought I would give it a try... I am having a problem getting ANYTHING to print in a header using the FPDF functions. I can get text to go into the main body of the PDF file, but nothing into a header. I have messed with this for several hours, seached the web and...
2
7149
by: LordMerlin | last post by:
Hi I'm trying to write a label printing routine, but I'm not being too sucsessful. I'm hoping maybe someone who's used FPDF b4 can help me out? Basically, I want to print labels from a data taken from a MySQL DB, but it doesn't output the labels properly. As soon as it gets to the bottom of the page, it kinda spans the bottom two labels...
3
30305
by: K. | last post by:
Hello! Could you be so kind and help me with one problem I have. I would like to put an image into the table while creating PDF file. I use fpdf class (www.fpdf.org). I cannot find any example in internet and group archieves and www.fpdf.org page.
0
3028
by: Mihamina (R12y) Rakotomandimby | last post by:
Hi, In http://www.fpdf.de/downloads/addons/3/ we can find a function that tries to predict the number of lines un a multicell. I dont understand the algorithm, variables are also named with short names. Would you help to explain? Thank you.
1
6554
by: Thivya | last post by:
hello, I am using Jpgraphs to generate graphs..i have to display the data for plotting the graphs as well.These results has to be in PDF.hence i used FPDF to generate pdf.. Now i can display the data in table format,which are used for plotting the graphs...But i dont know how to insert the graph in FPDF.. I have seen the tutorial where they...
5
7797
by: cappieins | last post by:
Hi, i've got a problem using PHP FPDF library to create PDF files send inline to a browser window. The created PDF file opens correctly in the browser (IE 6), but if I want to save it to my local disk, there is not automatically the filename used I passed
3
3936
by: shikimori | last post by:
HI guys i'm newbie here, sorry if my english is not so well, (well i'm rarely using english ^^) my question is that i'm using PHP to create a report (the report is using FPDF class) as example if i want to create a sales report based on period defined by the user so the value of the starting period n the ending period is saved into a variable...
1
2766
by: Sergei Riaguzov | last post by:
Hi, I'm having problems with fpdf v.1.1 used on the site - it doesn't open all PDFs with setSourceFile it says something about "missing xref headers". So I tried to install a newer fpdf version the v.1.53. And now the setSourceFile method of the previous fpdi class (now it is called FPDF) is gone. What should be used instead of it?
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.