4 Replies Latest reply on Feb 9, 2010 3:26 AM by Adobe-InDesign CS4

    Error while loading PDF Preset file

    FarzanaArethwala Level 1
      Dear All,

      I am trying to create a PDF of the InDesign Document after my process. For that I load the preset file generate the PDF and unload Preset file from the server. On this it gets removed properly from the temporary folder also.
      Problem is when I run the process second time using the same preset file InDesign Server throws an error "This file is already open by another user or another application. This file may be stored on a network server and cannot be opened until the other user closes it."

      It works only if I restart the server. Can somebody help me on this its urgent.

      Thanks in advance.

      Regards
      Farzana.
        • 1. Re: Error while loading PDF Preset file
          Level 1
          How are you loading and unloading the preset?

          If you're using javascript you should be able to do something like this...

          var doc = app.open("myDoc.indd");

          // load the preset
          app.open("MyPDFPreset.joboptions");

          doc.exportFile("Adobe PDF","myDoc.pdf","MyPDFPreset");

          // remove the preset
          var thePreset = app.pdfExportPresets.itemByRange("TomsPDFPreset","TomsPDFPreset");
          if ( thePreset ) thePreset.remove();

          doc.close();

          app.open() will copy the preset to the appropriate location and remove() will delete it.

          Note also that, when you load a PDF preset in InDesign it actually becomes available to all other Adobe apps that handle PDF.
          • 2. Re: Error while loading PDF Preset file
            Level 1
            oops, wrong preset name. That should be...

            var thePreset = app.pdfExportPresets.itemByRange("MyPDFPreset","MyPDFPreset");
            if ( thePreset ) thePreset.remove();
            • 3. Re: Error while loading PDF Preset file
              Rajeev Kumar MPS Level 1

              aap.open("MyPDFPreset.joboptions") is not working.

              • 4. Re: Error while loading PDF Preset file
                Adobe-InDesign CS4 Level 1

                Dear Tom,

                 

                   I used your coding, but this is throwing error.

                 

                  app.open("myJobOptions.joboptions"); -> your coding.

                 

                here I can pass the Job option file path and file name, see below my coding

                 

                app.open(File("d:\\myJobOptions.joboptions")); -> This is not working.

                 

                 

                Question :

                 

                (*)  I'm having  the joboptions in saparate folder, I can Add that Joboption in my InDesign Application.

                (*) How to Add the JobOption in my InDesign File.

                (*) Use that joboption and export as PDF file.

                 

                 

                See my Coding [this is not working]

                 

                //=================== Coding =====================//

                    var myPreset = File("d:\webPDF.joboptions");

                 

                     var pdfPreset = app.pdfExportPresets.add(myPreset);

                    pdfPreset.name = "First_JOB";

                 

                     myFolder = "d:\";

                     myBaseName  = "Dummy";

                 

                var myFile= new File(myFolder+"/"+myBaseName +"_web"+ ".pdf");
                var result = "exported to:  " + myFile.fullName;
                if(!myFile.parent.exists && !myFile.parent.create())
                {
                  result = "Not exported.  Unable to create the folder:  " + myFile.parent.fullName;
                } else {
                  app.documents.item(0).exportFile(ExportFormat.pdfType, myFile);
                }

                    

                //============== End of the Coding =================//

                 

                Please make it corrtect and give me the solution.

                 

                Pls. I'm struggling this part, so Please as soon as possible explain & give the solutions for the above problem.

                 

                Thanks & Regards

                T.R.Harihara SudhaN.,