473,804 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem - generate dynamic PDF files on the server

I tried to use HTML2FPDF to generate dynamic local files and save the
generated files on the server. I don't know why it gives me the
following error message:

" Warning: fopen(gen_pdf/gen_pdf/yan.pdf) [function.fopen]: failed to
open stream: No such file or directory in
/export/home/.../pdfCov/fpdf.php on line 1698
FPDF error: Unable to create output file: gen_pdf/yan.pdf "

I cut and paste the following part of the code into a test.php file and
run it. the test file can generate text file without any problem:

$name="testfile .pdf";
$handle = file_exists('ge n_pdf/'.$name);
if (!$handle)
{
$f = fopen('gen_pdf/'.$name,'x+');
}
if(!$f) $this->Error('Unabl e to create output file: '.$name);
fwrite ($f,"testtest") ;
//fwrite($f,$this->buffer,strlen( $this->buffer)); //this line is in
fpdf.php to generate pdf contents

fclose($f)

Anyone can help me out?

Thanks!

Apr 25 '06 #1
2 8051
Hi

I don't know anything about the particular package you are using, but,
looking at your error message and code snippet, I'd guess that the
problem is that the gen_pdf/gen_pdf/ directory does not exist.
(Your testfile just goes to the gen_pdf/ directory, but the package
code appears to be trying to put the file in gen_pdf/gen_pdf/, and if
that sub-directory doesn't exist, you will get that kind of fopen
error.)

HTH

-Kurt

Apr 26 '06 #2
Hi, Kurt,

Thank you for your help.

It was a dumb mistake while I was trying to test in different ways.

I modified the code, but the same error message occurs:

Warning: fopen(gen_pdf/yan.pdf) [function.fopen]: failed to open
stream: No such file or directory in /export/home.../pdfCov/fpdf.php on
line 1698
FPDF error: Unable to create output file: yan.pdf

Any idea what is wrong?

Thanks!

Apr 26 '06 #3

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

Similar topics

9
2319
by: Fred | last post by:
Hi, I'm sure there are a bunch of them, but googling just returned full-fledged CMS that require a DBMS and generate dynamic pages. I'd just like a script that would 1. look in a directory for articles in raw HTML, 2. generate a cooked output for each page (ie. add header and footer, CSS link in HEAD, etc.), 3. regenerate the homepage with "Last modified" bit following each
0
1493
by: Venus | last post by:
Hello, After trying some ways to do it I wanted to use something like the code below but for some reason is not working (I have to generate the entire form dynamically (not only the controls)): Can anyone make any suggestions on how to do it ? Thanks
4
1654
by: matt | last post by:
Hi, I'm writing a visual basic application which searches a database of e-mail messages, based on certain criteria. I'm using dynamic SQL and an exec sp_executesql statement on the dynamic sql string. I'm using full text indexing, and a contains clause to search certain columns, and I'm trying to figure out the best way to validate the input passed from visual basic to my sql query. SQL has certain "noise" words that are ignored, and...
102
6826
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem never to send if-modified-since. But the strange thing is that Opera sends if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it is not refreshing the screen from its cache, it is leaving the screen blank.
3
2253
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr + "&ChartType=" + drpChartType.SelectedItem.Value.ToLower() + "&Print=" + printVersion.ToString() ... Catch e As Exception
5
3177
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But querying a database, negotiatinig lots of if-then-else logic and echo'ing html code out on port 80 every time a page is requested has to be a huge waste of resources. Why not use that logic to print static html instead of dynamic?
5
3867
by: Brad Baker | last post by:
I am trying to make a "tabbed" interface by iterating through a dataset with a conditional statement. For example: ---------------------------------------------------------------------------------------------------------------------- | <a href="config.aspx?siteid=FIEJGIE">Site 1</a| Site 2 | <a href="config.aspx?siteid=DFOWEMF">Site 3</a>| In the example above site 2 is the "current" tab. I have the following code at the top of my...
0
3167
by: ishakteyran | last post by:
I am İshak Teyran , the data manager of a team which attends to IBM XML Challenge Turkey , we are trying to build a dynamic web project in Rational Software Architect 7.5, WAS 7.0 , DB2 9.5 EE. the article of Vitor Rodrigues - http://www.ibm.com/developerworks/data/library/techarticle/dm-0901rodrigues/index.html - describes how to map xml to java using pureQuery however we need to do the same using JPA.. is there any difference? we are...
1
3395
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
0
9712
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7634
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.