Button to extract pages

myexportFunc = app.trustedFunction(function(){
////Get Naming Convention
var cRtn = app.response('Enter naming convention for section:');
////Save to current location. Get path of current doc
var testing = this.path;
var test = testing.split('/');
var thepath = '';
    for (i = 0; test.length -2 >= i; i++)
          thepath =  thepath + test[i] + '/';
////Extract Pages
    for (p = 1; this.numPages >= p; p++)
var pgno = p;
///pgno = pgno + 1;
                    if (pgno < 10) {
                              var pgno = '0' + pgno;
                    } else {
                              var pgno = pgno;
          var newname = cRtn + pgno + '.pdf';
            this.extractPages({
                         nStart: p,
                         cPath: thepath + newname
var myDoc = app.newDoc();
          // import icon (20x20 pixels) from the file specified
          myDoc.importIcon("myIcon", "/adsROP/1 COMMON/Application Settings/Scripts/assets/Untitled-1.pdf", 0);
          // convert the icon to a stream.
          oIcon = util.iconStreamFromIcon(myDoc.getIcon("myIcon"));
          // close the doc now that we have grabbed the icon stream
          myDoc.closeDoc(true);
          // add a toolbutton
          app.addToolButton({
                    cName: "myToolButton",
                    cLabel: "Extract Pages",
                 oIcon: oIcon,
                    cExec: "myexportFunc()",
                    cTooltext: 'Extract Pages',
                    cEnable: true,
                    nPos: 0
The button successfully is added. The function fires, etc....
The extract pages function run alone works as is.
I get the following error: 
RangeError: Invalid argument value.
Doc.extractPages:30:Doc 54d3a00myToolButton:Exec

I get the error:
RangeError: Invalid argument value.
Doc.extractPages:30:Doc 54d3a00myToolButton:Exec
I am running this from the console currently, but I did need to make the extract pages to be privileged.
myexportFunc = app.trustedFunction(function(){
////Get Naming Convention
var cRtn = app.response('Enter naming convention for section:');
////Save to current location. Get path of current doc
var testing = this.path;
var test = testing.split('/');
var thepath = '';
    for (i = 0; test.length -2 >= i; i++)
          thepath =  thepath + test[i] + '/';
////Extract Pages
    for (p = 0; this.numPages >= p; p++)
var pgno = p + 1;
                    if (pgno < 10) {
                              var pgno = '0' + pgno;
                    } else {
                              var pgno = pgno;
          var newname = cRtn + pgno + '.pdf';
app.beginPriv();
            this.extractPages({
                         nStart: p,
                         cPath: thepath + newname
app.endPriv();
var myDoc = app.newDoc();
          // import icon (20x20 pixels) from the file specified
          myDoc.importIcon("myIcon", "/adsROP/1 COMMON/Application Settings/Scripts/assets/Untitled-1.pdf", 0);
          // convert the icon to a stream.
          oIcon = util.iconStreamFromIcon(myDoc.getIcon("myIcon"));
          // close the doc now that we have grabbed the icon stream
          myDoc.closeDoc(true);
          // add a toolbutton
          app.addToolButton({
                    cName: "myToolButton",
                    cLabel: "Extract Pages",
                 oIcon: oIcon,
                    cExec: "myexportFunc()",
                    cTooltext: 'Extract Pages',
                    cEnable: true,
                    nPos: 0
This works. I just need to adjust the for loop to end at the last page rather than trying to go on to a page that does not exist.

Similar Messages

  • Using a Button to extract pages and submit form.

    I have a five page document.   The last page is a letter that gets emailed by itself.  Also want the account name and number to flood into the subject line.
    I can get this to work if I don't extract the other four pages,  and use the built in submit form function in the button.  But can flood the value from the account name and number fields.
    Function needed for Adobe Pro X and would probably use with Live Cycle in the near future.
    Thanks!

    OK. In that case you can use something like this as the submit button's MouseUp script:
    var newDoc = this.extractPages(this.numPages-1);
    newDoc.mailDoc({cTo: "[email protected]", cSubject: "Subject line"});
    This code will extract the last page of the document and then attach it to a new email message with the specified address and subject line, which you can change of course.

  • Extracting Pages and Error Message

    My Adobe works great. I couldn't ask for a better product. However I have received a PDF file from a customer and I need to extract pages and insert them into another PDF. When I go to extract the pages I get an error message "Adobe Acrobat 9.0 has encountered a problem and needs to close. We are sorry for the inconvenience." and them the program shuts down. It is only with this one document and I can't find much information as to why this is happening.  Any ideas?
    Thank You!

    This sounds like an issue with the sort order display in Windows Explorer. If you use the File > Open dialog in Acrobat the files should display correctly.
    If you're previewing the PDFs in Windows Explorer try clicking the Name button underneath the toolbar to change the sort order from ascending to descending, then a single click again should display them correctly.

  • Acrobat crashes when extracting pages

    Version Adobe Acrobat X 10.1.12
    When extracting and emailing pages from a pdf multiple times, Acrobat crashes.  Here is the process:
    1. Open pdf
    2. Tools -> Pages -> Extract
    3. Select any number of pages -> delete after extracting -> Yes at prompt
    4. In the extracted page(s) pdf, Share -> Send Files -> Attach to Email -> Attach
    5. Default email app opens -> Send email
    6. Close extracted page(s) pdf without saving.
    7. Go back to original pdf
    8. Try to repeat steps 1-6.
    The Acrobat crashes every time at step 4 on the 2nd extraction and email.  As soon as the share button is pressed (or using File -> Attach to Email), Acrobat crashes with the below error code.
    I have tried multiple different pdfs from different sources (i.e. downloaded from the web, scanned from a printer, generated from a word doc, etc.) as well updating Acrobat, uninstalling and re-installing (using the cleaner tool in between) and repairing install.  The issue happens on multiple machines, all running Win 7 Pro, and there are no add ins installed.
    Problem signature:
      Problem Event Name: APPCRASH
      Application Name: Acrobat.exe
      Application Version: 10.1.12.15
      Application Timestamp: 54084723
      Fault Module Name: Acrobat.dll
      Fault Module Version: 10.1.12.15
      Fault Module Timestamp: 540856d6
      Exception Code: c0000005
      Exception Offset: 00893320
      OS Version: 6.1.7601.2.1.0.256.48
      Locale ID: 1033
      Additional Information 1: 0a9e
      Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
      Additional Information 3: 0a9e
      Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

    My scanner cables never become disconnected, by the way (as the 2nd error message suggests).

  • How to extract pages form Adobe Reader X

    How do I extract and save an individual page from a multi-page PDF file? In Adobe Reader X
    The security of the PDF is not blocked.

    You can extract pages in Reader X, just not the same way you would do it in Acrobat.
    This works providing there are no security restrictions against printing from the document.
    You need to be able to print directly to PDF.
    Open your document in Reader
    Click on the Print button
    Choose Adobe PDF printer as the printer you want to use.
    Choose Current Page under Pages to Print, if you want to 'extract' the page that you are currently viewing OR
    Select Pages and enter the range of pages that you'd like to 'extract'
    Print and save the print job to wherever you'd like it to be saved
    Rejoice

  • Extracting Pages and naming file names of pdfs

    I need to be able to extract pages from a large file to create seperate pdf documents for each page. When I do this the file name for each page is for instance "Medical Records 1.pdf"; "Medical Records 2.pdf".... Medical Records 11.pdf"
    Here is the problem. When I go to review them in order the page (document) that is numbered 2 will not be after "1" but rather just before "20" and "3" is out of order and just before "30". When the number of pages is 600 plus this is a problem. This would not happen if there was a leading "0" before the "2" , "3", "30" etc. This happens with single digits and double digits as well since the page numbers are in the hundreds.
    Any ideas on how to correct this issue? Thanks in advance.

    This sounds like an issue with the sort order display in Windows Explorer. If you use the File > Open dialog in Acrobat the files should display correctly.
    If you're previewing the PDFs in Windows Explorer try clicking the Name button underneath the toolbar to change the sort order from ascending to descending, then a single click again should display them correctly.

  • How to remove NO Button on dialog page

    Hello friends,
    i want to remove no button on my dalog page how to do? my code is below , below this code still i can see on dialog page no button.. can any one help me out..
    OADialogPage dialogPage = new OADialogPage(OAException.WARNING,descMesg, null,"" ,"" );
    dialogPage.setOkButtonLabel("ok");
    dialogPage.setOkButtonItemName("YesButton");
    dialogPage.setOkButtonToPost(true);
    dialogPage.setPostToCallingPage(true);
    System.out.println("Entering To Delete");
    pageContext.redirectToDialogPage(dialogPage);
    Thanks
    krish.

    You can specify your own button bar with the required buttons.
    Extract from Developer's guide.
    The setFooterNestedRegionCode and setFooterNestedRegionApplicationID methods in the OADialogPage class have been deprecated.
    If you use the standard OK/NO buttons provided on the dialog page, you do not need to make any changes.
    However, if you are using the OADialogPage.setFooterNestedRegionCode and OADialogPage.setFooterNestedRegionApplicationID methods to render customized buttons under the footer region, you must update your code to use the new method OADialogPage.setPageButtonBarRegionRefName instead. This new method lets you set a reference to a page button bar region, built declaratively with OA Extension. You can add any number of custom buttons to the page button bar region. OA Framework renders the page button bar region under the footer. Adding your custom content to a page button bar region allows the page buttons to be rendered and positioned in the proper places specified by the latest UI standards. To render the Return To navigation link under the footer, use the existing setReturnToLinkLabel and setReturnToLinkURL methods in OADialogPage.
    To render a nested region, created with OA Extension, under a dialog page header, use the new OADialogPage.setHeaderNestedRegionRefName method.

  • Creation of new button on same page after insert command

    Hello All,
    I have an application running on apex.oracle.com where my workspace name is shruti_work,username is [email protected] and password is buwigi. The application name inside this is "app2"
    I am trying to achieve one functionality there but unable to get it so felt like seeking an help from experts here. I have two forms there one page1 form which is simplly made on an html region with go button which is navigating the page 1 items value to page 2 but simply passing their address witout updting the database table.
    In Page 2 i created page on a table or view, which made some extra buttons which i dont want like applychanges ,delete button, cancel button. I created a create button even which is updating my database with insert sql command. What i am seeing is after my create button is pressed i got navigated to same page 2 which i want to but the applychange button, cancel and delete button got appeared. I dont get the idea why it is so. i have checked the buttons even i didnt found anything there.
    All i want is when i press create button in page 2, my database get update and at the same page (2) a new button get appears which i have to use for other things. Approaching to this solution i created a button with giving databse action update and condition to this button "value of item in expression 1 is not null" and in expression 1 i passed p2_id...... but my new button is not getting created.
    Any help on this?

    Hi Jeff,
    I dont want applychanges button and delete button in my page 2. But when i created form on a table or view this but got created and i cannot delete it even. When i am navigating my page from page 1 to page 2 and filling the fields in page 2 and clicking create button, at that time i want after updating my table and running my plsql process which i have created which you can see in page processing, my button at same page get generate which i will use to navigate to other form. This button which i want to generate after clicking my create button will be meaningful only if my record get inserted in table. so that is why i want it at that time.
    I dont want any report so i am not creating form on a table or view

  • How to make the common control button for all pages in TABCONTROL​?

    Dear all,
               I'm using TABCONTROL for my application. I'm having STOP and SAVE control. I have to show this button to all pages  in TABCONTROL.. How do i make it?
    Kindly help me?..
    Regards,
    Srinivasan.P
    Solved!
    Go to Solution.

    Hi srinivasan,
    If you want to keep "Save" and "Stop" common, Why do you want to keep them on Tab control? Is your tab control taking entire space on Front panel? If so, you can have SAVE and STOP on other vi, and you can call this vi (MODAL).
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Can I add Action button on each page of my pdf document

    I have created  many power point slides with an action button on each slide that allows the user to click to display a video clip.   I would like to create a pdf document of this and replace each of my action button in ppt with an action button that works in Acrobat.
    I noticed that action buttons can be added to forms, but I want to be able to add an Action Button on each of my ppt slides to start playing a video clip (each slide will have a different video).
    I would like to do this using any coding method (i.e. Javascript, VBA, C , etc).   I think acrobat uses Javascript.
    The reason, is that I want to display my power point slides on an IPad and they don't support hyperlink in power point.   I believe IPad does suppport the full acrobat capabilities.
    Can this be done ??  
    Any suggestions where to start ??
    Thank You,
    G

    NO problem creating the buttons and then playing this back in Acrobat. Works great.
    However, unfortunately, none of the PDF viewers for the iPad support playing movies.   So playing it there won't work :(.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Sat, 28 Jan 2012 11:00:47 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Can I add Action button on each page of my pdf document
    Can I add Action button on each page of my pdf document
    created by gw70115<http://forums.adobe.com/people/gw70115> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4171109#4171109

  • How To Create On Submit Button For Master_detail Page ?

    I have adf page that is master And detail view.
    i want to have one submit button for master and detail block

    Duplicate of  How To Create On Submit Button For Master_detail Page ?
    Please don'r post your question multiple times.
    Timo

  • How to create a radio button on OA Page using Personalization

    I am trying to create a radio button on OA Page using Personalization. The item style , I can see is Message Radio Group.
    How to create Message Radio Button and bring them under one group.
    Thanks

    You should use jdev to define a radiogroup and radio buttons under that, wrap that definition inside a stackLayout in jdev, use personalization to add a stackLayout and extend the region which you had created earlier in jdev.

  • How to add new button in Customized page....

    Dear All,
    I need to add new button to the page button bar in the UI page.I tried like this in the controller but still i can not get output:
    OAPageButtonBarBean oapbb = (OAPageButtonBarBean)oawebbean.findIndexedChildRecursive("OrderPageButtons");
    OAButtonBean cancelButton = (OAButtonBean)createWebBean(oapagecontext, OAWebBeanConstants.BUTTON_BEAN,
    null, "cancelButton");
    cancelButton.setText("Cancel");
    oapbb.addIndexedChild(cancelButton);
    Is there anything i missedout?
    TIA

    what you are doing incorrectly is
    trying to get the handle to the OAPageButtonBarBean.
    This is a named child of the parent bean(OAPageLayoutBean), and what you are trying to do is find it as a indexed child, this should give you a nullpointer excp in this line oapbb.addIndexedChild(cancelButton);
    since the handle should be null.
    to get the handle to OAPageButtonBarBean, use some like this
    pageContext.getPageLayoutBean().getPageButtons();
    and then add buttons to it.
    Thanks
    Tapash.

  • How to use a back button in action pages?

    Hi all,
    I have created a user login page,home page and user profile page.
    If the user provide correct username and password in the login page he will be taken to home page.
    In the home page he will be having his username and a link to view his profile.
    When the user click on the link "My Profile(user profile)" he wil be taken to that page.
    In my profile page the user can edit only his firstname,lastname and password .
    On the user profile page i have placed a Back Button(using javascript: on onclick event i have used history.back()) to go back to home page after editing his profile.
    If the user edit his profile for n-number of times then atlast if he wants to go back to home page-then he wil cilck the back button.
    Now the problem occurs like the back button not going to home page and it simply going back with the edited history.
    How to use a back button in action pages; without repeating the actions done on the page; how to redirect to the users home page?
    I simply used the hyperlink in userprofile page to go to home page but when i click onit it is displaying blank home page.
    I'm using hibernate orm mapping; cflogin and cflogout tags.
    Any help appreciated,
    Chandru P

    chandrup wrote:
    Hi Dan,
    Dan Bracuk wrote:
    Use an anchor tag.
    I simply used the hyperlink(<a href="home.cfm">Home</a>) in userprofile page to go to home page but when i click onit it is displaying blank home page.
    I can see your problem. You may use javascript:history.go(-1), javascript:history.go(-2), ..., to go back one page, two pages, and so on. But how does one go back an arbitrary n pages? The link href="home.cfm" isn't a good solution for the browser. It makes a new call to the server which, as you may have discovered, can overwrite all the changes made at the browser. 
    You should use the Javascript variable history.length. If you open n links in succession, starting from page0.cfm, then the browser holds the value of history.length as n. So, experiment with something like
    <a href="javascript:history.go(-history.length)">Go home</a>
    or
    <a href="javascript:history.go(-history.length+1)">Go home</a>

  • Data loss popup for cancel button on overview page

    Hi Experts,
    Data loss popup generally appears on UI, when i try to navigate with out saving the changes. This is a standard SAP behaviour.
    But, i come across the requirement where this data loss popup should also appear on clicking the 'Cancel' button on overview page on UI.
    I understood that, this popup will be triggered by the methods ON_BEFORE_WA_CONTENT_CHANGE & IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT of the window impl class.
    Please suggest how can i make this popup work in case of Cancel button as well.
    Thanks....

    Hi bkvs,
    Usually when you click the "Cancel" button that means you don't want to save your entry... hence displaying the dataloss popup doesn't make really sense to me. However, you may want the user to confirm that he really wants to cancel.
    So I would suggest to redefine the EH_ON_CANCEL method of your view, to display a simple confirmation popup before you actually cancel everything. This wiki will show you how to do it:
    Creating popup message in webclient UI - CRM - SCN Wiki
    Regards,
    Nicolas.

Maybe you are looking for