The trailer is part of the structure of the PDF file. If you get an error saying that it cannot be found, the first thing I think is your file is damaged. The ability to open a PDF in a PDF viewer does not necessarily mean that the PDF is not damaged; I understand that if it is a linearized PDF file, the viewer will not try to use the trailer.
Does your code provide an IOException for any PDF you are trying to read?
- If so, then perhaps using a more recent version of iTextSharp will help, or at least post some code.
- If not, then I would work on recreating the PDF files you are trying to process.
source share