Skip to main content
Participant
August 26, 2018
Answered

Take a Snapshot with javascript or other

  • August 26, 2018
  • 4 replies
  • 2463 views

Hi Guys,

I've been reading through the docs for what seems to be days nows.  I cannot find any docs that reference the "take a snapshot" functionality using javascript or any other language.

What I am trying to do is just that.  Take a snapshot from a pdf file, and place it inside another pdf.  What I'd like to do is give coordinates (window size, and location) to my script and It will copy the image, and I can paste that data into another dynamically generated PDF.  I've got over 200 pages in each PDF file which I'm doing this manually now with the take a snapshot function from (EDIT->Take a Snapshot), then pasting it into a word doc so I can then create a PDF to distribute.  There has got to be an easier way to do this.

If anyone has done something similar or can point me to the correct place in the docs that would be awesome.

So just to be clear.  My intention is to do all of this programatically with javascript or some other supporting language.  I'll open the pdf programatically, take the snapshots, then generate the new PDF all with the script.  I don't want any manual clicking.  The page coordinates of everything that I have to "snapshot" are always in the same location so they are fixed coordinates.  I just need to do a foreach loop through all the pages and consolidate the information.

Thanks in advance

Joe

This topic has been closed for replies.
Correct answer try67

Don't waste your time. JavaScript in Acrobat can't take a screenshot of a PDF. You need to find another way of achieving what you wish.

4 replies

Legend
August 26, 2018

I can imagine such a thing would be considered a HUGE security hole. Remember, Acrobat JavaScript can arrive in files sent to you on the internet, and can send stuff onwards...

I wouldn't fret about language yet. Find the APIs you need, and then look at your choice of language. Especially find the screen capture tool first. Programming Word via OLE is well discussed.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 26, 2018

Don't waste your time. JavaScript in Acrobat can't take a screenshot of a PDF. You need to find another way of achieving what you wish.

macleodjbAuthor
Participant
August 26, 2018

OK, so what language can do it?  I'm just flabbergasted that there is no api function linked to the "take a snapshot" function that's inside the Acrobat UI.

try67
Community Expert
Community Expert
August 26, 2018

I think that Acrobat is really not the right tool for what you're describing. There are much stronger standalone libraries, written in Java or C++ for example, that can do it much more easily.

If you're interested in hiring someone to do it for you I've developed some tools that do a very similar thing for my clients, and would be happy to create one for you as well. You can contact me private (try6767 at gmail.com) to discuss it further.

Legend
August 26, 2018

Years ago I used an automated snapshot tool when authoring something. It saved the snapshots as a big pile of TIFF Files. So, in my world, nobody would parse TIFF, I’d automate placing TIFF into Word. Finally, Word to PDF. Nobody authors direct into PDF, that’s why you’re not finding leads.

Legend
August 26, 2018

There are tools for automating screen captures for tech authors. They don’t make PDF because the illustrations normally form part of an editable work. There are also tools for automated testing. I suggest you focus on these two areas rather than any idea of making a PDF directly, which is an unusual, perhaps unique, wish. Turning a pile of TIFFs into a Word document programmatically sounds approachable.

macleodjbAuthor
Participant
August 26, 2018

Thanks but your response just leaves me with more questions.  For example if i am going to parse a tiff file instead of a PDF, how can I convert the PDF into TIFF format?  I'm still left with the question, how can I take a snapshot from either the PDF or TIFF?