www.webdeveloper.com
Results 1 to 10 of 10

Thread: PDF to HTML conversion---PHP

  1. #1
    Join Date
    May 2006
    Posts
    141

    Thumbs up PDF to HTML conversion---PHP

    Hi friends,

    I need some clarification to covert the pdf file to html file using php.

    I have no idea to convert the files using php. Please send me any ideas and your suggestion how to convert the pdf files to html ..


    Thanks
    Vssp

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,330
    PHP does not have any built-in functions that directly support this. Writing your own would be far from trivial. My recommendation would be to search the web for existing scripts that do this conversion.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    I can't see how it could even be possible. PDF documents have layout while HTML documents do not; and PDF documents have a page size while HTML documents do not even have pages. I would make a comparison between this and doing a .doc to a .txt conversion where all formatting would be lost in the process. Even a sledgehammer like Google with its massive resources can't get this right. Just try the convert pdf >> html feature on its search page to see what I mean.

    Obviously if the converssion were the other way around (HTML >> PDF... .txt >> .doc) it would be easy and there is plenty of software that can do this... fpdf for example.

  4. #4
    Join Date
    Oct 2005
    Posts
    43

    Arrow

    I have seen this done on google - i dont know how...

    [PDF] Owner’s ManualFile Format: PDF/Adobe Acrobat - View as HTML

    Have a look at this example...

    Dont know if that helps, but hey.
    - Christian

  5. #5
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    Quote Originally Posted by CAT web design
    I have seen this done on google - i dont know how...

    [PDF] Owner’s ManualFile Format: PDF/Adobe Acrobat - View as HTML

    Have a look at this example...

    Dont know if that helps, but hey.
    That's exactly what I am talking about. If you look at the html documents they are a terrible mess.

    And try looking at the html itself... absolute gobbledegook.
    Last edited by bokeh; 07-27-2006 at 04:16 AM.

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,330
    If you just want to do a one-off conversion, check out this page: http://www.adobe.com/products/acroba...linetools.html
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  7. #7
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Why convert PDF to HTML.

    You can write web pages in HTML or PDF. PDF ones can contain embedded fonts and will always display exactly as shown whereas HTML wont.

    You can attach Javascript to HTML and to PDF to create the same effects.

    Both support links from one page or position on a page to another.

    PDF supports everything for the web that HTML does and a few additional features that can't be done using HTML.
    Stephen

  8. #8
    Join Date
    Nov 2012
    Location
    India
    Posts
    3

    Thumbs up Online Tool to Convert Webpage(HTML) into PDF Format

    You may be saving a webpage as a html file to read it offline. But instead of saving it as html, you can convert a webpage into pdf format. This can prove to be more effective way of viewing data offline.

    http://html-2-pdf.com is an online tool to convert webpages into PDF(Portable Document Format) documents. It’s basically an online converter which could transform any websites to a PDF document. Generally it could be more useful if you want to print a website.
    ======================================================================================
    for more info read my blog http://blogbyanoopsharma.wordpress.com/

  9. #9
    Join Date
    Oct 2012
    Posts
    17
    The link below will has a script to convert the PDF file to HTML, this may help you, check it out.

    http://www.articlediary.com/article/...rsion-125.html

  10. #10
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,266
    See this page about xPDF.
    I use this function to transform PDF to text which give good results...
    Code:
    function pdfTxt($pathFile){
     	$o=shell_exec('pdftotext -enc UTF-8 '.$pathFile.' pdf.txt');
    	$c=file_get_contents('pdf.txt');
    	return $c;
    }
    The package xpdfbin-win-303.zip contains to pdfimages, pdffonts, pdfimages...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles