Generating .DOC Reports from a Linux Server and PHP System

Click For Summary
SUMMARY

Generating .DOC reports from a Linux server using a PHP system is challenging due to the closed nature of the .DOC format. Alternatives such as PDF generation can be accomplished using tools like PDFlib (version 6.0.1) or FPDF. RTF files can be created and renamed with a .DOC extension to be compatible with Microsoft Word. For more complex needs, utilizing Java libraries or Python scripts may be necessary, but these often require a Windows environment.

PREREQUISITES
  • Familiarity with PHP programming
  • Understanding of PDF generation tools like PDFlib and FPDF
  • Knowledge of RTF file format
  • Basic understanding of Java libraries for document processing
NEXT STEPS
  • Research how to implement PDF generation using PDFlib in PHP
  • Explore the creation and manipulation of RTF files in PHP
  • Investigate Java libraries for reading and writing Word documents
  • Learn about using Python with COM for document generation on Windows
USEFUL FOR

Web developers, software engineers, and system administrators looking to generate document reports from a Linux server environment using PHP.

Omid
Messages
181
Reaction score
0
We have a linux server and some win clients.
Our webbased accounting system is soppused to make reports in different formats like .DOC.
The system is written in PHP. How can we generate that format?
 
Computer science news on Phys.org
I did a google search to see if there was a program in php that could do the conversion but there are none. Doc is a closed format and unless your willing to put in time to reverse engineer the format then no. PDFs on the other hand can be generated on the fly as well as the Oasis (xml based) format used in Openoffice.

http://www.fpdf.org/

If your not going to sell this software your better off using: pdflib

http://www.pdflib.com/

http://www.pdflib.com/products/pdflib/download/601/PDFlib-6.0.1p1-Linux.tar.gz
 
Last edited by a moderator:
(I'm not familiar enough with PHP to see if these are directly applicable to you.)

Is .RTF acceptable?
http://php9.bloghi.com/2002/07/23/using-php-for-rich-text-format-rtf-external.html
http://www.phpbuilder.com/annotate/message.php3?id=1011981

http://www.wlug.org.nz/RTF says "You can also give an RTF file a ".DOC" extension and then MicrosoftWindows users will be able to transparently open it in MicrosoftWord, blissfully unaware what format the file is actually in."

Here's a start:
http://jakarta.apache.org/poi/hwpf/index.html

The following need a Windows machine. Maybe you could set up a local Windows machine (real or virtual?) that could serve your linux servers with the required files.

http://schmidt.devlib.org/java/libraries-word.html points to:
http://www.java400.de/Javactpe.htm
"Java Bean Word Processing. Freeware. Read and write Word 97 and 2000 files. Needs a driver that runs only under Windows."

Here's something in Python
http://www.win32com.de/index.php?option=com_content&task=view&id=173&Itemid=130
more from
http://www.win32com.de/index.php?option=com_content&task=category§ionid=7&id=86&Itemid=130
 
Last edited by a moderator:

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
Replies
4
Views
3K
Replies
7
Views
3K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 12 ·
Replies
12
Views
5K