PDFStructureArtifact.java
4.16 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASName
* com.adobe.internal.pdftoolkit.core.types.ASString
*/
package com.adobe.internal.pdftoolkit.pdf.interchange.structure;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.core.types.ASString;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import com.adobe.internal.pdftoolkit.pdf.document.PDFVersion;
import com.adobe.internal.pdftoolkit.pdf.graphics.PDFRectangle;
public class PDFStructureArtifact {
public static final ASName k_Pagination = ASName.create((String)"Pagination");
public static final ASName k_Layout = ASName.create((String)"Layout");
public static final ASName k_Page = ASName.create((String)"Page");
public static final ASName k_Background = ASName.create((String)"Background");
public static final ASName k_Header = ASName.create((String)"Header");
public static final ASName k_Footer = ASName.create((String)"Footer");
public static final ASName k_Watermark = ASName.create((String)"Watermark");
public static final ASName k_BatesN = ASName.create((String)"BatesN");
public static final ASName k_Artifact = ASName.create((String)"Artifact");
private final ASName mType;
private final ASName mSubtype;
private final PDFRectangle mRect;
private final ASName[] mPosition;
private final ASString[] mContents;
private PDFStructureArtifact(ASName type, ASName subtype, PDFRectangle rect, ASName[] location, ASString[] batesNumber) {
this.mType = type;
this.mSubtype = subtype;
this.mRect = rect;
this.mPosition = location;
this.mContents = batesNumber;
}
public static PDFStructureArtifact newPaginationArtifact(PDFDocument pdfDoc, ASName subtype, PDFRectangle rect, ASName[] location) throws PDFIOException, PDFSecurityException, PDFInvalidDocumentException {
PDFVersion version = pdfDoc.procureToSaveVersion();
if (version.lessThan(PDFVersion.v1_7)) {
subtype = null;
}
return new PDFStructureArtifact(k_Pagination, subtype, rect, location, null);
}
public static PDFStructureArtifact newPageArtifact(PDFDocument pdfDoc, PDFRectangle rect, ASName[] location) {
return new PDFStructureArtifact(k_Page, null, rect, location, null);
}
public static PDFStructureArtifact newLayoutArtifact(PDFDocument pdfDoc, PDFRectangle rect, ASName[] location) {
return new PDFStructureArtifact(k_Layout, null, rect, location, null);
}
public static PDFStructureArtifact newBackgroundArtifact(PDFDocument pdfDoc, PDFRectangle rect, ASName[] location) throws PDFIOException, PDFSecurityException, PDFInvalidDocumentException {
if (pdfDoc.procureToSaveVersion().lessThan(PDFVersion.v1_7)) {
return null;
}
return new PDFStructureArtifact(k_Background, null, rect, location, null);
}
public static PDFStructureArtifact newPaginationArtifactBatesNumber(PDFRectangle rect, ASName[] location, ASString[] batesNumber) throws PDFCosParseException, PDFIOException, PDFSecurityException {
return new PDFStructureArtifact(k_Pagination, ASName.k_BatesN, rect, location, batesNumber);
}
public ASString[] getContents() {
return this.mContents;
}
public ASName getType() {
return this.mType;
}
public ASName getSubtype() {
return this.mSubtype;
}
public PDFRectangle getBBox() {
return this.mRect;
}
public ASName[] getPosition() {
return this.mPosition;
}
}