From: Tony G. <Ton...@Su...> - 2006-03-08 23:33:50
|
"Mauro C." <inc...@ya...> writes: > --- Tony Graham <Ton...@Su...> ha scritto: ... >> > I have the same problem with the output result: >> > where can I get a pointer to result doc >> > (FoDocGP->job)? >> >> Yes, I guess so. >> >> > is the output file written when fo_doc_gp_finalize >> is >> > invoked? >> >> Yes, which really happens when you run: >> >> 'g_object_unref (fo_doc);' >> >> I am open for suggestions on how to change that. > > my idea is to separate creation and file writing and > have to call explicitly function to generate and other > one to get result or to write file. > > not see all the source of libgnomeprint, but ther is: > > GnomePrintJob->meta->buf > > guchar *buf; > > maybe the buffer used for the output result. > >> >> I don't want to expose the GnomePrintJob underneath >> FoDoc any more than I >> wanted to expose the xmlDocPtr under FoXmlDoc, but >> it's obvious that the >> current setup is not useful for your purposes. > > good strategy to not expose implementation expecially > for libgnomeprint. so you can change print engine > without force to recompile apllication that rely on > libfo. The real point of doing the Cairo backend now was so any changes we make to the interface for writing output will also work with a Cairo backend. Cairo is similar to GNOME Print in that the output isn't completely written until you dereference the object representing the Cairo document. In some ways, Cairo is worse than GNOME Print since Cairo starts writing output when you create the 'surface' for the document and doesn't terminate the document until you dereference it. That makes it impossible to output multiple copies of one output. There is a Cairo RFE in its bugzilla asking for a public 'meta' interface that can be 'replayed' multiple times to write multiple copies of the output, but there's no indication whether or not it will be implemented. The other problem is that, like with GNOME Print, you need to specify the output document before you start since you need to begin by creating the Cairo 'surface' for your style of output. I.e., there's separate surface types for PDF and for PostScript (and, in the unstable Cairo, SVG). One thing that Cairo has that AFAICT GNOME Print does not have is a function for each surface type to write the output to a stream (and the methods for writing output to a file each use their respective functions for writing to streams anyway). So with Cairo there's really no way to "get at" the output result other than setting up the output result that you want *before* you do any formatting. Regards, Tony. |