<br><br><div class="gmail_quote">On Dec 14, 2007 11:13 PM, Carl Worth <<a href="mailto:cworth@cworth.org">cworth@cworth.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Fri, 14 Dec 2007 22:47:40 +0100, "Tuom Larsen" wrote:<br>> Hello. Yesterday's answers cleared up a lot but they provoked some more.<br>> Please:<br><br></div>No problem, that's what we're here for. :-)
<br><div class="Ih2E3d"><br>> - Say an application draws to a window and optionally, if a user would like<br>> to, it exports the drawing to PDF. How?<br><br></div>First of all, an application, (at least one targeting X or GTK+), must
<br>be prepared to redraw its contents, (or any portion of its contents),<br>at any time. So an application has to have code for that already.</blockquote><div><br>But the drawing would be a raster image embeded in PDF, no? Well unless I switch to a vector surface target, as you suggest bellow?
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div class="Ih2E3d"><br>> If I understood Carl's<br>> recommendation correctly -- to use "data structures [which] know how to
<br>> 'draw themselves' given a cairo context -- I probably could write some dummy<br>> drawing functions (lineto, circle, stroke, ...) which would just record [1]<br>> the drawing operations (and serialize to disk,
e.g. in a text file). Later,<br>> I could parse that file and execute the real drawing function of a given<br>> surface. Does it make sense to you?<br><br></div>No, that's not what I was describing at all. I'm just talking about
<br>using the same code that made the stuff appear on the window in the<br>first place. Call that same code again with a cairo_t* targeting a PDF<br>surface instead of the cairo_t* targeting a surface for the window,<br>and you should be done.
<br><br>Am I making sense yet?</blockquote><div><br>Yes, I see, thanks. But consider this:<br>- The drawing is the result of some heavy computation - now it would have to run twice.<br>- Or even worse, the result of some stochastic processes.
<br>- How to pass the targeting surface through network or pipe? (Simple, you [I] don't. You [I] send the drawing source code.)<br>Please, I certainly don't want to exaggerate.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><font color="#888888"><br>-Carl<br></font></blockquote></div><br>