Is it possible to create bookmarks on certain frames? - avisynth

Is it possible to create multiple bookmarks on the timeline that represent specific frames? Let's say i want to open an .avs file and it will have several "bookmarks" on the timeline representing frames that are of interest.
Does this thing exist in AviSynth?

Open an .avs file in what?
If you use AvsPmod, you can bookmark frames and jump between them quickly. You can also generate chapter files from bookmarks that you can then use in an actual encode (when muxed in a container like mp4 or mkv).

Related

Automating Split, Save Name and Error Checking with Acrobat Action Scripts?

I'm considering convincing my company to upgrade to Acrobat Pro so I can automate the processing of my scanned documents. Before I bring it up, I want to make sure the things I want to do are possible. I don't need anyone to give me the code, I just want to know if this is possible.
The documents i'm working with are landscape, 2-5 pages, and have the filename and page numbers in the footer. I want to scan a big stack of them and have a script perform the following actions:
Use OCR to acquire the filename and page numbers for each page. I would like to restrict the OCR to only look at the footer to save time and RAM.
Using the filenames, I want it to detect when one document ends and the next one begins so they can be split into separate files.
Before saving the split files, check that the number of pages in the file matches the page total in the footer. (I work in a factory and the documents can get sticky, so my scanner frequently pulls two pages at once)
Instead of saving the files where the page total doesn't match, compile a list of the errors so I know which documents need to be rescanned.
Finally, save all correct documents with their filenames from the footer to a folder on my desktop.
This could save me hours a week, so I'm hopeful that it's all possible. Thanks

Stitching thousands of .png files with Fiji

I wrote a Node.js app that creates images that I want to stitch. I want to create one image with over 10,000 charts. My original solution was to create images each with over 200 charts each and stitch those together. That results in 50 images being stitched.
I now wish to create one chart per image, resulting in over 10,000 images, and stitch those together. When I drag and drop the files into Fiji to create a montage, it opens each individual one. It takes way to long to open the entire collection.
Is there a way I can create a montage of thousands of images and stitch everything into a single file in Fiji that doesn't require every image being opened?
You say that you want to stitch your image, which implies your goal is to find where these images overlay from a specific channel, but when you say montage, it makes it seem like what you really want to do is concatenate the images into a stack or align them into a montage. To me it appears that you have a program which will output some form of stack which has 200 planes, and then concatenate them together or align them as a montage.
In principle, you will have to open every image, but opening them with batch mode on and running the operations by macro will reduce time by not rendering the viewable image. It would not be possible to run ImageJ/FIJI operations on an image without opening it, as this is beyond something like renaming or deleting a file.
If you really meant that you want to stitch them, use the stitching plugin function for Grid/Collection stitching, and set the overlap to zero. This requires having your images be in a single folder, and in your case splitting them into individual images instead of sets of 200, with each file labeled with an increasing number (i.e. file_name_1.tif, file_name_2.tif, where each file_name is the same and only the number changes). If you have stacks of 200 and are happy to keep them that way in the created montage, the file naming convention needs to be the same. You should select the Fuse and Display option to get the resulting image. The output will be a merged, larger image.
When you are trying to somehow stitch the images and overlay the stacks, scripting the commands to run it in batch mode would also work.
For stitching I highly recommend the MIST plugin. For batch opening files, try dragging and dropping the folder containing the images rather than the images themselves. Alternatively, go through File -> Import -> Image Sequence.

A Table of Contents Page for a Scanned PDF

I was given some really old but very useful hand-written notes recently and in a bid to preserve them, I had them scanned into a file in the PDF format. What I have is a 35 page PDF but I want to add a contents page at the beginning so that I can use the first page to click my way to a specific topic.
More precisely,
I want a page which says
Topic 1
Topic 2
Topic 3
...
Each one should be linked to a page of my choosing.
I've explored a lot of standard tools out there to help me with this, like LibreOffice, pdftk etc. but the solution does not appear to be in the form of a simple application and a few clicks. My hunch is that this will require a program written in a suitable language. The way I'd want this program to work as follows:
ProgramName Input.pdf CustomTOC.txt
Where CustomTOC.txt could be a simple ASCII table containing two columns, one column being the title and the second column being the page number. The output of this program will be another PDF file which contains one page appended at the beginning of Input.pdf containing a table of contents with hyperlinks to the right pages.
I have managed to solve this problem though I don't think this is the best way to do it. I have written a Python program that accepts two mandatory inputs - the input PDF file and '|' separated ASCII table containing columns and page numbers. A third optional output can be the name of a PDF file which contains the output. If this is not provided then the original input file is rewritten.
How the code works? Uses a system call to 'pdftk' for bursting the PDF file into its constituent pages. Writes a .tex file which contains a \listoffigures command for the first page with the package hyperref ensuring it links to the figures. The later part of the .tex code contains several figure insertion statements where the PDF file corresponding to each page is inserted, providing captions only to those PDFs for which there is an entry in the provided TOC table.
Why the code is not ideal? It relies on too many dependencies. It relies on a system call to the pdftk package, it requires that LaTeX be also installed on the machine with the graphics package. In the current version of the code, the PDFs on each page do have some offset which I am trying to solve using geometry package with custom margin settings. I will try to post the code once this problem is solved.
A more ideal solution. That which does not require LaTeX and can use some PDF library within Python to achieve the same effect. Comments and suggestions welcome!

Is this possible to break the pdf file smaller than page wise breaking?

I found there is a lot of tools available for breaking the Big PDF files into smaller one by splitting the original PDF file PAGE WISE.for example, if i have a 10 page PDF Document,then we can able to break the original pdf file into 10 pieces in page wise splitting.
But i want similar kind of tool that breaks the PDF file smaller than the Page wise splitting.That means,i need to split the PDF page into different documents based on any parameter like paragraph,section,element...
for example,
If my PDF file having 2 pages with 10 paragraphs then i would like to split the pdf file into 10 separate Pdf file based on paragraph parameter...
Also, I strongly believe pdf does not contain any structure like Open XML.But i also Suspecting
How the tools can able to break the pdf files in to small pdf files by splitting page wise? What kind of mechanism they are using for page wise splitting PDF File?
So, Is there any way to do my work? Please give me your valuable suggestion on this?
PDF is a vector based document description language. It's page based so in a way every page is independent from the next one. Splitting page wise is therefore pretty easy. Contrary to a raster image where you can extract small subsets independently in a pdf you have to render the whole page to know how a small subset looks like.
Say you have a Page (black) which contains a complex shaped object (here it is a line but it could be any text, shape, image, etc.) and you want to extract a subset (red). You would have to first find all the objects that produce visible output in the region of interest. Then you would have to modify them so they are rendered correctly (in this case calculate the green points from the blue points while preserving the shape of the object).
An easier approach would be to include the whole page and clip the viewing area to the dimensions of the region.
You could do this with pdfjam. Check the --trim/--offset/--delta command in conjunction with a custom paper size (Example 6,7 on the pdfjam website). You would still have to somehow calculate the coordinates of the region of interest though.

Extract layers from PDF file to HTML

I have a PDF file, containing layers.
For example, on some pages, there are graphs, with additional data displayed on top of that graph, when clicking (layers).
Now I need to try to fetch all these layers out of the PDF file, or to be precise, I need ALL the data from that PDF file, including layers. The pdf file contains javascript to show/hide the layers when appropriate.
What is the best approach? Is there any tool that actually works for my intentions? Or should I write something myself? (If this is possible ofcourse).
Edit:
Here you can download the PDF file:
http://www.2shared.com/document/IutUfDfr/OR_erasmus.html
The password for viewing is: erasmus
I do not know if there are any tools per se but if you cannot find those you might do the following:
for each combination of on/off layers that you are interested in walk all pages and collect the content streams. Tokenize those and cut out the content you do not want to see (the commands you need to monitor to determine this are BDC and EMC). Save the stream again with the clipped content (naturally save the result in different files). You need something to read the PDF object structure and update some objects (there are lot's of libraries for that), plus you need tobe able to parse the content streams.
Now you will have a set of PDF files without layers (optional content) for which there are plenty tools to render to HTML etc.
Note: optional content <--> layer switches in the PDF viewer usually are 1:1 but the standard supports a full n:m mapping. I would concentrate on the real optional content blocks that can be turned on/off to keep things simple.
you can use this tool to extract images and text from even locked pdfs
http://download.cnet.com/Able2Extract/3000-2079_4-10249654.html
I use it myself sometimes and it has the ability to convert to HTML