Chepene
Chepene

Reputation: 1128

Read info of pdf file without reading whole file

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?

Upvotes: 1

Views: 331

Answers (1)

Bruno Lowagie
Bruno Lowagie

Reputation: 77528

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

PdfReader reader = new PdfReader(new RandomAccessFileOrArray(file), null);

Upvotes: 1

Related Questions