Henrique Nakashima | 077f643 | 2017-10-16 13:32:01 -0400 | [diff] [blame] | 1 | // Copyright 2017 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "public/fpdf_catalog.h" |
| 6 | |
Lei Zhang | 8153561 | 2018-10-09 21:15:17 +0000 | [diff] [blame] | 7 | #include "core/fpdfapi/parser/cpdf_dictionary.h" |
Henrique Nakashima | 077f643 | 2017-10-16 13:32:01 -0400 | [diff] [blame] | 8 | #include "core/fpdfapi/parser/cpdf_document.h" |
Dan Sinclair | 00d47a6 | 2018-03-28 18:39:04 +0000 | [diff] [blame] | 9 | #include "fpdfsdk/cpdfsdk_helpers.h" |
Henrique Nakashima | 077f643 | 2017-10-16 13:32:01 -0400 | [diff] [blame] | 10 | |
| 11 | FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV |
| 12 | FPDFCatalog_IsTagged(FPDF_DOCUMENT document) { |
| 13 | CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 14 | if (!pDoc) |
| 15 | return false; |
| 16 | |
| 17 | const CPDF_Dictionary* pCatalog = pDoc->GetRoot(); |
| 18 | if (!pCatalog) |
| 19 | return false; |
| 20 | |
| 21 | const CPDF_Dictionary* pMarkInfo = pCatalog->GetDictFor("MarkInfo"); |
| 22 | return pMarkInfo && pMarkInfo->GetIntegerFor("Marked") != 0; |
| 23 | } |