Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bulk Save Extracted Page from Multiple pdfs to Individual PDFs in an Adobe Action

New Here ,
Dec 10, 2021 Dec 10, 2021

Is it possible to bulk save (as opposed to save as) an extracted page from multiple pdfs to individual PDFs in a folder automatically with an Adobe Action?

TOPICS
How to , JavaScript
555
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2021 Dec 10, 2021

Yes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2021 Dec 10, 2021

Yes, this is possible using a script.

Which page do you want to extract? How do you want to call the new file, and where do you want to save it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2021 Dec 10, 2021
LATEST

We got the extract based on a phrase action to work, but it opens the extracted pages as temporary files and you have to save each individual one,  An easier way is to save them all in bulk in the same folder with different names so they dont overwrite any of the other pdfs.

 

Heres the current action we have:

 

<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://ns.adobe.com/acrobat/workflow/2012" title="Extract Pages With String" description="Looks for a certain string and extracts all pages that contain that string into a new PDF document. The document will be open in Acrobat when this Action is run, and needs to be saved. " majorVersion="1" minorVersion="0">
<Group label="Untitled">
<Command name="JavaScript" pauseBefore="false" promptUser="false">
<Items>
<Item name="ScriptCode" type="text" value="// Iterates over all pages and find a given string and extracts all &#xD;// pages on which that string is found to a new file.&#xD;&#xD;var pageArray = [];&#xD;&#xD;var stringToSearchFor = &quot;220.3a&quot;;&#xD;&#xD;for (var p = 0; p &lt; this.numPages; p++) {&#xD;&#x9;// iterate over all words&#xD;&#x9;for (var n = 0; n &lt; this.getPageNumWords(p); n++) {&#xD;&#x9;&#x9;if (this.getPageNthWord(p, n) == stringToSearchFor) {&#xD;&#x9;&#x9;&#x9;pageArray.push(p);&#xD;&#x9;&#x9;&#x9;break;&#xD;&#x9;&#x9;}&#xD;&#x9;}&#xD;}&#xD;&#xD;if (pageArray.length &gt; 0) {&#xD;&#x9;// extract all pages that contain the string into a new document&#xD;&#x9;var d = app.newDoc(); // this will add a blank page - we need to remove that once we are done&#xD;&#x9;for (var n = 0; n &lt; pageArray.length; n++) {&#xD;&#x9;&#x9;d.insertPages( {&#xD;&#x9;&#x9;&#x9;nPage: d.numPages-1,&#xD;&#x9;&#x9;&#x9;cPath: this.path,&#xD;&#x9;&#x9;&#x9;nStart: pageArray[n],&#xD;&#x9;&#x9;&#x9;nEnd: pageArray[n],&#xD;&#x9;&#x9;} );&#xD;&#x9;}&#xD;&#xD; // remove the first page&#xD; d.deletePages(0);&#xD; &#xD;}&#xD;"/>
<Item name="ScriptName" type="text" value=""/>
</Items>
</Command>
</Group>
</Workflow>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines