Created
September 27, 2015 23:07
-
-
Save sgringwe/bf1cbcdfa0e2e2700cc2 to your computer and use it in GitHub Desktop.
Check pdf validity using ghostscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gs -dNOPAUSE -dBATCH -sDEVICE=nullpage valid.pdf | |
GPL Ghostscript 9.16 (2015-03-30) | |
Copyright (C) 2015 Artifex Software, Inc. All rights reserved. | |
This software comes with NO WARRANTY: see the file PUBLIC for details. | |
Processing pages 1 through 1. | |
Page 1 | |
(return code 0) | |
: gs -dNOPAUSE -dBATCH -sDEVICE=nullpage invalid.pdf | |
GPL Ghostscript 9.16 (2015-03-30) | |
Copyright (C) 2015 Artifex Software, Inc. All rights reserved. | |
This software comes with NO WARRANTY: see the file PUBLIC for details. | |
**** This file uses an unknown security handler. | |
**** The file was produced by: | |
��+dr��� <<<<��.]��{[1$3�*M=��]H&T��v�U@�r�,t� | |
Error: /undefined in pdf_process_Encrypt | |
Operand stack: | |
Execution stack: | |
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1951 1 3 %oparray_pop 1950 1 3 %oparray_pop 1934 1 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- | |
Dictionary stack: | |
--dict:1182/1684(ro)(G)-- --dict:1/20(G)-- --dict:83/200(L)-- --dict:83/200(L)-- --dict:117/127(ro)(G)-- --dict:280/300(ro)(G)-- --dict:22/32(L)-- | |
Current allocation mode is local | |
Last OS error: Invalid argument | |
GPL Ghostscript 9.16: Unrecoverable error, exit code 1 | |
: | |
(return code 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know you were here for this.... 👀