Select page range

Hi,
How to select page range and run our functions with the particular pages?
Selva

Hello Hopkins,
I just wanted to tell you, your code is gorgeous! And your very talented!
Everything you create is just an absolute joy to look at. Especially the page range function.
Thanks for your understanding for what me want.
Selva
Here my changes (for your review):
try {
    //assumes document is open
    var docRef = app.documents.item(0);
    var maxPages = docRef.pages.count();
  //provide variable to hold user's response
  var userResponse = dialogWChoices ("Dialog Name", true, "Label here", maxPages);
    //enter call to function that processes all pages
    if (userResponse[0] == 0) {
        myProcess (docRef, 0, maxPages);
     } else {
         var minPageRef = userResponse[1] - 1;
         var maxPageRef = userResponse[2] - 1;
         myProcess (docRef, minPageRef, maxPageRef);
} catch (e) {
alert ("Process Done!\rWith the selected pages.");
//function to process range of pages
function myProcess (docRef, minPageRef, maxPageRef) {
    var thisPage, thisFrame, docOffset;
    //our code start from here
    var myStep = 1; 
   for (var i = minPageRef; i <= maxPageRef; i++) {
       thisPage = docRef.pages.item(i);
       var myTables = thisPage.textFrames[0].tables.everyItem().getElements();
       for (j =0; j<myTables.length; j++){
           if(myTables[j].spaceAfter  + myStep<0){myTables[j].spaceAfter = 0; continue};
           myTables[j].spaceAfter = myTables[j].spaceAfter + myStep;
          } //end our code
//function gets page range or "all" from user
function dialogWChoices (dlgName, cancelIt, dLabel, maxPages) {
    var userCancelled = false;
    var origValue = app.scriptPreferences.userInteractionLevel;
  //make sure that user interaction levels will allow a dialog
  app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
  //create the dialog
  var dlgRef = app.dialogs.add({name:dlgName, canCel:cancelIt, label:dLabel});
  //add a column
  var dlgColumn1 = dlgRef.dialogColumns.add();
    var dlgColumn2 = dlgRef.dialogColumns.add();
    var dlgColumn3 = dlgRef.dialogColumns.add();
  //add widgets for first column
  dlgColumn1.staticTexts.add({staticLabel: "PageRange:"});
  //add widgets to second column
  var radioGroup = dlgColumn2.radiobuttonGroups.add();
    radioGroup.radiobuttonControls.add({staticLabel:"All", checkedState:true});
    radioGroup.radiobuttonControls.add({staticLabel:"Range", checkedState:true});
    //add widgets to third column; put reference into a variable
    var emptyRow = dlgColumn3.dialogRows.add();
    emptyRow.staticTexts.add ({staticLabel: ""});
    var inputRow = dlgColumn3.dialogRows.add();
    var firstField = inputRow.integerEditboxes.add({minWidth:36, minimumValue:1,maximumValue:maxPages});
    inputRow.staticTexts.add ({staticLabel: " thru "});
    var secondField = inputRow.integerEditboxes.add({minWidth:36, minimumValue:1, maximumValue:maxPages});
  //show the dialog and capture the result
  if (dlgRef.show() == true) {
        var firstVal = 0;
        var secondVal = 0;
        var selButton = radioGroup.selectedButton;
        if (selButton == 1) {
  var firstVal = firstField.editValue;
  var secondVal = secondField.editValue;
  } else {
        userCancelled = true;
       dlgRef.destroy();
       app.scriptPreferences.userInteractionLevel = origValue;
    if (userCancelled) {
       throw ("User Cancelled");
  //destroy the dialog; script doesn't get here if user cancels
  return [selButton, firstVal, secondVal];

Similar Messages

  • Trouble printing selected page range as handout

    I am trying to print for a keynote but only want a selected page range and just cannot seem to get it to work. When I go into print and select under the pages tab the "from" button and type the range ( eg 184-189 ) I only get the option of slides with notes or outline. I want to pront as a handout with 2 or 3 sldes per page. The preview shows no pages selectde and it is unable to print.
    I've tried highlighting the slides I wish to print and trying that but to no avail. The silly thing is I did manage to get it to work this way once but now it doesn't seem to work that way. I'm frustrated as I don't want to print the whole presentation off and throw away the sheets I don't need as it seems to defeat the object of page selection. I also don't want to watse ink by having one slide per page.
    Any help will be gratefully received.

    I have this issue with my printer also
    my work around is to delete the pages I dont want printed, save this version as a separate file and the pages I want print out correctly.

  • Add a BUTTON that ONLY prints a selected page range

    Hello,
    I have a 100+ page PDF which has 32 or so 'sections' which are accessible by bookmarks.  I want to add a button that allows the reader to print ONLY the section they are in, i.e. a pre-selected page range that I embed in the button.
    Is this possible?
    If not, is there any other way to do this?  The document was originally created in Word and is broken up by Sections.
    Thanks,
    Chris.

    It's possible using a script, but the user will always be able to edit that pre-defined range, if they wanted to.
    The only option where they can't edit it is by using a script that silently prints the section, but that requires installing a script on the local machine of each user that is going to use the file.

  • Using Acrobat 9 and suddenly there is no selected page range in the print box.   Only selected PDF files or all PDF files.  Am I doing something wrong?  I need to print only three pages from the document

    There is no selected print page range in the print box.  Only selected PDF file and all PDF files.  Any suggestions?

    Well, I looked for where to delete this but didn't see it.
    NEVERMIND; I forced iPhoto to quit and restarted and everything seems fine.
    BTW, I did get one thing wrong. When I looked at both iPhoto libraries with FINDER, the active one and the archived one both showed content as far as file size goes.
    It was because I was viewing the files through Adobe Bridge that it was showing 0 GB's; for whatever reason.

  • Can't select page range to print

    When I use the printer system dialog box, print all pages is the only option.  Print selection, pages, or current page are all greyed out.  Have latest software download installed (printer driver)

    Hello @LimpingSkunk!
    Thanks for posting on the HP Forums!
    I would be happy to provide some help regarding the HP Photosmart C5550 and selecting pages during the print job.  You had mentioned you only get the option to print all pages.  Does this happen when printing any multiple page document or does it happen from specific programs?
    I understand you have the most up to date drivers but the first thing I recommend is to uninstall the HP software. After the uninstall is complete it would be a good idea to perform a disk cleanup in the computer. A disk cleanup will improve computer performance and clear temporary files that may cause issues during the install of software. Once the disk cleanup is complete you should restart the computer and re-install the HP software.
    To uninstall HP software click here: Uninstalling HP Software
    To perform a disk cleanup click here: Performing a Disk Cleanup
    To download the HP software click here: HP Photosmart C5500 Full Feature Software and Driver
    Please post back and let me know if that worked for you!
    Cbert
    I work on behalf of HP.
    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" at the bottom of this post to say “Thanks” for helping!

  • Printing selected page as a pdf in adobe reader

    Hi,
    I have Adobe Reader for the Mac. I'm dealing with pdf documents that are hundreds of pages. If I wanted to save a single page (or several pages), it seems I have to go through an extra step:
    1) print
    2) then select printer
    3) then get warning window telling me to go to applications dialogue box
    4) click ok, go to box
    5) select page range in applications printer box.
    that's a lot of steps. Preview does this in one step (but has other problems). Is there a way of selecting pages and going directly to save as pdf. I know there's no extract page feature like there is in Acrobat.
    thanks for any help,
    jeff

    Not in the free Reader, no.

  • Combining Word Documents - Selecting Pages - Acrobat X Pro

    Hi,
    I am hoping someone can tell me where I can find the setting to be able to do the following action,
    When combining different types of files, I get different behaviour for selecting pages, i.e. the "Preview and Select Page Range" dialog,
    e.g. for a pdf file, in the preview pane, I can navigate through the pages with the buttons at the bottom,
    However, when I try to select the pages in a word, powerpoint etc. document I get a different behaviour,
    As you can see, there are no navigate buttons. The preview also appears to be in "outline" mode, i.e. doesn't show page gaps. Just a continuous preview of the document. This makes it very difficult to actually choose which pages to combine without having to open the document itself and determine the pages I want, i.e. defeating the purpose of having a preview pane at all.
    I had a trial version of Acrobat X Pro, but then we got the full version. I am sure that in the trial version I had the navigate buttons, or at least got the page breaks shown.
    Is there a setting that might have changed?
    What could be going on?
    Thanks

    Hi Bill,
    Yeah, that is my current work around. I open the word document separately, find the pages that I want to combine and enter those into the Acrobat X dialogue box.
    However, that sorta defeats the purpose of having the preview and select pages dialogue box in Acrobat!!
    Futhermore, I am sure it worked in the trial version I had before. So I have a feeling it is a setting somewhere that just needs to be turned on/off.

  • New owner here.  How can I select specific pages of a document found on line and print just those pages.  What I see is the ability to select only 1 page at a time and print that one selected page only.   Thanks much.

    New owner here.  I see that in printing I can select one page and print same.  How do I select numerous pages from a document and print only those selected pages? I would not think that I can only select one page at a time.  Thanks much

    Just change the range as illustrated below.  If you don't see that, click the Show Details button.

  • 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.

  • How do I select a range of values in MySQL using a drop down menu

    Hi,
    I have a database of picture frames that have a value of
    frame width. I want to be able to select a range of values (i.e.
    .50" to 1") instead of each and every value (i.e. .50", .56", .76",
    etc.). I have a drop down menu (mnuWidth) with 5 ranges (see
    attached code).
    Each selection has a value from 1 to 5 indicating the range I
    want to search. In my results page I have let DW set up a recordset
    (see attached code)
    Can anyone tell me how to get this to choose a range instead
    of just the value entered by my menu?
    Thanks in advance.
    Tom

    I have been growing fond of lookup tables. Your lookup table would have your numbers in one column and the values you want returned in the next.
    Lookup table
    item
    Name
    1
    a
    2
    b
    3
    c
    4
    d
    5
    e
    6
    f
    7
    g
    8
    h
    9
    i
    Input table
    input
    Name
    1
    a
    B2 and copied down:
    LOOKUP(A2,lookup::$A$2:$A$11,lookup::$B$2:$B$11)
    Caution: Lookup will return the closest value so it it looks for "10" in this example it will return "i"
    If you don't want to see the error messages from blank inputs, wrap Lookup in IFERROR.
    hope this helps
    q

  • How to: print selected pages, same pages, odd pages on a book?

    hi,
    about book:
    how can I print only pages that I want to?
    Like selected pages, odds pages or only that I want?
    How can I print front-back sheet?
    Thank you

    [Jongware] wrote:
    I don't think it's possible to set the page range of a Book.printPreferences
    Theoretically it ought to be possible. Can't test for myself now; what does happen when you set the pageRange to overlapping sub-files?
    I've just tried it with CS3. It might have been implemented in later versions.
    In the print Book dialogue the page range field is disabled. You cannot enter anything there.
    If you try to do it with a script it says that printPreferences is read only.

  • Printing page range in document with more than one page #1

    I have an insurance application which has 24 pages numbered 1-6 then restarting 1-18.  This is not just the page # at the bottom of the page but the page number that Adobe Free Reader is showing.  When on the last page the top of the screen shows [18] 24 of 24. 
    I want to print the first page 5 which works fine when I print current page or a page range.  Then I want to print 1-12 of the second section which I have tried printing as 7-18.  This gave me the pages numbered 7-18 of the second section.  But if I try printing page 1-12 I get 18 pages or 1-6 + 1-12.
    Any help would be appriciated.
    Thanks,
    Paul

    Change the Preference from using logical pages to physical pages and then select the physical pages.
    You should provide unique names for the page numbers when you apply page numbers to the PDF and you need to fix them if you merge PDFs.

  • Print multiple page ranges based on radio button group choices

    Hi ... I have a PDF that is a combined application form made up of 6 separate forms. On the front page, I have 6 groups of "Yes / No" radio buttons.
    If the radio button for one or more of these groups is selected as "Yes" then when the Print button (on the page) is clicked then the appropriate page ranges will print.
    It is desireable, though not essential, for these to be printed in one print job.
    The Code I have been adjusting to try and achieve the result is below but I have tied myself in knots now and any help would be greatly appreciated:
    Many thanks
    //<AcroForm>
    //<ACRO_source>PrntForms:Annot1:MouseUp:Action1</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: AcroForm:PrntForms:Annot1:MouseUp:Action1 ***********/
    var nButton = app.alert({
    cMsg: "Your selected forms will be sent to your default printer.\n\nIf you require to print to an alternative printer, press cancel and select 'Print' from the 'File' menu.",
    cTitle: "Submit Forms for Printing?",
    nIcon: 1, nType: 1
    // array for button responses
    //var aResponse = new Array("OK", "Cancel");
    if(nButton == 1)
    {    this.print({ bUI: false, bSilent: true, bShrinkToFit: true, nStart: 1, nEnd: 1 });
    } else
    if(nButton == 0)
    {    this.Exit
    var a_app;
    if(this.getField("AppForm1”).value=="Yes"){
        a_app = "1, 1";
    } else a_app = "0, 0"
    var b_app;
    if(this.getField(“AppForm2”).value=="Yes"){
        b_app = "2, 2";
    } else b_app = "0, 0"
        var pp = this.getPrintParams();
              pp.interactive = pp.constants.interactionLevel.full;
              pp.printRange=[[a_app], [b_app]];
              this.print(pp);
    //</ACRO_script>
    //</AcroForm>

    Hi Gilad D
    The 'printRanges.push' function works well on my Mac using Adobe Acrobat Pro XI however when it is used on the systems that the form users will be working on (which runs Adobe Reader 9.4.0.195) the ranges are not pushed to the printer dialogue box and the 'printRange'
    in the dialogue is still selecting the 'All Pages' radio button.
    Is the printRanges.push function a new and non-backwards-compatible function or is my code the problem
    //<AcroForm>
    //<ACRO_source>PrntForms:Annot1:MouseUp:Action1</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: AcroForm:PrntForms:Annot1:MouseUp:Action1 ***********/
    var printRanges = [];
    if (this.getField("RBG10").value=="Yes") printRanges.push([0,2]);
    if (this.getField("RBG1").value=="Yes") printRanges.push([3,18]);
    if (this.getField("RBG2").value=="Yes") printRanges.push([19,27]);
    if (this.getField("RBG3").value=="Yes") printRanges.push([28,38]);
    if (this.getField("RBG4").value=="Yes") printRanges.push([39,42]);
    if (this.getField("RBG5").value=="Yes") printRanges.push([43,54]);
    if (this.getField("RBG6").value=="Yes") printRanges.push([14,16]);
    if (this.getField("RBG7").value=="Yes") printRanges.push([55,56]);
    if (this.getField("RBG8").value=="Yes") printRanges.push([57,65]);
    if (this.getField("RBG9").value=="Yes") printRanges.push([66,71]);
    if(printRanges.length>0){
       var pp = this.getPrintParams();
                pp.interactive = pp.constants.interactionLevel.full;
                pp.printRange=printRanges;
                this.print(pp);
    }else app.alert("No page ranges are selected");
    //</ACRO_script>
    //</AcroForm>
    Any assistance is greatly appreciated.
    Many thanks

  • File Count with selected date range

    Hi,
    Our requirement is to get the file count with selected date by the user from two sharepoint date time controls i.e. dtp1 and dtp2 into the data table. I am able to get the file count of specific folder from Pages library through below code. Now need to get
    the selected date range from two date time picker controls and check with the item created by is within the date range. If yes I need to get the file count.
    So please share your ideas/thoughts to do the same.
    SPList list =
    wikiweb.Lists["Pages"];
                        SPFolderCollection oFolders
    = list.RootFolder.SubFolders["foldername"].SubFolders;
                        DataTable dt
    = new DataTable();
                        dt.Columns.Add("Column1");
                        DataRow dr;
                        if (oFolders.Count
    > 0)
                            foreach (SPFolder oFolder in oFolders)
     if (!oFolder.Name.Equals("Forms"))
                                    dr
    = dt.NewRow(); 
    dr["Column1"] = oFolder.ItemCount.ToString();
    dt.Rows.Add(dr);
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi,
    I have modified the code as below
    if((DateTime)(oFolder.Item.File.TimeCreated>dtFromDate.SelectedDate)&&(DateTime)(oFolder.Item.File.TimeCreated<dtToDate.SelectedDate))
    But still it is throwing the error.
    Please share your ideas on the same.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

  • Reset data picker page item by selection page item in Apex

    Hi,
    Need to create a report based on date ranges and for this created a interactive report and two page item datepicker fields P15_fromdate and p15_todate. Report works fine with this criteria.But user wants one more field quarter(P15_quarter), When they select the quarter the range values has to get reset and as to get applied to report.
    Issue here is unable to find a way to set the page range item values based on the quarter field selection
    Need help how to reset the page item fields.
    Thanks in advance.
    Thanks,
    Sandeep

    Ligon,
    You're right to think this is pretty laborious stuff. A co-worker wanted to do the same, to make sure users didn't lose a change when clicking Cancel. I suggested he look at calculating the query checksum before and after, which he tried. But it got very cumbersome very fast and he ended up dropping the idea. He's fairly new with Apex, but he's also a quick study, so it's not like he's a novice coder.
    I don't have his implementation details anymore to even share with you.
    Sorry I couldn't be more help.
    Good luck,
    Stew

Maybe you are looking for

  • Error while deploying an Agentry application on SMP 2.3 Server

    Hello Experts, I am trying to deploy a customized SAPWM application on the SMP 2.3 server. I am referring to the tutorial maintained at the following URL :http://scn.sap.com/docs/DOC-43353 I have zipped the contents of the application folder (under S

  • Sound no longer working after graphics card installation

    Okay, so my problem is: I recently added a graphics card to my windows 8.1 PC. The card itself works fine (a GTX 750Ti), but since installing it my sound no longer works from either port. Things I have already tried: Rebooting (obviously) Taking the

  • User-exit/BADI for version tab in ME22N

    Dear Friends, I have a requirement pertaining to user exit/BADI. In ME22n in version tab when ever we change any data of PO the Version Completed check box should be checked. Please let me know about the User Exit to be used and few lines of Pseudo c

  • Regarding workflow agent index refresh

    Hi Friends:    I'm using the Fm RH_TASK_AGENTS_INDEX_REFRESH to refresh the agent index on a given task no.   Can anyone tell me that in which table this log gets stored. Also please give me the name of table in which the agent assignment will get st

  • HT201317 Can my friends add photos in my shared Photo stream folder?

    I shared a photo stream with some friends. they are unable to add photos into the album. Is this functionality available like that in dropbox where everyone in the shared folder can add data in?