1 // Copyright 2017 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "xfa/fxfa/parser/cxfa_pdf.h"
8
9 #include "fxjs/xfa/cjx_node.h"
10 #include "xfa/fxfa/parser/cxfa_document.h"
11
12 namespace {
13
14 const CXFA_Node::PropertyData kPdfPropertyData[] = {
15 {XFA_Element::AdobeExtensionLevel, 1, {}},
16 {XFA_Element::FontInfo, 1, {}},
17 {XFA_Element::Xdc, 1, {}},
18 {XFA_Element::Pdfa, 1, {}},
19 {XFA_Element::BatchOutput, 1, {}},
20 {XFA_Element::ViewerPreferences, 1, {}},
21 {XFA_Element::ScriptModel, 1, {}},
22 {XFA_Element::Version, 1, {}},
23 {XFA_Element::SubmitFormat, 1, {}},
24 {XFA_Element::SilentPrint, 1, {}},
25 {XFA_Element::Producer, 1, {}},
26 {XFA_Element::Compression, 1, {}},
27 {XFA_Element::Interactive, 1, {}},
28 {XFA_Element::Encryption, 1, {}},
29 {XFA_Element::RenderPolicy, 1, {}},
30 {XFA_Element::OpenAction, 1, {}},
31 {XFA_Element::Creator, 1, {}},
32 {XFA_Element::Linearized, 1, {}},
33 {XFA_Element::Tagged, 1, {}},
34 };
35
36 const CXFA_Node::AttributeData kPdfAttributeData[] = {
37 {XFA_Attribute::Name, XFA_AttributeType::CData, nullptr},
38 {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr},
39 {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0},
40 };
41
42 } // namespace
43
CXFA_Pdf(CXFA_Document * doc,XFA_PacketType packet)44 CXFA_Pdf::CXFA_Pdf(CXFA_Document* doc, XFA_PacketType packet)
45 : CXFA_Node(doc,
46 packet,
47 XFA_XDPPACKET::kConfig,
48 XFA_ObjectType::Node,
49 XFA_Element::Pdf,
50 kPdfPropertyData,
51 kPdfAttributeData,
52 cppgc::MakeGarbageCollected<CJX_Node>(
53 doc->GetHeap()->GetAllocationHandle(),
54 this)) {}
55
56 CXFA_Pdf::~CXFA_Pdf() = default;
57