1

I need to get the information of pdf file.

There is my code:

PdfReader reader = new PdfReader(fileName);
var info = reader.Info;

I don't need to read the whole file: if there are a lot of pdf files, this operation may take a lot of time..

How can I get info without reading whole file?

Chepene
  • 1,128
  • 1
  • 12
  • 18

1 Answers1

1

That's explained in Chapter 6 of the official documentation:

PdfReader reader = new PdfReader(new RandomAccessFileOrArray(file), null);
Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
  • 1
    Unfortunately that constructor (I assume `file` is a `String`) has been marked "deprecated" (Java-style) and the use of the constructor accepting a `RandomAccessSource` is suggested. – mkl May 22 '13 at 10:57