forked from mshockwave/PdfiumAndroid
-
Notifications
You must be signed in to change notification settings - Fork 241
Expand file tree
/
Copy pathPdfDocument.java
More file actions
114 lines (88 loc) · 2.38 KB
/
PdfDocument.java
File metadata and controls
114 lines (88 loc) · 2.38 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
package com.shockwave.pdfium;
import android.graphics.RectF;
import android.os.ParcelFileDescriptor;
import android.util.ArrayMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class PdfDocument {
public static class Meta {
String title;
String author;
String subject;
String keywords;
String creator;
String producer;
String creationDate;
String modDate;
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public String getSubject() {
return subject;
}
public String getKeywords() {
return keywords;
}
public String getCreator() {
return creator;
}
public String getProducer() {
return producer;
}
public String getCreationDate() {
return creationDate;
}
public String getModDate() {
return modDate;
}
}
public static class Bookmark {
private List<Bookmark> children = new ArrayList<>();
String title;
long pageIdx;
long mNativePtr;
public List<Bookmark> getChildren() {
return children;
}
public boolean hasChildren() {
return !children.isEmpty();
}
public String getTitle() {
return title;
}
public long getPageIdx() {
return pageIdx;
}
}
public static class Link {
private RectF bounds;
private Integer destPageIdx;
private String uri;
public Link(RectF bounds, Integer destPageIdx, String uri) {
this.bounds = bounds;
this.destPageIdx = destPageIdx;
this.uri = uri;
}
public Integer getDestPageIdx() {
return destPageIdx;
}
public String getUri() {
return uri;
}
public RectF getBounds() {
return bounds;
}
}
/*package*/ PdfDocument() {
}
/*package*/ long mNativeDocPtr;
/*package*/ ParcelFileDescriptor parcelFileDescriptor;
/*package*/ final Map<Integer, Long> mNativePagesPtr = new ArrayMap<>();
public boolean hasPage(int index) {
return mNativePagesPtr.containsKey(index);
}
}