Testing pdf files for corruption

Page 1 of 2 12 LastLast

  1. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
       #1

    Testing pdf files for corruption


    I had a hard drive corrupt several terabytes of data on me last year. I copied all the recoverable files to a new drive, and I'm in the process of trying to sort through it all now (I know, I should have had a backup). I know some files are fine, and others are corrupt.

    I have hundreds of .PDF files I'd like to test for corruption. Is there a tool that can do this reliably and easily, to fully test PDFs that contain either images or text or both? I'm not so good with command lines, powershell, etc., so a gui tool would be ideal. I'd like to be able to just point it to a folder of PDF files and test them all. I did find such a tool here:

    https://sourceforge.net/projects/corruptedpdfinder/

    and it seems to be ideal, however there's virtually no documentation, and it doesn't specify if it's testing images as well as text in the PDF, so I have no idea what it's actually testing. Any other suggestions, or is anyone familiar with this particular tool and can vouch for it?
      My Computer


  2. Posts : 42,736
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2
      My Computers


  3. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #3

    I was actually looking at that page but it was rather confusing. Lots of talk about powershell commands and command line tools. I was hoping for something a bit more user-friendly.
      My Computer


  4. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #4

    Also, is there a tool to verify jpeg/png files also?
      My Computer


  5. Posts : 4,224
    Windows 10
       #5

    PDF-Online.com has a Web-based PDF validity checker that seems pretty straightforward. Find it at PDF Tools Online - Validate PDF. Suggestions on JPG integrity at Google Groups look pretty useful. There's a program at libpng.org called pngcheck that looks like it will do what you want for PNG images: http://www.libpng.org/pub/png/apps/pngcheck.html.
    HTH,
    --Ed--
    Last edited by EdTittel; 31 Jul 2017 at 17:31. Reason: fix spacing issues
      My Computers


  6. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #6

    Thanks. I saw pngcheck and it sounds great but I have no idea what to do with it. The exe file does nothing when I run it - I'm guessing it's a command line tool. As I mentioned, I'm not much good with command line tools, and I was hoping for something user friendly. I would think there would be more tools like this available.
      My Computer


  7. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #7

    I did find "Bad Peggy" for image verification, But of course the site seems to be down and I can't find the tool anywhere (latest version is 2.1).

    I found the page on archive.org, but sadly the zip file was not archived. Any help finding Bad Peggy v2.1 would be much appreciated.

    https://www.raymond.cc/blog/bad-pegg...d-jpeg-images/

    http://www.coderslagoon.com/#badpeggy

    coderslagoon.com

      My Computer


  8. Posts : 4,224
    Windows 10
       #8

    The general syntax for pngcheck is pretty easy at the command line. Once you navigate to the folder/directory where suspect png files reside, simply type pngcheck *.png to check all local png files. You'll get output like this:
    Testing pdf files for corruption-pngcheck-wildcard.jpg
    As you can see, it happily checks hundreds of files and reports either OK or an error message for each file it checks.
    Here's a set of step-by-step instructions to do this:
    0. As a preparatory step, you'll need to download pngcheck.zip, then copy the files into a known directory (let's say it's named C:\pngchk
    1. Launch cmd.exe in admin mode: type "cmd.exe" into the Cortana search box, right-click the cmd.exe entry that pops up in response, and click "Run as administrator" in the resulting pop-up menu.
    2. Within the command window navigate to the folder where the png files that you want to check reside (repeat as needed). Let's say they're on the F: drive and the folder you want is named /images. That means you'd type "F:" (omitting quotes) at the command prompt to switch to the f drive, then type "cd /images" (omitting quotes) to get into F:/images.
    3. at the command prompt, type "C:\pngchk\pngcheck *.png" and read through the output to find damaged or corrupted files (or add ">checkdata.txt" to the end of the preceding command string to save the output to a file in your current directory named "checkdata.txt". The link on repair I provided earlier indicates that free graphics program IrfanView will happily repair (some) corrupted files simply by opening them and then saving them as the same file type inside that application.
    HTH,
    --Ed--
      My Computers


  9. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #9

    Big thanks for the tutorial. I just tried it and it worked just as you described.

    I also managed to find a copy of Bad Peggy 2.0 from archive.org, though sadly they didn't archive the last version, 2.1, which is unfortunate because 2.1 didn't require java to be installed to run, whereas all previous versions did. I've been digging around but can't find v2.1 archived anywhere.

    Thanks again for explaining pngchk's usage. The command line has always been intimidating to me. I bet there's a simple way to write a batch file (say, "pngchk.bat") to point at a single directory (say, "test") for the test images and then just by running the batch file it runs pngcheck against that folder. I just don't know how to put together a batch file. I know it's just a simple text file, but I don't know how to format the commands to run it correctly. Any idea how I would write up a quick batch file to accomplish this task? You seem to be knowledgeable with these things. Once it was written, I could always change the directories in the batch file as necessary.
      My Computer


  10. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter
       #10

    Okay, I just put together a quick batch file I can drop in any folder that runs pngcheck and checks the png files in whichever folder the batch file resides in. Here it is in case anybody else finds it useful:

    Code:
    @ECHO OFF
    SETLOCAL
    C:\Programs\pngcheck\pngcheck.exe *.png
    PAUSE
    ENDLOCAL

    Just copy the text into a text file and save it with the extension .bat and run it in the directory that contains your .png files. Just change the location of pngcheck.exe in the text to wherever you have pngcheck.exe on your system . This displays the results in the cmd window. I also made a second batch file that outputs the results to a text file instead of displaying in the cmd box:

    Code:
    @ECHO OFF
    SETLOCAL
    C:\Programs\pngcheck\pngcheck.exe *.png >checkdata.txt
    ENDLOCAL
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:44.
Find Us




Windows 10 Forums