11 Replies Latest reply: Nov 17, 2009 2:23 PM by [Jongware] RSS

    PDF export failure - how to locate problematic images?

    soom1976 Community Member

      Mac OS Leopard.

      I'm exporting PDF from InDesign CS3.

      In the middle of the process it says - "cannot read from TIFF file, resave the image and try again". But, it doesn't say WHICH file is corrupt! How can I find the bad file among the 862 Tiffs I have? Does PDF export create any log file, where I can see the exact problem details?

      I have tried the Preflight command, but it does not show any corrupt files...

      Please help

        • 1. Re: PDF export failure - how to locate problematic images?
          Eugene Tyson CommunityMVP

          There's a script on this page for exporting pages as individual pages to PDF.

           

          http://www.kasyan.ho.com.ua/my_scripts.html

           

          Run the script and you should find the problem page quickly.

          • 2. Re: PDF export failure - how to locate problematic images?
            soom1976 Community Member

            Hi. Thanks, but it does not work for some reason. I get the following message:

             

            picture_1.jpg

             

            Prior to that I've received a message in Russian, saying that my images are non CMYK, which I answered NO, cause I don't need them in CMYK for now... might ib be a problem?

            • 3. Re: PDF export failure - how to locate problematic images?
              Eugene Tyson CommunityMVP

              Well if the script doesn't work the same holds true for doing it manually.

               

              You don't have to do each page manually.

               

              But say for example that you have 90 pages.

               

              Export page 1 - 44 and then page 45-90

               

              Then 1 - 21, 21-44, 45-67, 68-90

               

              Then 1-10, 11 - 21, etc. etc. etc.

               

              Until you find the problem page(s)

              • 4. Re: PDF export failure - how to locate problematic images?
                soom1976 Community Member

                Well, of course I could do it manually, but I really don't want to spend time on 440 pages with 860 images, looking for a needle in a stack

                So I have found a great script that works: http://indesignsecrets.com/page-exporter-utility-peu-5-script-updated-for-cs3.php

                Thanks for the tip!

                • 5. Re: PDF export failure - how to locate problematic images?
                  Eugene Tyson CommunityMVP

                  Well you seem to think it will take a long time.

                   

                  But if you did pages 1 - 219 first.

                   

                  Then pages 220 - 440.

                   

                  Either page 1 - 219 or 220 - 440 would export fine. So, for example, if 1 - 219 exported fine and 220 - 440 didn't.

                   

                  Then export page 220  - 299,  300 - 399, 400 - 440

                   

                  One of them will not work

                   

                  So which ever one doesn't work keep wittling it down until you find the problem.

                   

                   

                   

                  It honestly doesn't take long.

                  • 6. Re: PDF export failure - how to locate problematic images?
                    Eugene Tyson CommunityMVP

                    Oh back in the day - before scripts lol - you would have hated it. Manually dredging through files.

                     

                    It used to be hard work. I feel in the time that it took you find the script that you would have finished your task before the script was up and running .

                     

                    Ok enough - you got the script and it works. Hope you find the problem image.

                    • 7. Re: PDF export failure - how to locate problematic images?
                      [Jongware] Community Member

                      Eugene Tyson wrote:


                      It honestly doesn't take long.

                       

                      Halving the difference between first and last page each time will take no more than 9 steps (2^9 = 512, more than 440 pages) (... and I'd write a script to do that).

                      • 8. Re: PDF export failure - how to locate problematic images?
                        Eugene Tyson CommunityMVP

                        That would be an awesome script. Although exporting to single pages to individual pdfs would probably take the same amount of time - I think?

                        • 9. Re: PDF export failure - how to locate problematic images?
                          [Jongware] Community Member

                          That -- strangely -- depends on the location of the faulty page. If it's anywhere early in the first half (thinking: perhaps 1/2 - 1/4 - 1/8 - 1/16 .. ~ the first quarter?), exporting to single pages will locate it faster. Halving the document will find it in more-or-less constant time -- never in more than (log number of pages)/log (2) tries (rounded upwards) -- and maybe faster if all its first guesses are correct. So if you have lots and lots of faulty documents, this divide-and-conquer should be more efficient.

                           

                          I could not try the following script as I don't have a faulty document at hand ... So use at your own risk. (It doesn't report anything for a correct document, which is entirely logical ...)

                          Set the tmpLocation folder name to point to the fastest harddisk you have -- it'll shave off seconds.

                           

                          var pdfPreset = "[Press Quality]";
                          var tmpLocation = "c:/";
                          divideAndConquer (0, app.activeDocument.pages.length);
                          function divideAndConquer (start, end)
                          {
                           var theEdge;
                           theEdge = (start+end) >> 1;
                           // First half:
                           app.pdfExportPreferences.pageRange = start+"-"+theEdge;
                           try {
                            app.activeDocument.exportFile (ExportFormat.pdfType, tmpLocation+"temp_a.pdf", false, pdfPreset);
                           } catch(_)
                           {
                            if (theEdge - start < 2)
                            {
                             alert ("Your problem page is "+start);
                             exit();
                            }
                            divideAndConquer (start, theEdge);
                           }
                           // Second half:
                           app.pdfExportPreferences.pageRange = (theEdge+1)+"-"+(end-1);
                           try {
                            app.activeDocument.exportFile (ExportFormat.pdfType, tmpLocation+"temp_b.pdf", false, pdfPreset);
                           } catch(_)
                           {
                            if (theEdge - start < 2)
                            {
                             alert ("Your problem page is "+start);
                             exit();
                            }
                            divideAndConquer (theEdge, end);
                           }
                          }
                          
                          • 10. Re: PDF export failure - how to locate problematic images?
                            Eugene Tyson CommunityMVP

                            Very good Jongware, that's an awesome little script. I'll have to give it a whirl when I have  similar issue.

                             

                            Divide and conquer is the way to do it really. I've had in the past pages that wouldn't pdf as part of the document. But making one half of the pdf, skip the page that had a problem, make the second half of the pdf, then make a pdf of the single page by itself, strip the lot together and it worked fine.

                             

                            Sometimes some pages just don't want to pdf with the rest of the pdf. It's weird. Never really had the time to look into why it happens.

                             

                            Cool script - added to the script folder.

                             

                            Thanks

                            • 11. Re: PDF export failure - how to locate problematic images?
                              [Jongware] Community Member

                              Eugene Tyson wrote:

                               

                              Very good Jongware, that's an awesome little script. I'll have to give it a whirl when I have  similar issue.

                               

                              Mind you, I'm not perfectly sure it works!

                              For on-lookers wondering what the script does: it divides the document into two, then exports both halves to a temporary PDF. If one of the halves fails to export (now what if both exports fail!? I think it'll plod on nevertheless ), the error catching routine in try..catch will kick in for that half. Now that half is divided into two again, and both parts are exported -- up to the point there is (hopefully) only one single page left.

                               

                              You are correct about having a single page that doesn't play nice with the rest of the document, I've seen that as well. This script will not catch that one. Perhaps a script that tries to export 1..x, where x starts with the last page and counts down until it works, then continues with the rest ... (I don't think I'll ever write that one).