Get Pdf document information as a map : PDF Reader « PDF « Java Tutorial






import java.util.Iterator;
import java.util.Map;

import com.lowagie.text.pdf.PdfReader;

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

    Map info = reader.getInfo();

    for (Iterator i = info.keySet().iterator(); i.hasNext();) {
      String key = (String) i.next();
      String value = (String) info.get(key);
      System.out.println(key + ": " + value);
    }

  }
}








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