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

Need to extract pages and save to individual pdf files

Explorer ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

While we are waiting to get Acrobat DC Pro, is there a way to extract every other record in a PDF file using Acrobat Pro 11 and save the one-page files idividually?  Input PDF file is over 7,000 pages. 

 

Thanks for the help!

 

 

TOPICS
Edit and convert PDFs , PDF forms

Views

1.3K

Translate

Translate

Report

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 ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

The old version of Acrobat can also extract pages.

Votes

Translate

Translate

Report

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
Explorer ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

I just wondered if there was a way to extract all of the pages in an 8000 page pdf file to 4000 individual 2 page pdf files. I don't know how to extract two pages at a time. Each of the two page files extracted would contain a first page with a name and policy and a second page with a static notice to all policyholders.  It would be great if the individual 2 page files could be created using the policy number for the name.

 

Thanks Bernd! Have a great weekend!!!


Ken K.

Votes

Translate

Translate

Report

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
Advisor ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Hello @joken99 

 

Is it possible for you to post an example file with a smaller number of pages to test with? Also can you tell us a bit more about the policy number for the naming...is it always the same format, i.e digits and characters and any special characters.

 

Regards,

Mike

Votes

Translate

Translate

Report

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
Explorer ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Here are the first 20 records of the file, saved as separate files and as one file with all 20 pages. Is there a way to extract 2 page records that contain the cover page and notice and name the 2 page files using the policy number on the first page?

Thanks for the help!!!

Ken K.


The information contained in this message, including any attachments, may be confidential and is for the intended addressee only. Any unauthorized use, disclosure, distribution or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and permanently delete the message and any attachments

Votes

Translate

Translate

Report

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
Advisor ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

hello @joken99 

 

You didn't include any attachments and you didn't provide any details around the policy number.

 

Regards,

Mike

Votes

Translate

Translate

Report

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
Explorer ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Files should be atttached now.  Sorry about that!!  The policy number is the number on every other page in the upper left corner starting with page 1. 

 

[FILES REMOVED BY MODERATOR FOR CONTAINING PERSONAL INFO]

Votes

Translate

Translate

Report

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 ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Paste the script below in the console, then select all and press the enter key of the numeric panel.

 

 

var noPN=[];
var nbFiles=0;
for (var p=0; p<this.numPages; p+=2) {
	var OK=0;
	var nbWords=this.getPageNumWords(p);
	for (var i=0; i<nbWords; i++) {
		var theWord=this.getPageNthWord(p, i, true);
		var q=this.getPageNthWordQuads(p, i);
		m=(new Matrix2D).fromRotated(this,p);
		mInv=m.invert();
		r=mInv.transform(q);
		r=r.toString();
		r=r.split(",");
		if (r[0]>56 && r[1]>754 && /^\d{7}$/.test(theWord)) {
			OK++;
			nbFiles++;
			try {
				this.extractPages({
					nStart: p,
					nEnd: p+1,
					cPath: "Policy Number #" +theWord+".pdf"
				});
			} catch(e) {}
			break;
		}
	}
	if (!OK) noPN.push(p+1);
}
var txt=nbFiles+" files have been created.";
if (noPN.length) txt+="\nNo policy number found on page(s) "+noPN;
app.alert(txt,3);

 

Capture_d’écran_2021-07-26_à_20_55_04.png

Votes

Translate

Translate

Report

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
Advisor ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Hello @joken99 

 

Give the below code a try. It worked for me on the test file First20.pdf extracting every two pages named by the policy#.

  for (var p = 0; p < this.numPages; p=p+2) {

     for (var n = 0; n < this.getPageNumWords(p); n++) {
     cWord = this.getPageNthWord(p, n, true);


     if (cWord.match(/\b\d{7}\b/)) {
        var pdf_Name = cWord;
     }  
 }
    var newFilePath = this.path.replace(this.documentFileName, "");
    this.extractPages({ nStart: p, nEnd: p+1, cPath: newFilePath + pdf_Name + ".pdf"});       
 
}
app.alert("Done Extracting Pages!");

 

Regards,

Mike

Votes

Translate

Translate

Report

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
Explorer ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Thanks Mike; but, How do I run javascript on my file?

Votes

Translate

Translate

Report

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 ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

It's explained in my answer (see my screenshot):
Open the console (ctrl J on PC and cmd J on Mac), then paste the script in the console, then select all the script and press the enter key of the numeric panel.
Both scripts assume the policy number has 7 digits.

Votes

Translate

Translate

Report

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
Advisor ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Hello @joken99 

 

You can run the code in a Action Wizard action.

 

1. Select the Action Wizard, then "New Action

mikeb41294032_0-1627316706154.png

 

 

2. In the Create New Action window on the left side go down to More tools > Execute Javascript add the tool to the right side

mikeb41294032_2-1627316706117.png

 

 

3. Click on Execute Javascript > specify settings, in the window that opens copy and paste in the code and save and name the action.

Be sure to uncheck the Prompt User check box.

mikeb41294032_4-1627316706112.png

The newly created action will appear under the Action Wizard in the action list. You can then run the action on the opened file and it will extract every two pages uniquely named.

 

Regards,

Mike

 

 

Votes

Translate

Translate

Report

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
Explorer ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

How do I get to the action wizard in Acrobat Pro 11?



The information contained in this message, including any attachments, may be confidential and is for the intended addressee only. Any unauthorized use, disclosure, distribution or copying of this message is prohibited. If you are not the intended addressee, please notify the sender immediately and permanently delete the message and any attachments

Votes

Translate

Translate

Report

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
Advisor ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

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