We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › recording limited number of frames to PDF
Page Index Toggle Pages: 1
recording limited number of frames to PDF (Read 790 times)
recording limited number of frames to PDF
Apr 15th, 2009, 10:39am
 
I want to continuously record the most recent 200 frames to a PDF file while my Processing program runs (and outputs to the screen) for hours. How can I lop off the earlier frames while keeping the most recent 200 in the PDF? At my wits end---any help greatly appreciated!
Re: recording limited number of frames to PDF
Reply #1 - Apr 15th, 2009, 12:51pm
 
im not sure if it works with a pdf file. Cause it has to be "started" then you have to add the pages and you have to "finish" it again. I guess, deleting earlier created pages within the pdf doesnt work. Would it be ok to create pngs insteadt?
Re: recording limited number of frames to PDF
Reply #2 - Apr 15th, 2009, 12:52pm
 
or 200 single pdf files...
Re: recording limited number of frames to PDF
Reply #3 - Apr 15th, 2009, 1:00pm
 
Perhaps by writing PDF in memory, with an queue of pages, although I am not sure how it will act with regard to header...
Re: recording limited number of frames to PDF
Reply #4 - Apr 16th, 2009, 6:33am
 
Thanks for the suggestions. 200 PDF files or 200 pages in a PDF would work just fine if there were some way of merging the 200 into a single PDF image. (So you know if there is???)

It doesn't really have to be a PDF, but does have to be a vector file (so PNG won't work). My goal here is to obtain, from a continuously running program, a sort of screen capture (but I can't use the various "save" functions because they give me a rastor file---too small and fuzzy)---which I can then print out large size---say, 30" x 40".

PDF is great for this, and the saveOneFrame function is perfect EXCEPT it just saves one frame (surprise) and doesn't give me the history that's on the screen.

Am I missing some obvious work-around? Thanks----
Re: recording limited number of frames to PDF
Reply #5 - Apr 16th, 2009, 8:27am
 
Merging PDF files: there are utilities and programs to do that, indeed. Never tried them.
Mmm, first Google hit: Merge PDF files with iText
Re: recording limited number of frames to PDF
Reply #6 - Apr 16th, 2009, 10:37am
 
you can easily do that with adobe acrobat ( not acrobat reader) just select all of them and select rightclick "merge to one pdf file" like philho said, there are probably some freeware programms that does that too
Re: recording limited number of frames to PDF
Reply #7 - Apr 16th, 2009, 2:58pm
 
Well, I have tried the Acrobat PDF merge with a couple of my output files---it produces a PDF file with with 2 pages. One PDF file, but still 2 images. What I need is for it to combine them into one image. Maybe I'm missing something??
Re: recording limited number of frames to PDF
Reply #8 - Apr 16th, 2009, 10:14pm
 
I totally missed the fact you needed to combine all the documents into one compound image!
With PDF format, maybe it can be done, if knowing intimately the format, removing intermediary headers/footers, etc. But I doubt such combining is available in current softwares (can be surprised, though), as this operation is... unusual for most documents.
It might be slightly easier in SVG format (there are tools to manipulate XML) but still quite some work.

The PDF reference has an example of having "Many Frames Into One File". The difficulty, if I understood correctly, is that you need to bufferize the frames, dropping the oldest ones, so that when something happens (key or mouse pressed, etc.), you output the previous frames to file.
This one is hard...
Re: recording limited number of frames to PDF
Reply #9 - Apr 17th, 2009, 7:10am
 
I didnt get that either... thats a hell more complicated... maybe there is a way to use illustrator scripting to open alot of files and combine them in one file.
Re: recording limited number of frames to PDF
Reply #10 - Apr 17th, 2009, 5:24pm
 
Well, I'm really glad that at least I'm not the only one who thinks this is hard! I it's possible to open the PDF files in Illustrator and copy one file onto another----but 200 of them----arghh. I'm not familiar with SVG format.

My current approach is something like this: While the porgram is running, when there's a keypress, I reset frameCount to set it back by 200:
frameCount = (frameCount - 200);
Then I use beginRecord to open a PDF file and start recording. Later, I tell it to end recording when frameCount equals frameCount + 200.

This looks like it might work, because when I reset frameCount, the moving image on the screen also resets itself---it goes back a little and re-does what it just did (it looks weird).

BUT---then the program barfs and tells me that it has run out of memory. I look at the PDF file, and there's nothing in it. So, either this is just a hair-brained approach anyway, or I'm not implementing the endRecord properly.

If I get it to work, I'll post it. And if anybody has any other thoughts or can get this to work, let me know. Thanks!
Re: recording limited number of frames to PDF
Reply #11 - Apr 17th, 2009, 5:38pm
 
like i said, there is probably a script that does that job... i googled and found somehting that looks like it will work
http://kelsocartography.com/blog/?p=2047

it opens all the files pdf, or svg in one folder and combine them in one Illustrator file.
Re: recording limited number of frames to PDF
Reply #12 - Apr 17th, 2009, 7:25pm
 
Ahhh---I see. Fantastic. I'll try it. Many thanks!
Page Index Toggle Pages: 1