| Author |
Comment/Response |
Armando Sano
|
06/14/10 01:57am
According to the documentation, it is easy to import images from a multi-page .pdf document into as many images as there are pages, using the "Pages" or "Pages", n mechanism.
What about the reverse? Suppose I have a collection of plots (e.g. depending on a parameter):
plot[a_]:=Plot[Sin[a x],{x,0,Pi}]
It is easy to export the collection as an animated .gif using:
Export["animated-plot.gif", Table[plot[a],{a,1,10}]]
However, .gif exports the graph as a bitmap, whereas .pdf keeps the vector format. Unfortunately, issuing
Export["animated-plot.pdf", Table[plot[a],{a,1,10}]]
results in a 1-page .pdf file containing the list. I have the feeling that using the "Pages" and/or "Rules" attributes/elements of the Export[] function would manage to do this, but I haven't been able to.
A workaround is to export every frame separately and then recombine them with another tool (such as pdfjoin, or pdftk on Unix-based systems):
Do[Export["plot-frame"<>ToString[a]<>".pdf",plot[a]],{a,1,10}]
and then join the resulting files "plot-frame1.pdf" to "plot-frame10.pdf" into a single multi-page .pdf file. But clearly, this is not very direct nor clean. Is there a way to achieve that more simply?
Thanks for any advice!
Armando
URL: , |
|