

The result is: Both pdfinfo and JHOVE are able to spot damaged files correctly (JHOVE was even more sensitive in some cases).Īnd here is the equivalent script for JHOVE: OFF
PDFINFO TOOLING U PDF
To test both approaches I deleted and altered random parts from a PDF with a text editor (removed streams, so pages failed to render in my PDF viewer, altered PDF Tags, and shifted some bits).

of Speedwell Mudguards in 1989 including some original pre-war tooling. But then I noticed I had not handled the output of JHOVE correctly.) Once you have your motor selected and in-hand, you need some way to physically. I also tried the same with JHOVE (Open source file format identification, validation & characterization tool) as suggested by here: Check if PDF files are corrupted using command line on Linux and can now confirm this is also a valid approach. Unrecoverable content leads to empty pages. But this does not mean you get all your content back. NOTE: A recreated PDF contains lesser errors and should be viewable with a regular PDF viewer. Pdfinfo "$file" 2>&1 | grep -i 'error' &> /dev/nullīroken PDFs will be moved to a subfolder \bak and the recreated PDFs get the suffix _.pdf (which is not perfect, but good enough for me). Or the same as bash script: for file in $(find. If PDF-file is ´-, it reads the PDF file from stdin.
PDFINFO TOOLING U PORTABLE
Write-Output "Total: $totalCounter / BAD: $badCounter / GOOD: $goodCounter" > $logFileįollowing the footsteps of I wrote a batch script to check all PDFs in a specific folder with pdfinfo and push it through cpdf if broken as an attempt to fix them: OFF Pdfinfo prints the contents of the ´Info dictionary (plus some other useful information) from a Portable Document Format (PDF) file. $totalCounter = $badCounter + $goodCounter Write-Output "$item - OK" -EA "Stop" > $logFile # Append filename and good status to logfile You might need to define the following at the beginning: $ErrorActionPreference = "Silentl圜ontinue" if you see errors on screen.Ĭopy the following into a text file and name it appropriately (ex: CheckPDF.ps1) or open PS and browse to the directory containing the PDF files to check and paste it in the console. There's probably a better way to do this, but this works flawlessly for my purposes and handles errors silently. I tried to add comments for those who are new to PS.

It took about 2 minutes to run this against 35,000 PDF files. The following Powershell (PS) script will check ALL the PDF files in the current directory and output the status of each into a text file (!RESULTS.log). I only needed one key, but chose to use both CreationDate and ModDate.
PDFINFO TOOLING U WINDOWS
I read that newer PDF formats have a readable xml data catalog at the end, so I opened the PDF with regular windows NOTEPAD.exe and scrolled down past the unreadable data to the end and saw several readable keys. I've used "pdfinfo.exe" from xpdfbin-win package and cpdf.exe to check PDF files for corruption, but didn't want to involve a binary if it wasn't necessary.

:F:Arial-I talicMT.P: Arial Ital ic.L:$."F:Arial. 2:o.:F:Aria lNarrow-Bo ldItalic.P :Arial Nar row Bold I talic.L:%."F:Ar ial Narrow. FID.2:o.:F:A rialNarrow -Bold.P:Ar ial Narrow Bold.L:%."F:Ar ial Narrow. :F :ArialNarr ow.P:Arial Narrow.L: $."F: Arial Narr ow.#.107.F ID.2:o.:F:Ar ialNarrow- Italic.P:A rial Narro w Italic.L :$."F :Arial Nar row.#.103. FID.2:o.:F:A gencyFB-Bo ld.P:Agenc y FB Bold. Process information set: NOOPENFILE ERRORBOX Source: C:\Program Files (x8 6)\Adobe\A crobat Rea der DC\Rea der\AcroCE F\RdrCEF.e xeĭisables application error messsages (SetErrorMode) Source: C:\Program Files (x8 6)\Adobe\A crobat Rea der DC\Rea der\AcroRd 32.exe Process created: C:\Program Files (x8 6)\Adobe\A crobat Rea der DC\Rea der\AcroCE F\RdrCEF.e xe "C:\Pro gram Files (x86)\Ado be\Acrobat Reader DC \Reader\Ac roCEF\RdrC EF.exe" - background color=1651 4043 Source: C:\Program Files (x8 6)\Adobe\A crobat Rea der DC\Rea der\AcroRd 32.exe Through proven classes, industry-recognized certification, custom programs, and learning consulting services, we empower organizations to build the workforce of tomorrow with the skills and agility needed to thrive. exe" "C:\U sers\user\ Desktop\FO E Alert FA -22-03 MS- SSC - Supp ort Toolin g Contamin ation.pdf Tooling U-SME unleashes the power of your workforce for organizational strength and agility. Process created: C:\Program Files (x8 6)\Adobe\A crobat Rea der DC\Rea der\AcroRd 32.exe C:\ Program Fi les (x86)\ Adobe\Acro bat Reader DC\Reader \AcroRd32.
