cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: XML printing in Cocoon
Date Mon, 13 Mar 2000 04:50:29 GMT
On Fri, 10 Mar 2000, Corda, Ugo wrote:

> I have been thinking about a scenario where a browser asks Cocoon to publish
> an XML document on a specified printer. In other words, instead of getting
> the document returned to my browser, I want the document to be directly
> printed on a printer I specify. The stylesheet to associate with the XML
> document should be chosen by Cocoon based on the specified printer, instead
> of on the browser that issues the request. 
> 
> Let me give an example of what I am talking about. I ask Cocoon (using some
> appropriate HTTP request) to print the document mydoc.xml on the network
> printer at http://myserver/myprinter. Cocoon selects an appropriate FO-based
> stylesheet using a predefined association between the type of printing
> device specified and a list of stylesheets. Cocoon also selects the
> appropriate formatter (e.g. a PDF formatter or a PS formatter) based on the
> type of printing device specified. After these transformations take place,
> Cocoon sends the output file (PDF or PS) to the specified printer.
> 
> I would like to understand whether:
> 
> 1)	this can already be done in Cocoon, or is planned to be supported in
> Cocoon 2
> 2)	this could be done via a fairly simple modification of the Cocoon
> engine
> 3)	this would require a substantial rework of the Cocoon engine.

Probably number (2), thought it might be best to hold on on trying to
write this until cocoon2 is released as a real alpha since it will be
easier to configure this via XML-based configuration and sitemap.

aAll you should have to do, however, is write a Formatter (cocoon-1.x) or
Serializer (cocoon-2.x) which serializes the PDF using the standard FO
library but sends it to a printer object rather than back to the user
(you'll have to send something back to the user, of course). choosing the
printer at request-time in a secure manner is the only tricky stumbling
block I foresee. well, that and finding or writing a print queue library,
but presumably you already have some code to accomplish that task.

Sounds like a great addition to cocoon, especially for point of sale,
ecommerce, etc. applications.

- donald


Mime
View raw message