XMP 메타데이터

XMP 메타데이터

XMP (Extensible Metadata Platform)는 PDF 문서에 삽입된 XML 기반 메타데이터 형식으로, 제목, 저자, 생성 날짜, 수정 날짜 및 사용자 정의 속성을 설명합니다 (ISO 32000-1:2008, §14.3).

XmpMetadata

XmpMetadata는 PDF 문서에 삽입된 XMP 메타데이터 스트림에 접근할 수 있게 합니다. 이는 문서의 메타데이터 사전을 통해 접근할 수 있습니다:

try (Document doc = new Document("input.pdf")) {
    XmpMetadata xmp = doc.getMetadata();
    // Access standard XMP properties
}

메타데이터 읽기

creator, creation date, modification date와 같은 표준 XMP 속성은 XmpMetadata API를 통해 타입된 속성 값으로 접근할 수 있습니다.

DocumentInfo

DocumentInfo 클래스는 고전 PDF 문서 정보 사전(Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate)에 대한 접근을 제공합니다. DocumentInfo와 XmpMetadata는 각각 독립적으로 존재하며 서로 다른 값을 가질 수 있습니다.

Document.getInfo()를 사용하여 DocumentInfo 인스턴스를 얻으세요:

try (Document doc = new Document("input.pdf")) {
    DocumentInfo info = doc.getInfo();
    String title = info.getTitle();
    String author = info.getAuthor();
}

참조

 한국어