forked from sile-typesetter/libtexpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdftypes.h
155 lines (120 loc) · 2.49 KB
/
pdftypes.h
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
#ifndef _PDFTYPES_H_
#define _PDFTYPES_H_
#include "dpxutil.h"
typedef signed long spt_t;
typedef struct pdf_tmatrix
{
double a, b, c, d, e, f;
} pdf_tmatrix;
typedef struct pdf_rect
{
double llx, lly, urx, ury;
} pdf_rect;
typedef struct pdf_coord
{
double x, y;
} pdf_coord;
#define PDF_COLOR_COMPONENT_MAX 4
typedef struct
{
int num_components;
char* spot_color_name;
double values[PDF_COLOR_COMPONENT_MAX];
} pdf_color;
/* The name transform_info is misleading.
* I'll put this here for a moment...
*/
typedef struct
{
/* Physical dimensions
*
* If those values are given, images will be scaled
* and/or shifted to fit within a box described by
* those values.
*/
double width;
double height;
double depth;
pdf_tmatrix matrix; /* transform matrix */
pdf_rect bbox; /* user_bbox */
int flags;
} transform_info;
typedef struct pdf_page
{
pdf_obj *page_obj;
pdf_obj *page_ref;
int flags;
double ref_x, ref_y;
pdf_rect cropbox;
pdf_obj *resources;
/* Contents */
pdf_obj *background;
pdf_obj *contents;
/* global bop, background, contents, global eop */
pdf_obj *content_refs[4];
pdf_obj *annots;
pdf_obj *beads;
} pdf_page;
typedef struct pdf_olitem
{
pdf_obj *dict;
int is_open;
struct pdf_olitem *first;
struct pdf_olitem *parent;
struct pdf_olitem *next;
} pdf_olitem;
typedef struct pdf_bead
{
char *id;
long page_no;
pdf_rect rect;
} pdf_bead;
typedef struct pdf_article
{
char *id;
pdf_obj *info;
long num_beads;
long max_beads;
pdf_bead *beads;
} pdf_article;
typedef struct pdf_doc
{
struct {
pdf_obj *dict;
pdf_obj *viewerpref;
pdf_obj *pagelabels;
pdf_obj *pages;
pdf_obj *names;
pdf_obj *threads;
} root;
pdf_obj *info;
struct {
pdf_rect mediabox;
pdf_obj *bop, *eop;
long num_entries; /* This is not actually total number of pages. */
long max_entries;
pdf_page *entries;
} pages;
struct {
pdf_olitem *first;
pdf_olitem *current;
int current_depth;
} outlines;
struct {
long num_entries;
long max_entries;
pdf_article *entries;
} articles;
struct name_dict *names;
int check_gotos;
struct ht_table gotos;
struct {
int outline_open_depth;
double annot_grow;
} opt;
struct form_list_node *pending_forms;
char manual_thumb_enabled;
char* doccreator;
pdf_color bgcolor;
} pdf_doc;
#endif