Save each page of a multi-page document as a separate file using spawned file names with javascript

Hello
We are currently changing our hard-copy personnel files and converting them to pdf files.  We have scanned the entire file into one multi-page document.
I am wanting to save each page (or groups of pages) as separate files.
In order to facilitate this, I have duplicated field names--such as FirstName, LastName, EmpNo on each page.  This information should be static for the entire file.
However--I also need information that will change for each individual "page" or document--such as TypeOfDoc, Date, etc.  I have used the Spawn fields using the overlay method on each of the pages in the document.  Then I went in and filled in the information for each page of the document--such as TypeOfDoc, DateOfDoc.
Now I want to save each page of the document as a separate file using the field names as the file name.
I first created an action that would split all the pages into separate files and save them into a folder.
Then I want to save each file as a specific file name based on the information in the fields.
My problem is obtaining the name of the spawned field name.  The rest of the field names I am not having a problem with.
This is what I have so far to name the file.
// Get the field value
var oPage = this.pageNum;
var fn = getField("P" + oPage + ".TEMPLATE.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
// Specify the folder
var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
// Determine the full path
var fp = fldr + fn +".pdf";
// Save the file
myTrustedSpecialTaskFunc(this, fp);
This code is also accompanied with folder level scripts.
My problem is obtaining the name of the spawned fields using javascript.  Each document has several pages--so I would like to obtain the field name through script.
I receive the following error.
TypeError: getField("P" + oPage + ".TEMPLATE.DATE") is null
I think this is due to the fact that I have extracted all the pages as individual files.
If I were to do the above, but not extract the pages first--I do not know how to just save one page at a time.
Please help.  This is a massive project, and if we have to save each file individually, it will take a lot of time.
I am a beginner, so any assistance is appreciated.
Thank you

I am not understanding exactly where to put the curly brackets.  I have tried two different ways, and still get the same error.
This is one way
var oPage = this.pageNum;
// Specify the folder
var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
// Determine the full path
var fp = fldr + fn +".pdf";
for (var i = 0; i < this.numPages; i++) 
var fn = getField("P" + oPage + ".template.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
{this.extractPages({  
nStart: i,  
cPath : fldr + fn + ".pdf"
The other is this
var oPage = this.pageNum;
// Specify the folder
var fldr = "/n/Personnel/ScannedDocuments/NAMEDPAAS/";
// Determine the full path
var fp = fldr + fn +".pdf";
for (var i = 0; i < this.numPages; i++) 
var fn = getField("P" + oPage + ".template.DateOfDoc").valueAsString + getField("FirstName").valueAsString + "-" + getField("LastName").valueAsString;
this.extractPages({  
nStart: i,  
cPath : fldr + fn + ".pdf"
Thank you for your help.

Similar Messages

  • How do I save an individual page of a multi-paged document?

    How do I save an individual page of a multi-paged document?

    That would require Adobe Acrobat and not the free version of Adobe Reader.

  • How do I rotate a single page in a multi-page document?

    I recently upgraded to Adobe Acrobat X version 10.0.0. Where is the option to rotate a single page in a multi-page document?
    Also, I often receive faxes as PDF's that are upside down. How do I rotate a page so that it remains rotated the next time that I open it?
    Thanks.

    GeorgeRudd wrote:
    It works (it saves the rotation) when I use the rotation method under the tools menu. Thanks.
    Yes.
    Tools > Pages > Rotate permanently rotates the pages (if you save the file afterward of course) and View>Rotate view only changes the view for the current session.

  • How do I print selected pages from a multi page document

    How do I print selected pages from a multi page document?
    This question was solved.
    View Solution.

    Hi,
    It depends on the software you are using, what is it ? In general you can select a range or just a number of pages.
    Regards
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Why can I not print all pages in a multi-page document?

    Why can I not print all pages in a multi-page document?

    We are using Adobe Acrobat Reader, version 11.0. It's on a relatively new laptop (Windows 8) and accessing the internet through Mozilla. The printer is an HP Officejet. When I open a multi-page Adobe document and try to print all pages, I only get 1-2, have to then say print page 3, then say print page 4, etc. We use Adobe on our other laptop and it prints all pages of all Adobe documents and we have never had a problem and he accesses documents on the internet also through Mozilla.

  • Is it possible to delete a single page from a multi-page Adobe document?

    Is it possible to delete a single page from a multi-page Adobe document?

    With Adobe Acrobat yes - but not with the free Adobe Reader.

  • Laserjet m1217 nfw stops 1/4 int 2nd page scan of multi page doc

    I have a Laserjet M1217 nfw all- in - one . 
    laserjet m1217 nfw stops 1/4 into 2nd page scan of multi page doc
    error says that adf ran out of paper.. there is still paper in the scanner part way through the rollers
     I have fixed problems with the scan not starting until page in a centimeter in but dont remember how i fixed it
    susspect problem may be same

    Hi @pwyckoff ,
    I see that you are experiencing issues scanning from the ADF. The paper isn't being recognized. I would like to help you out today.
    It might be a paper sensor or hardware issue with the printer.
    I would do a hard reset to see if that will resolve the issue.
    Leave the printer on and unplug the power cable from the printer and wall outlet for 60 seconds.
    Then reconnect the power cable to the printer and wall outlet rather than a surge protector.
    This ensures the printer is receiving full power and may help this situation.
    Here is a document for cleaning the ADF rollers and the separator pad.
    'Document feeder mispick' Message Displays on the Control Panel and the ADF Does Not Pick Up Paper o...
    Please call our technical support at 800-474-6836 if the issue continues. If you live outside the US/Canada Region, please click the link below to get the support number for your region. http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Having trouble with the syntax when trying to only print some random pages from a multi page documen

    Having trouble with the syntax when trying to only print some random pages from a multi page document.  So far in the Print Selection Area, I have chosen "pages" and then typed 1,3-4 so as NOT to print page 2 but this does not seem to work. - Help Please

    In my updated firefox, the print button does NOT open print preview first.
    How can I access print preview function?

  • How to view all pages of a multi-page HTML email in Mac Mail 5+ (Lion to Mavericks)?

    In previous versions of Mac Mail (up to that included with Snow Leopard, Mail 4), it was possible to scroll through all pages of a multi-page HTML email, like that send from the Tivoli Storage Manager reporting system.
    Since Lion, that has not been possible. The first page displays, but that's it.
    As a possible complication, I'm accessing an Exchange server, not IMAP.
    I have not been able to find a setting that might be related to this, nor have I found anyone who seems to be perturbed by this issue. Perhaps there's very few of us trying to read multi-page Tivoli reports on a Mac.
    In any case, I would prefer not to switch to a different mail app, or sign on to the Outlook Web Service version of our email to see the full report.
    Any thoughts?

    I've been able to find someone willing to do some testing that I can't do without installing old versions of Reader on my computer.  The surprising (to me) result is that the Submit button causes the problem.  By simply removing the Submit button, Reader 10 is now able to print page 1.  The Submit button was set up to do a "mailto".  I don't know whether other destinations also cause the problem of the page not printing with old versions of Reader.

  • How do I save one page from a multi-page pdf document?

    Can I take a 65 page pdf file and save it as 65 individual pages?

    I know if you are using Adobe Acrobat X, you can go to the "Tools" section and then under "Pages" you will see "Extract". If you click on that while your document is open it will show you your options for extracting the pages and saving them as individual PDF files. Be sure to check the box "Extract Pages As Seperate Files" and this should help get you on your way. I hope this helps answer your question on extracting pages from a multiple page PDF.

  • Unexpected size in Tray 1, Load A4 and press OK; 1st page of a multi page document prints fine...

    Hello everybody, I have an annoying issue with a HP Laserjet Pro 100 MFP M175nw. The issue is that printing from any application and any PC platform (read Windows XP, 7 and 8.x, Mac OSX SnowLeopard and Linux) the first page is printed without a problem but the second page and the rest of the pages never get printed without intervention. The printer simply stops after printing the first page, the control panel display shows the message "Unexpected size in tray 1" "Load A4 and press OK."  pressing OK button the 2nd page is printed, for the 3rd and the nth page same procedure....  The printer is out of warranty and HP does not provide any support on this subject. Printer is using genuine HP drum and toner cartridges. This isssue came up after having printed in total approximatively 7000+ (bw & color) pages in the past 2 years. The paper size used is A4, the printer is configured to use this paper by default. To remedy the problem checked all suggestions by HP provided online and checked some Dutch (HP) forums without finding a proper solution. Followed all advice such as resetting the printer, reinstalling drivers, updated firmware, using HP doctor.., replaced and changed paper lot several times, replaced toners etc etc ect  no luck in printing whole documents without intervention. The issue is that printing from any application and any PC platform using either PCL or PS, USB or Ethernet or wireless (read Windows, Mac OSX and Linux) the first page is printed without a problem but the second page and the rest of the pages never get printed without intervention. The printer simply stops after printing the first page, continues to do something, lots of noise, displays printer cooling down or so message on the control panel and immediately afterwards the control panel display shows the message "Unexpected size in tray 1" "Load A4 and press OK."  I am no expert in hardware but I do know enough about using the PC; I guess the problem is related to hardware which is logical as all mainstream PC platforms display same behavior. I could surely carry-in the printer to a HP service center but the price they charge would urge me to spend the money on a new printer; not HP branded one that is. Any suggestions are very much appreciated. Regards,Gece Kusu

    Hello, I have exactly the same problem. I could have written the same text. And I have'nt found solutions. Except, perhaps, change this printer (and quit HP?).
    Any suggestions would be really much appreciated.
    Thank you for your possible responses.

  • Convert multi-page pdf to multi-page jpg files?

    Hi,
    My boss has asked me to convert a large number of multiple-page pdfs into multiple-page jpgs. I have been able to convert the pdfs to jpgs in photo shop using image processor, but the processor only captures the first page of the multiple page documents and when I have been able to convert an entire pdf to jpeg, it creates individual jpg files for each separate page.
    How can I convert the multiple-page pdf file to a single multiple-page jpg file?
    many thanks!

    You have the right idea.
    1.Make each page a jpg file. Pretend they are named Page 1, Page 2, etc.
    2. Create a new file with a page size and res of your jpg files. Let's call this the Master file.
    3, With the Master file appearing on your monitor:
    4. Open Page 1. Click on it in the Layers Panel and drag it over the Master. It will become Layer 1 in the Master.
    5..Repeat Step 4 until you have all the pages, as separate layers in the Master. (Layers 2, 3, etc,)
    6. Save the Master file. It will be a psd file.
    Check Google and learn how to create and use Photoshop Layer Comps. Trust me. It is not difficult.
    Once completed, each time you strike the Forward symbol in the Layer Comps panel you will display the next page.
    Yes, you can go Backward to see previous pages as you view them. too.

  • How do I get all pages of a multi-page PDF form to print in old versions of Reader?  Reader 11 prints all; Reader 10 skips first page

    I'm new to forms creation, so please excuse my ignorance. I've created a 9 page form in InDesign CS6 on Mac OS 10.6.8 and exported it as an interactive PDF. With Acrobat 10.1.10 I've checked that there is no security -- everything is allowed. None of the form fields is required.  I originally had some required fields but made them not required to see if my printing problem would go away.  I enabled the extension that allows versions of Reader before 11 to save data in the form. Page 1 has combo fields, radio buttons, a submit button, and text fields.  The rest of the form has radio buttons and text fields. Some of the people who've tried my form say they can print pages 2 through 9 but not page 1. One of them is known to be using Reader 10. I've tried printing my form with Reader 11 on Max OX 10.6.8 and Reader 11 on Windows 8.1 and seen no printing problems. What have I done wrong?  Is there something about the submit button on page 1 that makes older versions of Reader not willing to print that page?  There's nothing propriety or sensitive on the form so I'll leave it for a while in Dropbox in case someone is willing to inspect it.  It's at
    https://dl.dropboxusercontent.com/u/87784382/Savable_Local_Show_Report_2.pdf

    I've been able to find someone willing to do some testing that I can't do without installing old versions of Reader on my computer.  The surprising (to me) result is that the Submit button causes the problem.  By simply removing the Submit button, Reader 10 is now able to print page 1.  The Submit button was set up to do a "mailto".  I don't know whether other destinations also cause the problem of the page not printing with old versions of Reader.

  • Firefox only prints the first page of several multi-page URL's.

    When I try to print a multi page URL, it only prints the first page and identifies it as Page 1 of 1, instead of Page 1 of x.
    But, IE-8 prints ALL x pages of the same URL perfectly.
    I've noticed this exact same FF problem with certain other URL's.
    This problem is on the current version 14, and dates back to version 9 or before! Any suggestions?
    Has anyone filed a Bugzilla Report? Please see Replies below, and visit:http://forums.mozillazine.org/viewtopic.php?f=38&t=511130&start=15 for more information.

    They gotta fix this. It's been a huge problem for me for more than a year. I''ll defect to Chrome soon if they dont address this bug soon. Printing has been atrocious, even pathetic, i hate to say it. I can only print one page, maybe two if i am lucky. Sometimes, if it prints more than one page, the first page is mostly blank and the formatting of the text and sidebars is completely overlapped and sometimes unreadable. Basically, printing in Firefox is useless - it's a joke. I have to take the URL from Firefox and paste it into Chrome to get a decent print job. Why isnt this bug a higher priority?
    Tags: Firefox cannot print, Firefox printing bug, Firefox only prints one page

  • Buttons do not respond on every page of a multi-page form

    Hello and thank you for your assistance with this rather vexing problem.  I am creating a form with multiple pages in Adobe LiveCycle Designer 8.0 and on each of those pages are various buttons, and each button opens up a different subform (click event makes subform visible).  The problem I am encountering is when I "Preview PDF" the form, or open the form in Acrobat the buttons will only work on the page I click on first.  For example, if I click on a button on page one (untitled subform)(page1), all the buttons on page one work fine, but the buttons on pages 2, 3 and 4 will not work.  If I close the form and reopen it and start by clicking the buttons on page 3 (untitled subform)(page 3) all of the buttons on page 3 work fine, but pages 1, 2 and 4 will not work.  No matter what page I start with to test the buttons, only the buttons on that page will work.  I have tried using check boxes instead of buttons and the same thing happens.
    I cannot upload the actual form I am working on because it contains proprietary information, however I have created a quick sample form that exhibits the same problem as an example.  If anyone could help it would be greatly appreciated.  Please let me know if my explanation does not make sense or if I can provide further information.  Thanks again for your help.  :-)

    It is hard to explain but following change made trick.
    SecondPageSample.presence = "hidden"
    xfa.layout.relayout()
    Good Luck,

Maybe you are looking for

  • CLR to get the SQL Server Data into .CSV File

    Hi, I transformed 10 columns 1000 rows from the source table to 1 column 1000 rows in the destination table by making the comma separated columns ( Just like .. Insert into DestinationTable SELECT col1+','+col2 .... FROM SourceTable Then I want to ta

  • SyncMaster 225BW questions

    The display attached to my new Mac Pro is Samsung SyncMaster 225BW which I originaly attached to the Mac with provided Vga adapter. Since the monitor also is DVI capable, I bought DVI connector am now digital to ATI Radeon HD 2600 XT via Leopard and

  • Getting ready for printing...

    I have a Canon G12 and shoot in RAW format. I know the native aspect ration for this camera in RAW is 4:3. I also know already that the two sizes of finished prints I am interested in are 8x10 and 16x20. After importing the images from my camera into

  • Excel 2013 can't open unexpected error 32809

    I have an Excel macro application written in Windows 7 Office 2007. The application works on 3 PC's recently one PC was upgraded to Office 2013 and the application running on Windows 8 when opening the file in Excel I have unexpected error 32809. Acc

  • I need to know how to back up the contacts on my iphone 3g in case my phone breaks or something, any help?

    Can I back up iPhone contacts to pc? In case my iPhone  is lost, broken or something. Or back up the contacts with iTunes online, is it possible?