Auto-generate multiple PHP files from Template and excel files - php

Auto-generate multiple PHP files from Template and excel files
Am looking for suggestions to efficiently auto-generate multiple PHP (and HTML) files from a template doc pulling fields from an excel file
What I want to do is:
1. Populate the fields in the template file from an excel file, each excel row will generate a new file
2. Save it as a PHP file
3. Name each generated file based on specified field in the correspondig row
I am intentionally trying to multiple and separate static HTML and PHP pages. Have been using mail merge with word and excel, but, takes to long to resave word file as php and rename, etc. Not sure how to programmaticaly do this, and my skillset is limited.
Open to different approaches to handle this, appreciate any help and thoughts.
Thanks!

Related

Search inside 70gb of PDF files

I have 70gb PDF files, and I want to search inside them with PHP and some Ajax.
The code must search on all PDF files and extract the data out into table,
For example: 1547AD
When I hit enter the code will search in all PDF files and extract all PDF files that contain "1547AD" inside them.
My problem is: of course putting these data inside MySQL will be better for the server and stronger but imagine extracting all tables in 70GB of PDF files! and these pdf files updated daily, also there is alot of traffic on this page.
My question is: Is it the right way to build this in PHP or I should use another language and/or another method for this kind of heavy data?

Insert Files as Objects in Exported Word Document with OpenTBS

I am using OpenTBS to load a word template and complete all the required fields with the information I have.
The problem is that I have some related documents (other words, excels, pdfs) for the exported word, that I have to insert as objects in a specific area.
I managed to insert images using MergeBlock and all the other elements I needed.
I need the uploaded files to be inserted in the exported word like an object (not link), just to click the icon and open the related document. I can't find a solution on how to accomplish this and I have no idea how to do this.
Has anyone done this? Is there a solution for my problem? (it doesn't have to be an OpenTBS solution)
A DOCX document stores the inserted files into a binary sub-file in the DOCX archive (a DOCX is a zip archives with special sub-files). The binary sub-file is named like word/embeddings/oleObject1.bin and is made with a binary heady followed by the binary content of the inserted file.
Such binary sub-file is linked to the body part of the DOCX with an XML element <o:OLEObject> using the "ri:id" attribute and a sub-file named word/_rels/document.xml.rel.
Because of the binary header of the binary sub-file, is is not easy to change the binary content of a existing inserted file. Is is not easy also to create a new inserted file.
OpenTBS gives no special help for this problem. Since you know how to manage the binary header, you can use OpenTBS features to chnage the content of any sub-file, therefore you can edit the existing inserted file.

How to copy data of one excel sheet in another using batch file

I have bunch of excel files with same name in two different folders, lets say folder A & B.
Now i need to copy data of files in folder A to respective same name files in folder B but in different sheet and then rename the new sheet with current month and year.
I need to achieve this in batch file or php script. Please can any one help.
Thanks
Its very unlikely you will be able to do this easily with a batch script or in php because .xls files are compressed.
A much easier way to achieve what you need would be to use a VBA macro in one of your excel files as VBA supports all the operations you would need to achieve such a process.

Auto Populated PDF Generation based on CSV Configuration File

We want to generate & validate PDF files with configuration mention into CSV or XML or TXT files via from database records, How can we do it?
I come to know about PDFTK library, but not sure, whether it is suitable for generating auto populated PDF files.
Also i wonder, how can we validate PDF files, means to check, if any fields has been left blank or something?

Create a multi-tabs Excel file

My PHP script have to create a multi-tabs Excel file with a report in each tab, but those reports already exists as HTML pages, so I don't want to duplicate code and work.
I know I can rename a HTML file to .xls, and Excel/OpenOffice Calc will open it as a spreadsheet, but I don't know how to have severals tabs.
I do not even know if it is possible.
I already know Biffwriter and others PHP libs to create Excel file, but I am looking for a smarter solution.
Thanks,
Cédric
Pear Excel Spreadsheet Writer has a function to create new Worksheets if thats what you are looking for.
If you don't mind serving excel 2007 files, you can do this:
create an excel 2007 file
create all the tabs you need
save the file
rename the file as .zip
extract the contents of the zip file
Now you can use the file structure there to populate the file corresponding to each tab with the report you need. You may want to use them as templates, keep the same code and render different files depending on whether you generate the html report of the excel report.
In the end, zip up the entire directory structure and serve it with an xlsx extension.
Please check the URLS of
a library
and
turorials
from IBM and
from 999Tutorials

Categories