Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to Convert PDF to HTML using php?

    Hi,
    I want to let user to upload pdf file and let my website to convert it to html files (multipage - each page has its own html file). How do I do it?
    Thank you.

  • #2
    New Coder
    Join Date
    May 2008
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try:

    PHP Code:
    <?php

    foreach ($page as $pages_in_pdf)
    {
       
    create_html_file_from_pdf("file_path_here",$page);
    }

    echo 
    "Thank you for creating HTML files!";

    ?>

  • #3
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    ...

    I'm not sure whether that was serious.

    Either way, you'd have to find a premade package that does this. But this seems like an easy thing to find on Google anyway, so not sure why you are asking on here.

  • #4
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    I couldn't find one. The closest thing is pdf2html which is a command line tool. I need some kind of php class or library to do this.
    Thanks.

    Quote Originally Posted by aedrin View Post
    ...

    I'm not sure whether that was serious.

    Either way, you'd have to find a premade package that does this. But this seems like an easy thing to find on Google anyway, so not sure why you are asking on here.

  • #5
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    I haven't tried it, but ... http://sourceforge.net/projects/html2fpdf

  • #6
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    I want pdf to html, NOT html to pdf.

    Quote Originally Posted by PappaJohn View Post
    I haven't tried it, but ... http://sourceforge.net/projects/html2fpdf

  • #7
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    I guess I misread it then, eh?

  • #8
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Quote Originally Posted by dealmaker View Post
    I couldn't find one. The closest thing is pdf2html which is a command line tool. I need some kind of php class or library to do this.
    Thanks.
    What's wrong with using a command line tool? You can execute that through PHP.

    You're not going to find a class that does it all for you. Because this is a large task that PHP is not optimal for (the actual conversion).

  • #9
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    I don't think that I have shell access in my shared hosting.

    Quote Originally Posted by aedrin View Post
    What's wrong with using a command line tool? You can execute that through PHP.

    You're not going to find a class that does it all for you. Because this is a large task that PHP is not optimal for (the actual conversion).

  • #10
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Then you either find a web hosted service that you can send a request to or you are screwed.

  • #11
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is a package out there could 'xpdf', which I understand will let you convert pdf to html, though I havn't tryed it personally.

    An alternative is an implimentation class called 'html_to_pdf.inc.php' which you can get (I think) from phpclasses.dknss.com.

    Let me know how you go.

    I recall seeing something about it
    Quote Originally Posted by dealmaker View Post
    Hi,
    I want to let user to upload pdf file and let my website to convert it to html files (multipage - each page has its own html file). How do I do it?
    Thank you.

  • #12
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, I have read a very useful article about pdf to html conversion at www.nobleatom.com. I hope it will be helpful for you as well. Thanks

  • #13
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Convert PDF to HTML

    1. Convert PDF file to text file using Acrobat Reader or any program similiar. Just save it as a text file, no need for pro or extended versions of reader.
    2. Open TextEdit.app, open up the text file you've created, copy/paste whole thing to a new document window.
    - Open Preferences in TextEdit
    - Go to the "Open/Save" Tab
    - Change Document Type to HTML Strict or XHTML strict depending on your needs. In Styling, select No CSS.
    - Go back and save the new document now as a html file.
    There is a step by step instruction on how to convert PDF to HTML.
    Hope that helps !

    Know more the column of PDF Converter.
    Last edited by inman2787; 03-25-2011 at 01:23 PM.


  •  

    Posting Permissions

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