设为首页收藏本站

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 771|回复: 4

phpdocx introduction

[复制链接]
发表于 2014-6-7 22:03:48 | 显示全部楼层 |阅读模式
                    phpdocx is very easy to install. Usually it is just enough to unzip the package somewhere in your server and it is (almost) ready to go.
                    Obviously, as you could have guessed by its name, phpdocx requires PHP 5 to be installed in your server. Moreover the following PHP modules should be activated:
                                            
  • ZipArchive
  • XSLT
  • Tidy (not strictly necessary but highly recommended)
                    
                    For your convenience we have included a PHP script in the package (directly located in the app root folder), check.php, that will check if any of the requirements are missing.
                    Of course, DO NOT FORGET to include the license key:
                                            
  • Download the license key from the "MYPHPDOCX section" of this website.
  • Copy it (plain, with no other word or character) in the code option of the config/phpdocxconfig.ini file.
  • Include the subdomain.domain (PRO version), the domain (CORPORATE version) or the IP (ENTERPRISE version) in the value option of the config/phpdocxconfig.ini file.
                    
                                                                                                   

    WARNINGS:
  • The folders where your scripts are running and/or the folder where you want to store the resulting Word documents have to have writing permissions rights.
  • If possible, use always UTF-8 compatible editors to code your scripts or modify any script in the phpdocx library. The final Word documents have to be UTF-8 encoded and nonUTF-8 characters may break the final document.
  • All the content in a .docx file is stored in XML files so you should escape certain protected characters like the ampersand symbol (write & instead of &).
  • Make sure that your web server has activated the .docx MIME type in case you want your users to download directly the resulting Word documents to the browser (if not IE will believe that your .docx is a .zip file).
                           
                        
                    
                                                There is no a priori restrictions about the OS and server software as long as it may run PHP 5. That includes, of course, basically all LINUX and UNIX distributions as well as Windows and Mac OS. You may use Apache as web server or lighttp, nginX, IIS, etcetera.
                    phpdocx may use external data for your reports and documents coming from virtually any data source and it is the responsability of the user to prepare it so phpdocx can represent it adequately. phpdocx DOES NOT require MySQL or any other specific Database software for its deployment and correct functioning.
                    You DO NOT need any copy of Microsoft Office Word to generate your Word documents.
                    phpdocx PRO does also not need any kind of outbound connection to work so it does not depend directly of a working Internet connection or any kind of additional third party software.
               
phpdocx v4.0 Tutorial


 楼主| 发表于 2014-6-7 22:06:46 | 显示全部楼层

Brief introduction to LiveDocx in PHP

Zend_Service_LiveDocx allows developers to generate documents by combining structured data from PHP with a template, created in a word processor. The resulting document can be saved as a PDF, DOCX, DOC or RTF file. The concept is the same as with mail-merge.
  • Load template in Zend_Service_LiveDocx.
  • Assign data to text fields in template.
  • Generate document.
  • Save as a PDF, DOCX, DOC or RTF file.
Consider this example: A template is populated with the following data to generate this document.

  1. $mailMerge = new Zend_Service_LiveDocx_MailMerge();

  2. $mailMerge->setUsername('myUsername')
  3.           ->setPassword('myPassword');

  4. $mailMerge->setLocalTemplate('template.docx');

  5. $mailMerge->assign('software', 'Magic Graphical Compression Suite v1.9')
  6.           ->assign('licensee', 'Henry Döner-Meyer')
  7.           ->assign('company',  'Co-Operation')
  8.           ->assign('date',     'January 11, 2010')
  9.           ->assign('time',     'January 11, 2010')
  10.           ->assign('city',     'Berlin')
  11.           ->assign('country',  'Germany');

  12. $mailMerge->createDocument();

  13. $document = $mailMerge->retrieveDocument('pdf');

  14. file_put_contents('document.pdf', $document);
复制代码




 楼主| 发表于 2014-6-8 11:18:12 | 显示全部楼层

wvWare,AbiWord: Way to process doc or docx online

wv is a library which allows access to Microsoft Word files. It can load and parse Word 2000,97, 95 and 6 file formats. (These are the file formats known internally as Word 9, 8, 7 and 6.)There is some support for reading earlier formats as well: Word 2 docs are converted to plaintext.

AbiWord is a more actively maintained product with a much larger and more robust feature set, including supporting many more output file formats than wvWare does. Its output has a much higher degree of fidelity (both visually and semantically) to the original Microsoft Word document.

wvWare is a"power-user" application with lots of command-line options, doo-dads, bells, and whistles. Lessinteresting, but more convenient, are the helper scripts that use wvWare. These are:
  • wvHtml:    convert your Word document into HTML4.0. Use "AbiWord --to=html" instead.
  • wvLatex:    convert your Word document into visually (pretty) correct LaTeX. Use "AbiWord --to=tex" instead.
  • wvCleanLatex:    convert into 'cleaner' LaTeX containing less visual mark-up, more suitable for further use and    LyX import. Work in progress. Use "AbiWord --to=tex" instead.
  • wvSummary    prints out metadata from your Microsoft Office documents. Not deprecated; actually useful.
  • wvDVI:    converts word to DVI. Requires 'latex'. "AbiWord --to=tex" will get you halfway there.
  • wvPS:    converts word to PostScript. Requires 'dvips'. Use "AbiWord --print=file.ps" instead.
  • wvPDF:    converts word to Adobe PDF. Use "AbiWord --to=pdf" or "AbiWord --print=file.ps && ps2pdf file.ps" instead.
  • wvText:    converts word to plain text. Textually correct output requires 'lynx.' For poor output,    this doesn't require anything special. Use "AbiWord --to=txt" instead.
  • wvAbw:    converts word to Abiword format. Use "AbiWord --to=abw" instead.
  • wvWml:    converts word to WML for viewing on portable devices like WebPhones and Palm Pilots. Use "AbiWord --to=wml" instead.
  • wvRtf:    a basic version exists to convert DOC to RTF. Use "AbiWord --to=rtf" instead.
  • wvMime:    can be plugged as a MIME helper application into your browser/mail client; presents the    document on-screen inside GhostView, while all intermediate files generated go into the /tmp    directory.




 楼主| 发表于 2014-6-8 11:23:16 | 显示全部楼层

catdoc & xls2csv

catdoc is program which reads one ormore Microsoft word files and outputs text, contained insinde themto standard output. Therefore it does same work for .doc files, asunix cat command for plain ASCII files.

It is now accompanied by xls2csv - program whichconverts Excel spreadsheet into comma-separated value file, andcatppt - utility to extract textual information fromPowerpoint files

More details please refer to the Source link



 楼主| 发表于 2014-6-8 11:30:43 | 显示全部楼层

PHP DocWriter

PHP DocWriter is a set of PHP classes that generates simple StarOffice/OpenOffice.org Writer documents.

It builds the document following the file format specification so you don't need to have OpenOffice.org installed, though if installed this class can generate other document formats like MS Word, PDF, RTF, StarWriter, LaTeX, XHTML, HTML, etc. Currently supports pages, paragraphs, text styles, images, tables, text boxes, headers, footers and drawings among other things. - See more at: http://www.phpkode.com/scripts/i ... thash.xsppjuNX.dpuf


您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )  

GMT-8, 2025-12-12 20:57 , Processed in 0.019901 second(s), 16 queries .

Supported by Best Deal Online X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表