FPDF to CSV or xls export - php

I generally use FPDF to generate to pdf. But I want to generate a xls or csv file. I read somewhere that this can be done using FPDF. I tried changing the extension but it was not working . Is there any way by which I can use FPDF for xls/csv generation or any php tools or plugin which converts fpdf generated pdf file to xls.
Thanks in advance.

I genearally recommend that you use Exel for xls/csv not sure if it can open pdf files, prefarbly I would download a pear file and start learning how to implement it and use its send functions and formats style. Below is a helpful like were you can learn and download the pear file http://pear.php.net/package/File

Related

Php split pdf file

How can I split pdf file? I tried use FPDI, but pdf file must have version 1.4. Are there any other FREE solutions in php for split pdf by pages and save each page to seperate file? Really dont see any other free solution.Thanks!
For split pdf by pages you can use http://pdfparser.org/ and for save each page to seperate file https://mpdf.github.io/
Try PDFtk Server. It is a command-line tool which you can execute from a PHP script. It allows many different kinds of PDF manipulation, like splitting a document into smaller pieces. PDFtk is free.
Example command-line use:
pdftk document.pdf burst

PHP Library to parse Excel files

I need to find a PHP library that reads/previews Excel files uploaded by a user.
Does anyone know of any PHP Libraries used to parse .xsls files?
Have you tried phpexcel?
Great documentation and open source library.

Convert to PDF using PHP

I need a simple solution for an issues I'm having. I have an application that allows to upload a document (mostly will be excel files but can be .docx/.doc)
I also am using jsignature to "esign" the document and save that to an image, and all that is working fine.
What I need is a way to convert the uploaded document to PDF, and then merge that with the newly created signature image. Thoughts?
Fpdf and Fpdi are good PHP plugins to deal with reading/writing PDFs.
I've only ever done the uploading and signing of PDFs but there is probably some way to utilize one of those tools to work with doc/docx files.
http://www.setasign.de/products/pdf-php-solutions/fpdi/
http://www.fpdf.org

Is it possible to output formats other than .docx and .odt with TinyButStrong and OpenTBS plugin

I have a module which merges a document from database records and .docx or .odt document model.
I have to output .docx, .odt or .pdf. For outputting to Microsoft and Open formats, there is no problem, all works properly.
But what I want to know is, can I output to a format (like XML or HTML) which I can use to subsequently build a PDF document?
If I can't, are there any libraries which provide a merge document capability like:
DOCX (or ODT) + database record => PDF
And I don't want to use phplivedocx.
I successfully put a portable version of libreoffice on my host's webserver, which I call with PHP to do a commandline conversion from .docx, etc. to pdf. on the fly. I do not have admin rights on my host's webserver. Here is my blog post of what I did:
http://geekswithblogs.net/robertphyatt/archive/2011/11/19/converting-.docx-to-pdf-or-.doc-to-pdf-or-.doc.aspx
Yay! Convert directly from .docx or .odt to .pdf using PHP with LibreOffice (OpenOffice's successor)!
I don't know any PHP library that does DOCX => PDF. In fact, the DOCX conversion to something else in PHP is an opened problem today. This is independent from how you made the DOCX.
But as you said, they are PHP libraries for HTML => PDF.
Html2Pdf is a well reputed PHP library that does HTML => PDF.
There is also DomPdf.
So if you can found a PHP library for DOCX => HTML, then it would work.
Of course it has some limitations because even if both PDF and DOCX are opened format, they have very specific features, they need huge rendering process, and the editors keep some good tips for them.
Converting DOCX to HTML is theoretically possible. There is a Windows software that does it by EpingSoft. If you need to do it in PHP, some web articles tell you how to make it, but since I cannot found any PHP code doing this, I guess it is more theoretical than practical.
http://www.quepublishing.com/articles/article.aspx?p=691502
How complicated that process would be
depends on how much of Word's native
formatting you need to preserve during
the conversion.
If you want to try this way, it's good to know that OpenTBS enables you to read the XML before and after the merge. It is based on a PHP class names TbsZip that can read any XML file in the DOCX since it's in fact a zip archive.
There is also posible to use PDF files directly in TBS after decompressing:
qpdf --qdf --object-streams=disable in.pdf out.pdf

Generating an Excel file on the fly in a Web site

Are there any good PHP libraries for exporting data to Excel files (not CSV files)?
(An alternative would be creating an ASP.NET Web service that handles Excel file generation, but I would rather not send complex objects over a network in XML format, unless it were strictly necessary.)
For PHP try PHPEXCEL
Excel will accept a standard HTML table masquerading as a .xls file:
<table><tr><td></td></tr></table>
Just set the file extension and mime type on download to the client.
While not a "direct export" library, the PHPExcel library looks to be a nice library for generating Excel files using PHP.
If you do go the .Net route, I highly recommend the NPOI library.

Categories