Javascript: Wait for a redirect to complete - creating multiple PDF's

Hi!
Here is the code that I am using to try to generate multiple reports from javascript. how do I wait for the redirect to complete (ie. generate the PDF) before redirecting to generate the next PDF?
In the code the "F106_" are application level items.
I get have been able to get the very first or the very last PDF but none of the other PDF's.
<script type="text/javascript">
function f_DoReport() {
  for (i = 2; i <= 3; i++)
     for (j = 1; j <= 4; j++)
         var rgn = '0' + i;
         var dst = '0' + j;
         var vurl = 'f?p=&APP_ID.:30:&SESSION.:FLOW_XMLP_OUTPUT_R27022113101536736_en-us:&DEBUG.::';
         vurl += 'F106_RPT_REGION,F106_RPT_DISTRICT:' + rgn + ',' + dst;
         redirect(vurl);
         alert('rgn: ' + rgn + ' dst: ' + dst);
</script>Please let me know if I am going down the wrong path here. :D
As always thanks for your time and help!
Dave Venus

A few questions…
Do you want a script that works with just the active document and you are going to run 300+ times? If so then this may do…
#target illustrator
function artboardsToPDFs() {
     if (app.documents.length = 0) {
          reurn;
     } else {
          var docRef = app.activeDocument;
          var docName = docRef.name;
          var baseName = docName.replace(/.ai$/,'');
          var dF = docRef.path.fsName;
          var aB = docRef.artboards;
          var pdfOpts = new PDFSaveOptions();
          pdfOpts.pDFPreset = '[Press Quality]';
          for (var i = 0; i < aB.length; i++) {
               var numb = (i+1).toString();
               pdfOpts.artboardRange = numb;
               var pad = aB.length.toString().length;
               numb = zeroPad(i+1, pad);
               var pdfFile = File(dF + '/' + baseName + '_' + numb + '.pdf');
               if (!pdfFile.exists) {
                    docRef.saveAs(pdfFile, pdfOpts);
               } else {
                    var rPDF = confirm('File: "' + pdfFile.name + '" already exists…\rDo you wish to replace?',false);
                    if (rPDF) {
                         docRef.saveAs(pdfFile, pdfOpts);
                    } else {
                         continue;
artboardsToPDFs();
function zeroPad(n, p) {
  var t = n.toString();
     while (t.length < p) {t = '0' + t};
  return t;
Do you want to pick a folder of all the illustrator files? If this is the case I would need more info and it would take longer…

Similar Messages

  • Waiting for scheduling job to complete. Job ID...and it never completes

    I have created my first Publication. It's a pretty basic single source document, single Dynamic Recipients list publication.
    When I run it in Test mode (I haven't tried it in non-Test mode yet), the document(s) are never delivered.
    When I view the Log File, everything looks fine. The second and last entry in the log says
    "- The global delivery rule for this publication was met; publication processing will now begin."
    The Status Message I see in the Publication History is:
    "Waiting for scheduling job to complete. Job ID:3,879, name:Unviewed Invoices Report (Copy), kind:CrystalReport in Pending state (FBE 60509) [0 recipients processed.] "  and it never changes. I've tried this several times, creating new publications with the same source documents, and the same thing always happens.
    Any help would be appreciated.

    All of the servers were configured correctly.
    It turned out to be my source document, a report, had some field in it that BOE didn't like.
    I removed a bunch of fields and added them back, one by one, and couldn't make the error occur again.
    Go figure.

  • SHUTDOWN: waiting for active calls to complete.

    Hello,
    environment is HPUX 11.23, Oracle Version is 9.2.0.5
    We had an ORA-600 error yesterday. We reported that error to the support and were suggested to install patch 9.2.0.8.
    However i have one question. As you can see from the output in the alert-logfile it took a very long time to shutdown the instance using the immediate option:
    Sun Nov 9 17:33:58 2008
    Shutting down instance: further logons disabled
    Shutting down instance (immediate)
    License high water mark = 454
    Sun Nov 9 17:39:07 2008
    Active call for process 3991 user 'oracle' program 'oracle@xyz (TNS V1-V3)'
    SHUTDOWN: waiting for active calls to complete.
    Sun Nov 9 17:50:36 2008
    ALTER DATABASE CLOSE NORMAL
    Is there anything one can do in such a situation to speed up the shutdown of the instance ?

    Rajabaskar Thangaraj,
    Oracle database has a job facility and a streams/advanced queuing facility.
    These facilities are possible by setting up a few ancillary processes.
    Those parameters govern the number of processes.
    Setting them to 0 will disable the facility completely.
    As you alter the parameter in memory, as you as you have bounced the database, it will be back to the value in the spfile and the facilities will work again.
    Disabling them is especially useful when you the facilities are frequently used, ie you have a job running every 30 seconds.
    In the past, on several databases, this was the only way to allow a shutdown immediate.
    Hope this helps,
    Sybrand Bakker
    Senior Oracle DBA

  • I tried to import 2 photos from an email. The photos are now on iPhoto, however, when I try to close iPhoto or turn off my computer, I get a notice that says, "Photos are being imported to the photo library. Please wait for the import to complete."

    I tried to import 2 photos from an email to iphoto. The photos now appear in iphoto as the latest imports, However, when I try to close iphoto or log off of my computer, I get a message box that says, " Photos are being imported to the photo library. Please wait for the import to complete."
    I can't get out of iphoto or log off of my computer, or turn the computer off. How do I stop the import or log out of iphoto???

    Try Force-quit from the Apple-menu to close iPhoto.

  • Trying to download a program and get "Waiting for other installations to complete"

    Trying to download a program and get "Waiting for other installations to complete"
    there are no other instalations going on that I know of Please help

    That is for your and your Mac's protection; you need your administrator password to download/install things.

  • Microsoft Excel is waiting for another application to complete an Ole actio

    When I access Data Manager, I get the error message: "Microsoft Excel is waiting for another application to complete an Ole action."  When I click OK, I get another error: "Cannot download the dimension list from server.  Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."  It never used to happen until recently.  I don't know what to tell the IT guys to do.  Thanks.

    This is a known error in V5. I have had this error at almost every V5 customer.
    The following solution (got it from support) solves it permanently.
    Changes have to be made to the outlooksoft.config file and the connectionstrings in tblappsetinfo. Be sure to restart the server(s) after applying these changes.
    1. In outlooksoft.config file of x:\OutlookSoft\Websrvr\bin folder on the web server change the following line:
    <add key="Database_AppServerDBConn" value="Server=<servername>;Database=AppServer;Trusted_Connection=True;"/>
    to
    <add key="Database_AppServerDBConn" value="Server=<servername>;Database=AppServer;Trusted_Connection=True;pooling=false"/>
    Please note that where I have <servername> you should put the name of your server ****
    Also, add the pooling=false; to every connection string in tblappsetinfo.
    I am sure this helps,
    Regards,
    Alwin Berkhout

  • Installer keeps waiting for other installations to complete my downloads.  is this normal?

    I downloaded a microsoft remote desktop application and tried to download my office mac and the installer keeps saying waiting for other installations to complete.  So i thought i needed a restart and the installer won't shut down either.  is this normal?

    Immediate problem solved. After force quitting the Software Update app., iPhoto 9.2 appears to have been successfully installed and functional.  Unable to say if future S/W updates will encounter any problems. Thanks for all consideration. Item closed.
    Aubrey

  • Does WPF waits for GPU present to complete?

    I'm testing how frequently WPF display can change when I have one window per monitor. My frame rate isn't amazing, and using xperf and GPUView it looks like WPF prepares both windows and then calls "Present packet" on both at the same time, and
    waits for both to complete before moving on to send the next frames to the video card. I think my frame rate could have been faster if WPF didn't wait for the present to complete on both displays. When I run two WPF processes, each with one window on
    one monitor, the present packets are independent, so parallel processing is more efficient and the frame rate is higher.
    Did anyone observe the same behavior? Is there a flag I can set to make the WPF windows of one process more independent? 

    Hello Shir Oren,
    I'm confused about those monitors, do you mean you have a computer with a few monitors?
    Then "When I run two WPF processes" can you briefly introduce it here? Different applications on different monitor? Do you actually mean thread but not process here?
    Actually WPF can take advantage of both Hardware and Software Rendering Pipeline, for details please refer to MSDN article:
    https://msdn.microsoft.com/en-us/library/bb613578(v=vs.110).aspx
    I'm not sure whether there is a flag you metioned but I haven't found it at this time. So I recommend you focus on the exist WPF render tiers from here
    https://msdn.microsoft.com/en-us/library/ms742196(v=vs.110).aspx to consider raise your performance.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Batch create multiple pdf's while using epilogue.ps for setting initial view and opening bookmarks

    Hi,
    I'm trying to batch create multiple pdf's from word files, and use the epilogue.ps file for setting the initial view and opening the bookmarks panel, but i keep getting no satisfying result.. i'm probably missing something fundamental.
    I've read some forum posts and adobe help posts explaining this, so i'm pretty sure this would be possible?
    Reference:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7f0f.w .html  see advanced panel options
    http://help.adobe.com/en_US/acrobat/using/WS58a04a822e3e50102bd615109794195ff-7f14.w.html
    System: Windows 7
    Acrobat: Acrobat X professional
    i've searched for and found a way to overwite the epilogue.ps file and have inserted the following:
    %  Insert your custom PostScript here...
    [ /PageMode /UseThumbs
    /Page 1 /View [/Fit ]
    /DOCVIEW pdfmark
    After that i checked my Adobe Acrobat preferences, and in the categorie 'Convert to Pdf' i selected 'Microsoft office word' in the select area 'Converting to pdf'.
    Clicked 'Edit settings' to allow creating a joboptions file (field: 'adobe pdf settings') which has the option 'Use epiloque.ps and prologue.ps' checked in the advanced section.
    So now i thought i would have everyting setup to create my pdf's, however, my view isn't changed to fit, nor are there any bookmarks or in this case thumbs (i used /useThumbs) visible.
    Did i miss something obvious? Is there a better way to test this? Any help would be appreciated!

    i like it about that ok in how to open my site

  • Is there an ADOBE plugin for MS Project 2010 to create Dynamic PDF files?

    I wonder if there exist any ADOBE plugin for MS Project 2010 to create Dynamic PDF files?

    We are not going to use form fields. An employee is going to create large projects in MS Project 2010 and want to share his projects with other employees. So the need is just a viewer. So I guess we need to check out all the third part MS Project Viewers which is out there. Thanks for your answers guys!

  • Create multiple PDFs from multiple files

    Hi everyone
    I'm trying to use the "Create multiple PDFs from multiple files" function in Acrobat 9 Pro (version 9.4.6) to create about 100 PDFs from InDesign CS5 files. Theoretically this would do the trick for my purpose. BUT: When running the function, it does not use the CS5 InDesign (version 7.0.3), but tries to open the files with InDesign CS3. Of course this does not work. We, as a professional working agency, have installed CS3, CS4 and CS5. Even with making the InDesign CS3 .app invisible an pushing it into the garbage bin during the process did not work. Acrobat still wants to access InDesign CS3. It is not possible to downgrade the files to CS3 files, for there are special (i.e. interactive) functions which only work in CS5. It would be more work than creating the PDFs manually, anyways.
    Does anyone have similar issues? Any ideas how to solve the problem?
    Thanks in advance.
    Thinka

    OK, cool, I found one, which seems to work just fine.
    http://www.kahrel.plus.com/indesign/batch_convert_cs3.html
    found here:
    http://forums.adobe.com/message/3712434#3712434
    Thanks for the hint!

  • Export to PDF - Can a single report (rpt file) create multiple PDF files using the export command?

    Post Author: markeyjd2
    CA Forum: Exporting
    Greetings forum members,
    My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
    In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records.  When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
    What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record.  The file names would be based on the table's primary key.
    Is this possible?

    Post Author: Micha
    CA Forum: Exporting
    Hi,
    you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
    Here's an abstract of the ASP code I use:
    First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
      oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
    Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
    Micha

  • Waiting for Sub Process to complete

    Hi,
    Below mentioned is my requirement:
    1. Main process begins
    2. Copy a tar file from a source directory to target directory.
    3. Call a sub-process to untar the file (using MKS tool kit utility from command prompt).
    4. sub-process ends
    5. Work on the folders (untared) by applying rules.
    6. Main process ends.
    When I call sub-process like
    main() // main method
    // calling sub-process
    Process p = Runtime.getRuntime().exec(tar -xvf C:\\Source\\ -C C:\\Target);
    p.waitFor();
    // calling rules
    rule("C:\\Target"); // private method to perform validation on the untared files located in Target folder.
    //main method ends
    The program gets stuck up here.
    The file size to untar is small (1MB). But, after some time, when I kill the main process, I could see sub-process completing its task.
    Can you any one suggest me to know the sub-process completion, so that I could call my rules()

    I f you read the documentation for exec() and Process carefully you will find that when you an exec() a process, pipes are created back to the main process for the stdout and sterr of the sub-process. Those pipes have a finite size and when full the sub-process will block, hence waitFor() will wait forever.
    You need to create threads to drain stdout/stderr of the sub-process, or else re-direct the subprocess output (start a shell to run the actual command) so that the pipes won't get full and block.

  • Waiting for a Job to Complete

    Hi,
    How would people suggest waiting for a background process (a job submitted using APEX_PLSQL_JOB) to complete.
    I'm thinking of having an On Demand that can query the job status and then calling this from a piece of JavaScript which polls periodically (e.g. every 30 seconds using the setTimeout function).
    Does anyone have any pointers to something more elegant?
    Many thanks,
    Gareth.

    Hi
    Interesting one this, check out this link [http://www.oraclequirks.com/]
    Half way down the page on the left there's a link titled 'Yocoya's Flash Progress Bar Indicator Live Demo' that you might find useful.
    Cheers
    Ben

  • Waited for parent session to complete

    Hi ,
    i have a situation , where i have to put run scenarios in a ODI Package
    let me explain
    package1 --- scen1-----> scen2------> scen3
    package2 ---- scen4-----> scen5--------> scen6
    package3 ----- scen7----> scen8--------> scen9
    now i have to build a main package , where i have to call above all packages
    like
    MAIN PACKAGE :
    package1_scen-------> package2_scen---------> package3_scen
    now , i have to wait for pacakge 1 and all scenarios inside package1 to complete before package2 started and same thing for package3
    i tried with odiwaitforchild session , and running packag21_scen, package2_scen, package3_scen in synchronous mode
    but when i started the main package all scenarios executed simultaneously.
    can any one suggest how to achive this .
    Edited by: 916710 on Mar 1, 2012 1:30 AM

    i tried , but no help
    my requirement is
    i have to load first stage(pkg) -----------> diemnsion(pkg)------------> fact(pkg)
    and in stage i have multiple files to be loaded into stage tables , which we created as separate packages
    so let stage_pkg have 10 scenarios , so i have to wait all 10 Scenarios of stage(pkg) to complete before diemnsion(pkg) will start execution.

Maybe you are looking for

  • Recover Deleted Boot Camp Partition

    Hello, A week ago I tried to delete Ubuntu from my Windows 8 Boot Camp partition on my MacBook. However, after the process I couldn't boot Mavericks anymore. When I finally got Mavericks to boot, my Windows partition became unbootable. After running

  • HT201184 how do i change network name?

    How do i change my network name?

  • QM 9 not record anything

    I have installed QM on UCS server, Setup Configuration Setup is done. I have assign phones to user in Record Server Configuration. User, Team, Group in Personnel is created (non-AD) and configured the workflow to record all call. I am able to access

  • Best way to recreate iPhone album in iPhoto?

    My wife's 4S (running IOS6) has about 500 photos in the camera roll. These have over time been synced to iPhoto but she kept them on her phone also. We'd like to organize them in an iPhoto album so it can be managed from the Mac and get them out of h

  • Smartforms - new page command at loop

    Hi @ll, I`ve created a loop over an internal table in which I have insert a command to go to next page. The command is being called correctly but I don`t get data on the next page. I would expext that the loop goes on with the next record. Currently