PDFBuildData.java
7.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosArray
* com.adobe.internal.pdftoolkit.core.cos.CosDictionary
* com.adobe.internal.pdftoolkit.core.cos.CosName
* com.adobe.internal.pdftoolkit.core.cos.CosNumeric
* com.adobe.internal.pdftoolkit.core.cos.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFParseException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASDate
* com.adobe.internal.pdftoolkit.core.types.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.digsig;
import com.adobe.internal.pdftoolkit.core.cos.CosArray;
import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
import com.adobe.internal.pdftoolkit.core.cos.CosName;
import com.adobe.internal.pdftoolkit.core.cos.CosNumeric;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASDate;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosDictionary;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
public abstract class PDFBuildData
extends PDFCosDictionary {
protected PDFBuildData(CosObject cosObject) throws PDFInvalidDocumentException {
super(cosObject);
}
public String getName() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
ASName swModuleName = this.getDictionaryNameValue(ASName.k_Name);
if (swModuleName != null) {
return swModuleName.asString(true);
}
return null;
}
public void setName(String name) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryNameValue(ASName.k_Name, name);
}
public String getDate() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
ASDate date = this.getDictionaryDateValue(ASName.k_Date);
if (date != null) {
return date.asString();
}
return null;
}
public void setDate(String date) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (date == null) {
this.removeValue(ASName.k_Date);
} else {
try {
this.setDictionaryDateValue(ASName.k_Date, new ASDate(date));
}
catch (PDFParseException e) {
throw new PDFInvalidDocumentException((Throwable)e);
}
}
}
public String getRevNumber() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryDoubleValueAsString(ASName.k_R);
}
public void setRevNumber(String revNumber) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
try {
if (revNumber == null) {
this.removeValue(ASName.k_R);
} else {
CosNumeric cosNum = PDFCosObject.newCosNumeric(this.getPDFDocument(), revNumber.getBytes());
this.setDictionaryValue(ASName.k_R, (CosObject)cosNum);
}
}
catch (PDFInvalidParameterException e) {
// empty catch block
}
}
public boolean getPreRelease() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (this.getCosDictionary().containsKey((Object)ASName.k_PreRelease)) {
return this.getDictionaryBooleanValue(ASName.k_PreRelease);
}
return false;
}
public void setPreRelease(boolean preReleaseFlag) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryBooleanValue(ASName.k_PreRelease, preReleaseFlag);
}
public String[] getOS() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosArray array = this.getDictionaryArrayValue(ASName.k_OS);
if (array == null) {
return null;
}
String[] osArray = new String[array.size()];
for (int i = 0; i < array.size(); ++i) {
osArray[i] = array.getName(i).asString();
}
return osArray;
}
public void setOS(String[] osNameArray) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (osNameArray == null) {
this.removeValue(ASName.k_OS);
} else {
PDFDocument pdfDoc = this.getPDFDocument();
CosArray array = PDFCosObject.newCosArray(pdfDoc);
for (int i = 0; i < osNameArray.length; ++i) {
CosName str = PDFCosObject.newCosName(pdfDoc, ASName.create((String)osNameArray[i]));
array.add((CosObject)str);
}
this.setDictionaryArrayValue(ASName.k_OS, array);
}
}
public boolean getNonEFontNoWarn() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (this.getCosDictionary().containsKey((Object)ASName.k_NonEFontNoWarn)) {
return this.getDictionaryBooleanValue(ASName.k_NonEFontNoWarn);
}
return false;
}
public void setNonEFontNoWarn(boolean flag) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryBooleanValue(ASName.k_NonEFontNoWarn, flag);
}
public boolean getTrustedMode() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
if (this.getCosDictionary().containsKey((Object)ASName.k_TrustedMode)) {
return this.getDictionaryBooleanValue(ASName.k_TrustedMode);
}
return false;
}
public void setTrustedMode(boolean trustedMode) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryBooleanValue(ASName.k_TrustedMode, trustedMode);
}
public String getV() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getDictionaryDoubleValueAsString(ASName.k_V);
}
public void setV(String versionNumber) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosNumeric cosNum = null;
try {
cosNum = versionNumber != null ? PDFCosObject.newCosNumeric(this.getPDFDocument(), versionNumber.getBytes()) : null;
this.setDictionaryValue(ASName.k_V, (CosObject)cosNum);
}
catch (PDFInvalidParameterException e) {
// empty catch block
}
}
}