Any way to check invalid pdf using java

Thanks in advance.

I am java guy.
I have a damaged pdf file,where in which i couldn’t able to insert image to existing pdf file using itext api. Is there any way in java to read and identify the input file is invalid (ex:pdf complaince documents)file.