From 6318399941040d1e0160f5f965887b3f9e8ac317 Mon Sep 17 00:00:00 2001 From: Evangelos Rigas Date: Wed, 11 Jul 2018 17:52:57 +0100 Subject: [PATCH 2/2] [utils] Add PDF subtype (PDF/A, PDF/X) to pdfinfo utility If GTS_PDFA1Version or GTS_PDFXVersion is found inside the PDF Information Dictionary print the PDF subtype and version after PDF version. For a PDF/X-3 document the following info will be displayed: PDF version: 1.3 PDF subtype: PDF/X-3:2002 1 file changed, 7 insertions(+) diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc index 4542580b..d9a40b5a 100644 --- a/utils/pdfinfo.cc +++ b/utils/pdfinfo.cc @@ -429,6 +429,7 @@ static void printInfo(PDFDoc *doc, UnicodeMap *uMap, long long filesize, GBool m double w, h, wISO, hISO; int pg, i; int r; + GooString *subtype; // print doc info Object info = doc->getDocInfo(); @@ -595,6 +596,12 @@ static void printInfo(PDFDoc *doc, UnicodeMap *uMap, long long filesize, GBool m // print PDF version printf("PDF version: %d.%d\n", doc->getPDFMajorVersion(), doc->getPDFMinorVersion()); + + subtype = doc->getDocInfoSubtype(); + if (subtype != nullptr) { + printf("PDF subtype: %s\n", subtype->getCString()); + } + } int main(int argc, char *argv[]) { -- 2.18.0