?
Solved

How to split a PDF by page and create a dynamic name for each file?

Posted on 2012-09-07
7
Medium Priority
?
549 Views
Last Modified: 2012-09-12
How can I split a PDF by page (create 129 files) and create a specific name for each file?
For instance I want the file to be 001, 002 etc.  Or, better yet, name the file based on a field in the PDF itself i.e. @myname001, @myname002, etc.

Thank you very much.
0
Comment
Question by:kgittinger
  • 3
  • 2
  • 2
7 Comments
 
LVL 7

Expert Comment

by:djStraTTos
ID: 38376194
Rename the Initial file to "myname" Open it with Adobe Acrobat go to Tools>Extract Pages>Extract as separate files.

This will create myname1,myname2,...mynameX at the location you choose.Extract Pages
Another way to mass rename the files would be to extract the pages as instructed above without the initial rename of the file and then use the mass rename option of windows.
You simply select all the files and choose rename, you set the name with out any numbers and then all the files will be renamed to filename(1), filename(2), etc...
0
 

Author Comment

by:kgittinger
ID: 38376445
@myname is a field in the PDF.  That name needs to be part of the file name.

Thank you.
0
 
LVL 7

Expert Comment

by:djStraTTos
ID: 38379482
Sorry I missed that part.

I guess the question is how to do it automatically.

My post above replies on the first section of your question considering that you manually rename one or the other way the extracted pages using the field's name yourself.

Unfortunately I don't know an automated procedure that will grab a form's field name and use it the way you mentioned.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:kgittinger
ID: 38388388
I've requested that this question be deleted for the following reason:

Please close this question.  We needed to purchase a program to do this.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 38388382
I understand that you want this question closed, but let me try to give you an answer anyway :)

You can do this by writing JavaScript code: Your JS code will have to be a folder level script that e.g. creates a menu item or a tool in Acrobat, and when selected will analyze your PDF file and will extract the form field. In a second step, it will extract one page at a time and use your custom name.

Take a look at the following folder level script. Just store it in e.g. C:\Program Files\Adobe\Acrobat 10.0\Acrobat\Javascripts

function Split() {
	var baseName = this.getField("fileName").value;
	
	for (var i=0; i<this.numPages; i++)
	{
                var num = i + "";
                while (num.length < 3)
                {
			num = "0" + num;
		} 
		this.extractPages({ nStart: i, cPath: "/c/temp/" + baseName + num + ".pdf" } );
	}
}


// add the menu item
app.addMenuItem({
     cName: "split",
     cUser: "Split",
     cParent: "Edit",
     cExec: "Split();",
     cEnable: "event.rc = (event.target != null);",
});

Open in new window


You will find a new menu item under the "Edit" menu when you have an active file.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 38388389
It's a bit late, but I just provided a solution that does not require the asker to go out and buy software.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 38390543
One more thing: You will have to enable the "Enable menu items JavaScript execution privileges" in Preferences>JavaScript for this to work. Otherwise you will end up with a JavaScript exception.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question