4 Replies Latest reply on May 16, 2012 2:51 PM by pkrk

    Zero KB PDFs

    pkrk Level 1

      I have a script that batch exports PDF's from the different layers in an Indesign file.

       

      I can export the same file 5 times in a row and out of those 5 times, 2 times will result in a handfull of the the PDF's being Zero KB.

      There doesn't seem to be any pattern to it. Not the same PDF's are zero KB and not even the same quanity are Zero kb.

       

       

      Anyone else run into this. I saw a post previously on a different site about someone else's script doing the same thing but with no answer.

       

       

      Thank you in advance!

        • 1. Re: Zero KB PDFs
          absqua Level 4

          I've run into a couple of problems with pdf export scripts. One is that placed pdf or ai files drop off (on the current export and all subsequent exports during the same script session) if you click on any palettes or the control bar while the script is running. It looks from a quick test like this bug has survived into CS6. I will file it again.

           

          All of my pdf export scripts include a one second delay after each export, and I think I started using that initially to address the problem you're seeing. You might try that. For some reason which is now lost to me, I don't use $.sleep(), but rather a function that looks like this:

           

          function delay(ms) {
            var date = new Date(), 
                  curDate;
            do {
              curDate = new Date();
            } while (curDate - date < ms);
          }
          

           

          I don't know whether I use that because it worked and $.sleep() didn't, or because I plucked that off the web before I knew $.sleep() existed.

           

          Jeff

          1 person found this helpful
          • 2. Re: Zero KB PDFs
            pkrk Level 1

            Thanks.

             

            I tried but no luck.

             

            If I leave the mouse alone it gives me good PDF's so you were correct there. The script is being passed on to others so I will still try to find a solution since the script takes about 5 minutes to run and I'm sure someone will not be able to leave their mouse alone while the script runs.

            • 3. Re: Zero KB PDFs
              absqua Level 4

              If you find a solution please report back. I tried asynchronous and idleEvent-triggered exports, with no luck. See this thread. There was at least one other post on here from someone with the same problem, though I can't seem to put my hands on it now. If you can reduce the problem to a repeatable scenario, could you also please file the bug with Adobe? I'd love to see this one fixed.

              • 4. Re: Zero KB PDFs
                pkrk Level 1

                Will do.

                 

                Whats funny(or not so) is that I think I ran into this issue myself around 2 years ago but I'm totally blanking on how/if I dealt with it.

                 

                 

                Thanks