cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corda, Ugo" <Ugo.Co...@usa.xerox.com>
Subject RE: XML printing in Cocoon
Date Tue, 14 Mar 2000 18:01:43 GMT
Instead of doing PDF serialization, I am thinking of going through something
like the FOP AWT/Java2D viewer and of using Java printing. It seems to me
that this approach could take better advantage of the underlying platform
(e.g. in Windows Java printing maps to Microsoft's native GDI) and of any
existing printer driver available for a particular printer. That should also
take care of the print queue issue you mention.

I am more concerned about security, since Cocoon would have to act as a
proxy for the client when submitting the print request to the printer, and I
am not sure whether that would be a problem in the current Cocoon
implementation. I imagine the security issue could be shifted to a
client/printer interaction if the client contacts the printer first, and the
printer in turn submits the request to Cocoon (print by reference
mechanism). But this would imply that the printer is smarter (HTTP-capable,
etc.) than it might actually turn out to be.

Ugo

		-----Original Message-----
		From:	Donald Ball [mailto:balld@webslingerZ.com]
		Sent:	March 12, 2000 8:50 PM
		To:	cocoon-dev@xml.apache.org
		Subject:	Re: XML printing in Cocoon

		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