 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
php|architect: PHPDOCX generating Word documents from PHP
by Chris Cornutt July 22, 2010 @ 10:23:18
On the php|architect blog today there's a new post about a tool that helps you create Word documents directly from your PHP application - PHPDOCX.
PHPDOCX is a PHP library that allows its client code to generate Microsoft Word documents in the .docx format from PHP scripts. PHP is increasingly being used for disparate goals and has to deal with data that comes from strange sources and has to be produced in stranger formats. [...] Starting with the 1.5 version, which has been released on July 12th, PHPDOCX is now compatible with PHP 5.3. The adoption of PHP 5.3 from operating systems is growing and it will at last replace the previous versions of PHP also in the servers of hosting providers.
He mentions some of the features it includes (like the library and automatic insertion of things like headers and footers) as well as two requirements for the tool to work - the zip and xsl extensions.
voice your opinion now!
generate word document phpdocx
Thomas Weinert's Blog: Highlight Words In HTML
by Chris Cornutt May 10, 2010 @ 10:34:24
In the latest post to his blog Thomas Weinert takes a look at a simple challenge someone asked him about - highlighting a section of HTML based on a search string - and his solution.
The challenge is to wrap given words in text content with a span and add a class to the span depending on the word. Do not touch elements, attributes, comments or processing instructions. Do it case insensitive and do it the safe way.
He uses the FluentDOM tool to get the job done. It allows him to create an XPath expression to single out the item to be highlighted (in this case a single or series of words) and wrap them in a matching span tag with the correct styles attached.
voice your opinion now!
fluentdom tutorial highlight word
Sameer Borate's Blog: Porter Stemming algorithm for search
by Chris Cornutt April 29, 2009 @ 07:57:06
In a recent post to his blog Sameer looks at implementing a Stemming algorithm to search an array of words. It uses this library (as written by Richard Heyes).
A stemming algorithm lets you reduce each English input word to its basic root or stem (e.g. 'walking' to 'walk') so that variations on a word ('walks', 'walked', 'walking') are considered equivalent when searching. This stems can than be used in a search query rather than the original words, which generally (but not always) results in more relevant search results.
His code example uses the library to search for two different types of strings - a single word and a phrase (with stop words removed). The Stem() method is called on the word and the results are looped through to remove all matching the values in the stop words array.
voice your opinion now!
stop word search stem root query library richardheyes
Developer Tutorials Blog: Extracting text from Word Documents via PHP and COM
by Chris Cornutt March 26, 2008 @ 12:02:06
In a recent blog post Akash Mehta showed how to reach into a Microsoft document (a Word file) and pull out the content inside via a PHP script.
Communicating via COM in PHP is easy as ever; especially for people coming from a VB background where executing complex tasks in MS-applications is a piece of cake, you will feel right at home in PHP. In fact, VB COM calls can be converted to PHP COM calls in just a few simple search and replaces.
He shows how to use the COM extension in a (Windows) PHP installation to access the text inside the document and manipulate the contents however you'd like (even writing them back out to another Word file).
voice your opinion now!
com document word extract content manipulate
Maarten Balliauw's Blog: Indexing Word 2007 (docx) files with Zend_Search_Lucene
by Chris Cornutt February 05, 2008 @ 10:24:00
Maarten Balliauw has written about a method he's developed to convince the Zend_Search_Lucene component of the Zend Framework to index the contents of a Word 2007 document.
Lucene basically is an indexing and search technology, providing an easy-to-use API to create any type of application that has to do with indexing and searching. If you provide the right methods to extract data from any type of document, Lucene can index it. [...] Sounds like a challenge!
He works through the three step process to getting the searching working, the key being his readDocXContents() function that goes through the Word file and returns all the text it can find. This is passed back out so the Zend Framework component can pull the data in and search (their example is on the string "Code Access Security").
You can grab the the full code here.
voice your opinion now!
zendframework zendsearchlucene word document download
Maarten Balliauw's Blog: OpenXML in Healthcare in PHP
by Chris Cornutt October 29, 2007 @ 15:29:36
Maarten Balliauw points out a new blog post he's made today showing how to take the methods described in this article on the MSDN and convert it to a more PHP way of thinking, parsing the OpenXML info of the patients.
The scenario for the article is quite simple: Contoso provides a central medical records database. Whenever a physician has to register a new patient, he downloads a Word 2007 document from the Contoso server, fills it out, and uploads it back. Contoso then strips out the necessary data and saves it back in their systems.
This Word 2007 document is crafted around embedded custom XML data, which is displayed and edited using Word 2007. In short: to do the above exercise, you just need to strip out the custom XML and you're done.
Don't worry, Maarten includes his code and a demo to show the functionality in action. Check out the original article for more information as well.
voice your opinion now!
openxml healthcare custom xml word microsoft openxml healthcare custom xml word microsoft
|
Community Events
Don't see your event here? Let us know!
|