<br><br><div class="gmail_quote">On Dec 14, 2007 11:13 PM, Carl Worth &lt;<a href="mailto:cworth@cworth.org">cworth@cworth.org</a>&gt; 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, &quot;Tuom Larsen&quot; wrote:<br>&gt; Hello. Yesterday&#39;s answers cleared up a lot but they provoked some more.<br>&gt; Please:<br><br></div>No problem, that&#39;s what we&#39;re here for. :-)
<br><div class="Ih2E3d"><br>&gt; - Say an application draws to a window and optionally, if a user would like<br>&gt; 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>&nbsp;</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>&gt; If I understood Carl&#39;s<br>&gt; recommendation correctly -- to use &quot;data structures [which] know how to
<br>&gt; &#39;draw themselves&#39; given a cairo context -- I probably could write some dummy<br>&gt; drawing functions (lineto, circle, stroke, ...) which would just record [1]<br>&gt; the drawing operations (and serialize to disk, 
e.g. in a text file). Later,<br>&gt; I could parse that file and execute the real drawing function of a given<br>&gt; surface. Does it make sense to you?<br><br></div>No, that&#39;s not what I was describing at all. I&#39;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&#39;t. You [I] send the drawing source code.)<br>Please, I certainly don&#39;t want to exaggerate.<br>&nbsp;</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>