1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP class to convert/read PDF into text/doc, examples?

Discussion in 'PHP' started by shmekerosu, May 5, 2010.

  1. #1
    Hello,

    Final goal is to convert/export a pdf content to text format (doc, txt, html etc) online on unix server (PHP, Java, etc).

    I tried with PHP but after searches and trials I could not find a solution. Is there a possiblity, did anyone made this ?

    I found out some PHP library PDFlib but this creates PDF from text not the other way arround. Beside this a lot of programs but in win32 :(

    Please help, I need just a hint and I will take from there...any example ?

    Thanks.
    R.
     
    shmekerosu, May 5, 2010 IP
  2. eddieadams

    eddieadams Well-Known Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    106
    #2
    The best solution is probably to use pdftohtml
     
    eddieadams, May 5, 2010 IP
  3. shmekerosu

    shmekerosu Active Member

    Messages:
    571
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    90
    #3
    ok, it is a good solution but also this is tricky...do you know a good class? or example maybe...or just give me link to information...as I tried several solutions and all failed.

    Not to mention PDF use more encoding types and this makes work harder...someone managed it ??

    Thanks!
     
    shmekerosu, May 5, 2010 IP
  4. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #4
    I did some work on this recently and I couldn't find any php classes that supported all the pdf encoding types. In the end I used php to call xpdf via the command line:

    http://www.foolabs.com/xpdf/download.html
     
    mfscripts, May 6, 2010 IP
  5. shmekerosu

    shmekerosu Active Member

    Messages:
    571
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    90
    #5
    how did you managed to install xpdf on shared hosting ?? can this be done via cpanel or need ssh access with full rights?
     
    shmekerosu, May 6, 2010 IP
  6. Christian Vigh

    Christian Vigh Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
    I've developed a class in pure PHP to extract text contents from pdf files ; it is available here :

    http://www.phpclasses.org/package/9732-PHP-Extract-text-contents-from-PDF-files.html

    Of course, the pdf specifications allow you to write the same contents in many different ways so if you encounter issues, please don't hesitate to send me your PDF file.
     
    Christian Vigh, Jun 2, 2016 IP