Get Document Information from PdfReader : PDF Reader « PDF « Java Tutorial






import com.lowagie.text.pdf.PdfReader;

public class MainClass {

  public static void main(String[] args) throws Exception {
    PdfReader reader = new PdfReader("HelloWorldToRead.pdf");


    System.out.println("PDF Version: " + reader.getPdfVersion());
    System.out.println("Number of pages: " + reader.getNumberOfPages());
    System.out.println("File length: " + reader.getFileLength());
    System.out.println("Encrypted? " + reader.isEncrypted());
    System.out.println("Rebuilt? " + reader.isRebuilt());

  }
}








29.2.PDF Reader
29.2.1.Create PdfReader
29.2.2.Get Document Information from PdfReader
29.2.3.Get Pdf document information as a map
29.2.4.Get Pdf document size