PDFPrepressUtils.java
2.3 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
/*
* 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.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.interchange.prepress;
import com.adobe.internal.pdftoolkit.core.cos.CosArray;
import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import java.util.ListIterator;
public class PDFPrepressUtils {
static boolean validateColorSpaceArray(CosArray value) throws PDFCosParseException, PDFIOException, PDFSecurityException {
if (value.size() != 4 && value.size() != 5) {
return false;
}
CosObject colorSpaceFamilyName = value.get(0);
if (value.size() == 5 && !ASName.k_DeviceN.equals((Object)colorSpaceFamilyName)) {
return false;
}
if (!ASName.k_DeviceN.equals((Object)colorSpaceFamilyName) && !ASName.k_Separation.equals((Object)colorSpaceFamilyName)) {
return false;
}
return true;
}
static boolean validatePagesArray(CosArray value) throws PDFCosParseException, PDFIOException, PDFSecurityException {
ListIterator cosArrIterator = value.listIterator();
while (cosArrIterator.hasNext()) {
CosObject currentCosObj = (CosObject)cosArrIterator.next();
if (currentCosObj.getType() == 6) {
CosDictionary currentPageDict = (CosDictionary)currentCosObj;
CosObject typeValue = currentPageDict.get(ASName.k_Type);
if (ASName.k_Page.equals((Object)typeValue)) continue;
return false;
}
return false;
}
return true;
}
}