0

I am wondering, is it possible to do the auto-generation of the letter head for a company, given that we have put a template in it?

Lets say, invoice, delivery order, payment voucher, etc all have a different kind of template/format so we need different auto-generated content.

the contents and such will have to be typed manually though, but with the reference number and date will be auto generated based on the system time and date. and the header and footer is already there.

and is it possible to have the templates to have a text editor interfaces like in forums and other online editor so we can make letters bold, add tables and such. I am currently considering TinyMCE but am not sure how to integrate them together with the templates as I am having problems with php.

Thanks.

Luqman
  • 249
  • 4
  • 25
  • It might be. I'd start with doing some web-searching on libraries to read and write Word documents - if you've done that already, add the results of that research to your question. MS have traditionally been secretive of their wordprocessor format (it's why I try to avoid Office, tbh) so if you get no joy there, maybe you could do this in Rich Text Format? There's bound to be a PHP reader and writer for that. Again, web searching required. – halfer Apr 09 '12 at 06:38
  • Once you know what format you're using, you could put in tokens into the document (using Word) - so a reference number would look like `_REFERENCENUMBER_.` You can replace this programmatically when the document needs to be generated. – halfer Apr 09 '12 at 06:40
  • 1
    http://phpword.codeplex.com/ is a nice Word Reader/Writer. The site also has excel/powerpoint reader/writer libraries. To generate an invoice, voucher etc, you can create your own template. If you need to generate barcodes in your documents on the fly, you can use http://www.barcodesinc.com/generator/index.php. Example: http://www.barcodesinc.com/generator/image.php?code=YOUR_TEXT_HERE&style=197&type=C128B&width=200&height=75&xres=1&font=3 – web-nomad Apr 09 '12 at 06:45

1 Answers1

2

The only tools I've heard of that can do this are: http://www.phpdocx.com/ and http://www.phplivedocx.org/

You could also consider creating PDF documents and then you can use FPDF.

Update: I didn't realise that PHPWord supported templates now. As that's the case, I would start there.

Rob Allen
  • 12,643
  • 1
  • 40
  • 49