CosSaveParams.java
3.58 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.io.ByteWriter
*/
package com.adobe.internal.pdftoolkit.core.cos;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
import java.util.Map;
public class CosSaveParams
implements Cloneable {
public static final int CURRENT_XREF = 0;
public static final int XREFTABLE = 1;
public static final int XREFSTREAM = 2;
public static final int XREFHYBRID = 3;
public static final int SAVE_STYLE_DEFAULT = 0;
public static final int SAVE_STYLE_INCREMENTAL = 1;
public static final int SAVE_STYLE_FULL = 2;
public static final int SAVE_STYLE_LINEAR = 3;
private String mHeader = null;
private String mHeaderToken = null;
private String mVersion = null;
private Map mExtensions = null;
private int mXrefStyle = 0;
private int mSaveStyle = 0;
private ByteWriter mTempByteWriter = null;
private boolean mCloseAfterSave = false;
private boolean mSaveToCopy = false;
private boolean mForceCompress = false;
public CosSaveParams(int saveStyle) {
this.mSaveStyle = saveStyle;
}
public void setHeader(String header) {
this.mHeader = header;
}
public String getHeader() {
return this.mHeader;
}
public void setHeaderToken(String headerToken) throws PDFInvalidParameterException {
this.mHeaderToken = headerToken;
if (this.mHeaderToken != null) {
if (this.mHeaderToken.length() > 10) {
throw new PDFInvalidParameterException("Header token too long");
}
for (int i = 0; i < this.mHeaderToken.length(); ++i) {
char c = this.mHeaderToken.charAt(i);
if (c != '\r' && c != '\n' && (c & 65280) == 0) continue;
throw new PDFInvalidParameterException("Illegal header token");
}
}
}
public String getHeaderToken() {
return this.mHeaderToken;
}
public void setVersion(String version) {
this.mVersion = version;
}
public String getVersion() {
return this.mVersion;
}
public Map getExtensions() {
return this.mExtensions;
}
public void setExtensions(Map extensions) {
this.mExtensions = extensions;
}
public void setXrefStyle(int xrefstyle) {
this.mXrefStyle = xrefstyle;
}
public int getXrefStyle() {
return this.mXrefStyle;
}
public void setSaveStyle(int saveStyle) {
this.mSaveStyle = saveStyle;
}
public int getSaveStyle() {
return this.mSaveStyle;
}
public void setCloseAfterSave(boolean closeAfterSave) {
this.mCloseAfterSave = closeAfterSave;
}
public boolean getCloseAfterSave() {
return this.mCloseAfterSave;
}
public void setForceCompress(boolean forceCompress) {
this.mForceCompress = forceCompress;
}
public boolean getForceCompress() {
return this.mForceCompress;
}
public void setTempByteWriter(ByteWriter tempByteWriter) {
this.mTempByteWriter = tempByteWriter;
}
public ByteWriter getTempByteWriter() {
return this.mTempByteWriter;
}
public void setSaveToCopy(boolean saveToCopy) {
this.mSaveToCopy = saveToCopy;
}
public boolean getSaveToCopy() {
return this.mSaveToCopy;
}
public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException e) {
return null;
}
}
}