I need to create a Microsoft Word Document using PHP. I am thinking of creating a template document with various bookmarks and fill the data through PHP.
I am looking at any PHP library which can be used to create a Microsoft Document which supports create and editing bookmarks. Can you please suggest any lightweight PHP library for creating word documents ?
Thanks
Please try PHPWord library(http://phpword.codeplex.com/)
A powerful PHP library for creating Word files. :)
PhpDocx has this functionality: http://www.phpdocx.com/api-documentation/word-content/add-bookmark-Word-document-with-PHP
Usage example:
$docx = new CreateDocx();
$docx->addBookmark(array('type' => 'start', 'name' => 'bookmark_name'));
$docx->addText('Text that has been bookmarked.');
$docx->addBookmark(array('type' => 'end', 'name' => 'bookmark_name'));
However, PhpDocx is quite expensive.