Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Get PDF Document Info with iText
How to get PDF document information using iText Java Library?
✍: FYIcenter.com
Here is a tutorial for getting PDF document information
using iText Java Library.
1. Create a Java file, PdfInfo.java:
/**
* Get PDF info
*/
import com.itextpdf.kernel.pdf.*;
import java.io.*;
public class PdfInfo {
public static void main(String args[]) throws IOException {
PdfReader reader = new PdfReader(args[0]);
PdfDocument pdf = new PdfDocument(reader);
PdfDocumentInfo info = pdf.getDocumentInfo();
System.out.println("Title: "+info.getTitle());
System.out.println("Subject: "+info.getSubject());
System.out.println("Keywords: "+info.getKeywords());
System.out.println("Author: "+info.getAuthor());
System.out.println("Creator: "+info.getCreator());
System.out.println("Producer: "+info.getProducer());
pdf.close();
}
}
2. Run the Java program iText 7 Java Library.
fyicenter$ java -cp java -cp kernel-7.1.4.jar:layout-7.1.4.jar: \ io-7.1.4.jar:slf4j-api-1.7.31.jar \ PdfInfo.java hello.pdf Title: null Subject: null Keywords: null Author: null Creator: null Producer: iText® 7.1.4 ©2000-2018 iText Group NV (AGPL-version)
3. View the output. You see only the "Producer" field value on the PDF file: hello.pdf.
⇒ Copy PDF Document with iText
⇐ Draw Shape in PDF with iText
2021-11-13, ∼1376🔥, 0💬
Popular Posts:
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...
JDK 17 java.xml.jmod is the JMOD file for JDK 17 XML (eXtensible Markup Language) module. JDK 17 XML...
commons-net-1.4.1.jar is the JAR file for Apache Commons Net 1.4.1, which implements the client side...
How to download and install JDK (Java Development Kit) 1.4? If you want to write Java applications, ...
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...