[Phpwm] instantiate word for windows

Phil Beynon phil at infolinkelectronics.co.uk
Thu Aug 24 14:57:54 BST 2006


> Perhaps I can prompt a wider debate.
>
> It seems to me that the area in which php is weakest is printed output.
> I take the point that it is a server side language, so we don't have
> direct control over what happens at the browser.

Its not a weakness at all, it just doen't need to do it. You can construct
documents in the form of pdf files, .rtf, .txt as required, the idea of
constructing non-ubiquitous formats like Word (which version?) is wrong
thinking and won't be appreciated by the first MAC user who tries t0 use
your pages.
Output control of documents from webpages can be achieved in one way by
simply having seperate css file for printing, pages can then be tweaked a
little to assume that people are in fact printing out on an A4 printer with
fairly standard margins set.

> But I, and I am sure many of you, need solutions in a commercial
> environment - and that means that almost every action results in the
> need for a printed page - be it an invoice document, delivery note,
> monthly sales report etc. etc. The 'paperless office' doesn't work here.
> You _have_ to issue an invoice document - and for business efficiency it
> needs to be printed there and then on a printer under the sales counter
> that the member of staff is standing at! It seems to me that outputting
> a web page to the printer is at best a clumsy solution - reference the
> question I raised a couple of months ago about  output overrunning the
> bottom of a page where there are more lines on screen than a page can
> handle.

Not if its designed in depth. If there are a limited number of users that
will ever need to print the document you could always embed invisible HPGL /
Prescribe escape string commands within the page depending on the printer
they have.
Just relying on the browser print routince for an HTML webpage isnt really
adequate.

> To generate nicely formatted complex monthly summaries I turn to Access
> to read our Postgres db and use its reporting facilities with all the
> font control spacing, formatting etc it offers - surely I don't have to
> resort to that as a solution!

Cron job running a php script to suck the data from a mysql database,
process it and output it as a pdf emailed to the recipients?

> Picking up Phil's specific question - we are running Linux php and no
> the output does not have to be Word - Word's mail merge provided a tool
> to do a job. I need a pile of letters with variable data and image
> objects such as a signature on there.

Best option when everything you have runs in a LAMP environment is just
forget MS Office even exists. Its just too much of a headache to write
anything that accurately intergrates with it. As an example they still
haven't fixed the bloody bug in the way Excel generates a .csv and thats
been around for years now!

> I will have a look at the RTF options but I would be very interested in
> comments on this broader topic.
>
> alan dunn
>

Phil




More information about the Phpwm mailing list