convert xls to html with php [duplicate] - php

This question already has answers here:
Reading an Excel file in PHP [closed]
(8 answers)
Closed 6 years ago.
I am wondering if I can get some advice on folks that might have come across this before.
Basically I have a folder with files a user can add / remove which has an iframe beside it so they can view their PDF's etc.
I cannot get excel (probably ppt either) to open up in chrome or a browser.
I know I can go through google docs, or send files and get it back different format through their api but for security it is not a solution I want to work with.
example I saw in excel:
If I have a fairly loaded excel file, graph, formulas etc., in that file I 'Save As' and convert to htm I can publish option which provides a beautiful htm page with all relative pics, links in a folder. If I can get php to do something similar this would really make my day.
I played with PHPExcel but it usually spits out a mess, sometimes just crashes because of formulas. Unless I just haven't sent the time with PHPExcel to figure this out I don't know what else to do.

You already know the best way use read excel file to php using any library then print the data.
if PHPExcel not working for you please have a look at following
"Reading an Excel file in PHP"
ps. if you are facing problem with PHPExcel kindly post you code in new question, definitely this great developer community will help you resolve that.

Related

Conversion of a doc file to PDF using php [duplicate]

This question already has answers here:
Convert Word doc, docx and Excel xls, xlsx to PDF with PHP
(12 answers)
Closed 4 years ago.
I want to know how to convert document file to pdf using php or codeigniter.
If anyone have any idea about the same please let me know.
To complete this, I would recommend two libraries. The first (I have not used), as Word documents are not plaintext, you will need to be able to read the Word doc. For this, try PHPWord. This appears to have been used in other projects for the purpose of reading Word docs (and creating them).
Secondly, converting to PDF use FPDF, this library I have a lot of experience. It's been around a long time so there is some great examples and documentation. It doesn't take long to figure out but does require a bit of playing around to get the PDF doc looking exactly as you like. If you need any additional info using this library, give me a shout. But both of these should help you. FPDF can also be very easily converted to a Codeigniter library. I used it in a CiBonfire application before.

Extracting text from PDFs in PHP

I'm creating a php based web application which allows the user to upload a PDF file. This file will then be read and checked for certain data (text).
The problem is I can't figure out how to even open a PDF file in PHP. There are some PDF libraries mainly for creating PDF's, but they don't seem to be very good at reading them.
An alternative solution would be to use an already available solution in Python or something else (as described in other threads on this site) but I'd really like to stay as much as possible in PHP as I intend to later export the data to mysql, etc.
Any input on how to read a PDF and extract data from it would be much appreciated.
I personally haven't tried this out, but it looks like this one works: http://www.pdfparser.org/documentation
It's just a matter of downloading and telling your code to include it, just like the documentation shows.
Or you could try the class.pdf2text.php found in http://www.phpclasses.org/browse/file/31030.html

How to make pdf of html page of invoice? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Create a PDF file with PHP
I have created invoice generator using javascript. well I am able to work on it. Now what I have to do is I have to generate the data in the pdf which are available in the invoice. I tried some but none work out. So If there is anyone who can help me out?
Thanx in advance
I have used "webkit html to pdf" (wkhtmltopdf) several times.
It worked well for me, although working with page breaks is a bit of an hassle.
PDF cannot be generated at the client side (I mean with Javascript). You will need to process the invoice data at the server side using a PDF library and write to a URL location, so that it can be downloaded or opened in a browser.
TCPDF is a good tool to generate PDF with PHP. See this link.
Also see this question.

how would one go about converting HTML table to Spreadsheet with JavaScript and/or PHP? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I export tables to excel from a webpage
EDIT: Just to clarify, it does not HAVE to be an Excel file, but it has to be a spreadsheet file which is able to be opened/edited in Excel.. So whatever would accomplish this most easily is the answer I seek :)
I need to convert an HTML table to some sort of downloadable spreadsheet (preferably for Office Excel). I can do this in jQuery, but would prefer to do it in plain JavaScript. I've searched around and have found a lot of info about doing the reverse (spreadsheet->html), but I need to create a downloadble spreadsheet file of a dynamically built table. Any points for how I could accomplish this would be much appreciated! :)
Don't do this in JavaScript. You need to do this in a server-side scripting language like PHP.
The easiest way to prepare data for importing into a spreadsheet is going to be creating a CSV file. Here's an example CSV file which will open fine in Excel:
column_a,column_b
1,2
5,7
8.988,abcdef
CSV files are just plain text, with the fields separated by commas, so they are easy to create. If the data in your fields needs to contain commas, double quote marks, newlines, or a few other special cases, then things get more tricky.
If you really want to create an Excel-format spreadsheet, this is pretty difficult and you're going to want the help of a library. Here's how I would find a PHP Excel library: http://google.com/search?q=php+create+excel+spreadsheet
You can't do this with JavaScript because it cannot create a downloadable file.
You must do this on the server. Any HTML page that is a table will automatically be converted BY EXCEL ITSELF if you send out the correct MIME header before streaming out the HTML file.
You can't do it all in Javascript. You can write a jQuery function to convert a table to something like a CSV format, but you won't be able to tell the browser to let the user download it. You'll have to POST it to a server which can then serve back the file.
See this question for details.
I can be mistaken, but it may be possible using data: URI scheme
<a href="data:text/csv;charset=utf8;base64,...encoded_data...">
download as Excel
</a>
It is not cross-browser, but can help.

Lightweight Excel(xls/xlsx) php library needed [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Alternative for PHP_excel
A friend would like to use a Php Excel library to read/write files on formats xls and xlsx, he knows about the one called "PhpExcel" but apparently is way too big of a library for him.
I would like you to suggest if there is any other phplib you could recommend him.
Update
Please people vote this question up if you think this post is useful even when some have considered it not good enough to give it negative points (very strange since it has a lot of views and seems it has actually helped to some users). Thank you very much.
Reading only: http://sourceforge.net/projects/phpexcelreader/ 21.5kb
Create your own very simply: http://www.ibm.com/developerworks/opensource/library/os-phpexcel/
You won't find a lightweight library that can both read and write both xls and xlsx files other than PHPExcel. However, if you want a list of the available options for working with Excel files in PHP, you can find it here.
OpenTBS can generate XLSX files using the technic of templates.
It can also read any sub XML file in the XLSX.
OpenTBS can do the same with any Ms Office (docx, xlsx, pptx) and OpenOffice documents.

Categories