diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-10-16 13:32:01 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-16 17:46:49 +0000 |
commit | 077f6439954cdbb5061a78b59be95ebf2277ac26 (patch) | |
tree | 1f444c5fd6ced1da8452becf90c972676ce0dd92 /fpdfsdk/fpdfcatalog.cpp | |
parent | e5a637cfb23da32443b345b07f090b65771fa1c9 (diff) | |
download | pdfium-077f6439954cdbb5061a78b59be95ebf2277ac26.tar.xz |
Add FPDFCatalog_IsTagged to public API.
The new fpdf_catalog.h will contains functions to access entries in
the catalog (root) dict in a PDF.
Bug: chromium:768986
Change-Id: I6e1d4a479d6f8742981e89f07bab98ee96dc3763
Reviewed-on: https://pdfium-review.googlesource.com/15970
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfcatalog.cpp')
-rw-r--r-- | fpdfsdk/fpdfcatalog.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfcatalog.cpp b/fpdfsdk/fpdfcatalog.cpp new file mode 100644 index 0000000000..493e5aea43 --- /dev/null +++ b/fpdfsdk/fpdfcatalog.cpp @@ -0,0 +1,22 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "public/fpdf_catalog.h" + +#include "core/fpdfapi/parser/cpdf_document.h" +#include "fpdfsdk/fsdk_define.h" + +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFCatalog_IsTagged(FPDF_DOCUMENT document) { + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); + if (!pDoc) + return false; + + const CPDF_Dictionary* pCatalog = pDoc->GetRoot(); + if (!pCatalog) + return false; + + const CPDF_Dictionary* pMarkInfo = pCatalog->GetDictFor("MarkInfo"); + return pMarkInfo && pMarkInfo->GetIntegerFor("Marked") != 0; +} |