SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need some explaination on File Manipulation.

    i was given a project about File Manipulataion - PDF on php. basically, i am not clear with that. do i have to come out with a script to generate a pdf file or i have to create a script on how to read data on pdf file and put them in the database? i have searched over the internet about this thing and most of them are generate a pdf file using php script. is it true?

    thank you.

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    lalal
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you ask the person who gave you the project ?

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just want to get a description on that project. by the way, i have tried several basic scripts to generate *.doc, *.pdf and *.txt file but when i opened it, i got some error. for example, *.doc file, i need to install a converter. same with *.pdf file.

    this is my testing code which i got it from www.tizag.com.

    PHP Code:
    $myFile "test.txt";
    $fh fopen($myfile'w'); 
    i do not fully understand with the role of w in the code. taken from the website, This bit of code actually has two parts. First we use the function fopen and give it our file name and we inform PHP that we want to write by passing the character "w". am i gonna see w in the file that being created or the w is just one of the method to open a file? do i have to do something like install the converter?

    thank you.

  4. #4
    SitePoint Enthusiast kamakaze03's Avatar
    Join Date
    Nov 2003
    Location
    ohio
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The w is a mode is used to open for writing only; it places the file pointer at the beginning of the file and truncates the file to zero length. If the file does not exist, it will attempt to create it. More: http://us2.php.net/manual/en/function.fopen.php

    As far as using fopen and such to create a word document and especially a PDF file its not that simple. These file types have a lot of "behind-the-scenes" code and formatting which this method will not duplicate therefore you get your error.

    PHP has its own class foe dealing with PDF files. Here is a sample tutorial. You will see what I mean.

  5. #5
    SitePoint Zealot HostsearchUK's Avatar
    Join Date
    Nov 2004
    Location
    Thailand
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you talking about the file manipulation scripts like this ..http://www.hostbiztools.com/Categori..._Manipulation/ ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •