...

View Full Version : How to Convert PDF to HTML using php?



dealmaker
05-08-2008, 03:27 AM
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.

I <3 Lamp
05-08-2008, 10:05 PM
Try:



<?php

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

echo "Thank you for creating HTML files!";

?>

aedrin
05-08-2008, 10:19 PM
...

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.

dealmaker
05-09-2008, 12:31 AM
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.


...

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.

PappaJohn
05-09-2008, 01:03 AM
I haven't tried it, but ... http://sourceforge.net/projects/html2fpdf

dealmaker
05-09-2008, 02:07 AM
I want pdf to html, NOT html to pdf.


I haven't tried it, but ... http://sourceforge.net/projects/html2fpdf

PappaJohn
05-09-2008, 02:33 AM
I guess I misread it then, eh?

aedrin
05-09-2008, 04:26 PM
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).

dealmaker
05-09-2008, 04:53 PM
I don't think that I have shell access in my shared hosting.


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).

aedrin
05-09-2008, 07:07 PM
Then you either find a web hosted service that you can send a request to or you are screwed. ;)

beilong
10-01-2008, 06:41 AM
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

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.

khubab1
08-28-2009, 11:21 PM
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

inman2787
03-23-2011, 12:40 PM
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 (http://www.****************/wiki/How_to_convert_PDF_to_HTML).
Hope that helps !

Know more the column of PDF Converter (http://www.****************/wiki/PDF_Converter).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum