w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pdfobj.c File Reference
#include <ctype.h>
#include <string.h>
#include <math.h>
#include "system.h"
#include "mem.h"
#include "error.h"
#include "mfileio.h"
#include "dpxconf.h"
#include "dpxutil.h"
#include "pdflimits.h"
#include "pdfencrypt.h"
#include "pdfparse.h"
#include "pdfobj.h"
#include "pdfdev.h"
Include dependency graph for pdfobj.c:

Go to the source code of this file.

Classes

struct  pdf_obj
 
struct  pdf_boolean
 
struct  pdf_number
 
struct  pdf_string
 
struct  pdf_name
 
struct  pdf_array
 
struct  pdf_dict
 
struct  decode_parms
 
struct  pdf_stream
 
struct  pdf_indirect
 
struct  xref_entry
 
struct  pdf_file
 
struct  pdf_out
 

Macros

#define STREAM_ALLOC_SIZE   4096u
 
#define ARRAY_ALLOC_SIZE   256
 
#define IND_OBJECTS_ALLOC_SIZE   512
 
#define OBJ_NO_OBJSTM   (1 << 0)
 
#define OBJ_NO_ENCRYPT   (1 << 1)
 
#define OBJSTM_MAX_OBJS   200
 
#define BINARY_MARKER   "%\344\360\355\370\n"
 
#define TYPECHECK(o, t)
 
#define INVALIDOBJ(o)   ((o) == NULL || (o)->type <= 0 || (o)->type > PDF_UNDEFINED)
 
#define pdf_match_name(o, s)   ((o) && (s) && !strcmp(((pdf_name *)(o)->data)->name, (s)))
 
#define is_space(c)
 
#define is_free(b, c)   (((b)[(c)/8]) & (1 << (7-((c)%8))))
 
#define checklabel(pf, n, g)
 
#define OBJ_FILE(o)   (((pdf_indirect *)((o)->data))->pf)
 
#define OBJ_OBJ(o)   (((pdf_indirect *)((o)->data))->obj)
 
#define OBJ_NUM(o)   (((pdf_indirect *)((o)->data))->label)
 
#define OBJ_GEN(o)   (((pdf_indirect *)((o)->data))->generation)
 

Typedefs

typedef void pdf_null
 
typedef struct pdf_boolean pdf_boolean
 
typedef struct pdf_number pdf_number
 
typedef struct pdf_string pdf_string
 
typedef struct pdf_name pdf_name
 
typedef struct pdf_array pdf_array
 
typedef struct pdf_dict pdf_dict
 
typedef struct pdf_stream pdf_stream
 
typedef struct pdf_indirect pdf_indirect
 
typedef struct xref_entry xref_entry
 

Functions

static pdf_outcurrent_output (void)
 
static void init_pdf_out_struct (pdf_out *p)
 
static void clean_pdf_out_struct (pdf_out *p)
 
static int check_for_pdf_version (FILE *file)
 
static void pdf_flush_obj (pdf_out *p, pdf_obj *object)
 
static void pdf_label_obj (pdf_out *p, pdf_obj *object)
 
static void pdf_write_obj (pdf_out *p, pdf_obj *object)
 
static void set_objstm_data (pdf_obj *objstm, int *data)
 
static intget_objstm_data (pdf_obj *objstm)
 
static void release_objstm (pdf_obj *objstm)
 
static void pdf_out_char (pdf_out *p, char c)
 
static void pdf_out_str (pdf_out *p, const void *buffer, size_t length)
 
static pdf_objpdf_new_ref (pdf_out *p, pdf_obj *object)
 
static void release_indirect (pdf_indirect *data)
 
static void write_indirect (pdf_out *p, pdf_indirect *indirect)
 
static void release_boolean (pdf_obj *data)
 
static void write_boolean (pdf_out *p, pdf_boolean *data)
 
static void write_null (pdf_out *p)
 
static void release_number (pdf_number *number)
 
static void write_number (pdf_out *p, pdf_number *number)
 
static void write_string (pdf_out *p, pdf_string *str)
 
static void release_string (pdf_string *str)
 
static void write_name (pdf_out *p, pdf_name *name)
 
static void release_name (pdf_name *name)
 
static void write_array (pdf_out *p, pdf_array *array)
 
static void release_array (pdf_array *array)
 
static void write_dict (pdf_out *p, pdf_dict *dict)
 
static void release_dict (pdf_dict *dict)
 
static void write_stream (pdf_out *p, pdf_stream *stream)
 
static void release_stream (pdf_stream *stream)
 
static void pdf_out_set_compression (pdf_out *p, int level)
 
FILEpdf_get_output_file (void)
 
static void pdf_out_set_version (pdf_out *p, int ver_major, int ver_minor)
 
int pdf_get_version (void)
 
int pdf_get_version_major (void)
 
int pdf_get_version_minor (void)
 
int pdf_check_version (int major, int minor)
 
static void add_xref_entry (pdf_out *p, uint32_t label, uint8_t type, uint32_t field2, uint16_t field3)
 
pdf_outpdf_out_init (const char *filename, const unsigned char *id1, const unsigned char *id2, int ver_major, int ver_minor, int compression_level, int enable_encrypt, int enable_objstm, int enable_predictor)
 
void pdf_out_set_encrypt (int keybits, int32_t permission, const char *opasswd, const char *upasswd, int use_aes, int encrypt_metadata)
 
static void dump_xref_table (pdf_out *p)
 
static void dump_trailer (pdf_out *p)
 
static void dump_xref_stream (pdf_out *p)
 
void pdf_out_flush (void)
 
void pdf_error_cleanup (void)
 
void pdf_set_root (pdf_obj *object)
 
void pdf_set_info (pdf_obj *object)
 
static void pdf_out_xchar (pdf_out *p, char c)
 
static int pdf_need_white (int type1, int type2)
 
static void pdf_out_white (pdf_out *p)
 
static pdf_objpdf_new_obj (int type)
 
int pdf_obj_typeof (pdf_obj *object)
 
void pdf_transfer_label (pdf_obj *dst, pdf_obj *src)
 
pdf_objpdf_link_obj (pdf_obj *object)
 
pdf_objpdf_ref_obj (pdf_obj *object)
 
pdf_objpdf_new_undefined (void)
 
pdf_objpdf_new_null (void)
 
pdf_objpdf_new_boolean (char value)
 
char pdf_boolean_value (pdf_obj *object)
 
pdf_objpdf_new_number (double value)
 
void pdf_set_number (pdf_obj *object, double value)
 
double pdf_number_value (pdf_obj *object)
 
pdf_objpdf_new_string (const void *str, unsigned length)
 
voidpdf_string_value (pdf_obj *object)
 
unsigned pdf_string_length (pdf_obj *object)
 
int pdfobj_escape_str (char *buffer, int bufsize, const unsigned char *s, int len)
 
void pdf_set_string (pdf_obj *object, unsigned char *str, unsigned length)
 
pdf_objpdf_new_name (const char *name)
 
char * pdf_name_value (pdf_obj *object)
 
pdf_objpdf_new_array (void)
 
pdf_objpdf_get_array (pdf_obj *array, int idx)
 
unsigned pdf_array_length (pdf_obj *array)
 
void pdf_add_array (pdf_obj *array, pdf_obj *object)
 
static void pdf_unshift_array (pdf_obj *array, pdf_obj *object)
 
pdf_objpdf_new_dict (void)
 
int pdf_add_dict (pdf_obj *dict, pdf_obj *key, pdf_obj *value)
 
void pdf_merge_dict (pdf_obj *dict1, pdf_obj *dict2)
 
int pdf_foreach_dict (pdf_obj *dict, int(*proc)(pdf_obj *, pdf_obj *, void *), void *pdata)
 
pdf_objpdf_lookup_dict (pdf_obj *dict, const char *name)
 
pdf_objpdf_dict_keys (pdf_obj *dict)
 
void pdf_remove_dict (pdf_obj *dict, const char *name)
 
pdf_objpdf_new_stream (int flags)
 
void pdf_stream_set_predictor (pdf_obj *stream, int predictor, int32_t columns, int bpc, int colors)
 
static unsigned char * filter_PNG15_apply_filter (unsigned char *raster, int32_t columns, int32_t rows, int8_t bpc, int8_t colors, int32_t *length)
 
static void apply_filter_TIFF2_1_2_4 (unsigned char *raster, int32_t width, int32_t height, int8_t bpc, int8_t num_comp)
 
static unsigned char * filter_TIFF2_apply_filter (unsigned char *raster, int32_t columns, int32_t rows, int8_t bpc, int8_t colors, int32_t *length)
 
static pdf_objfilter_create_predictor_dict (int predictor, int32_t columns, int bpc, int colors)
 
pdf_objpdf_stream_dict (pdf_obj *stream)
 
const voidpdf_stream_dataptr (pdf_obj *stream)
 
int pdf_stream_length (pdf_obj *stream)
 
void pdf_add_stream (pdf_obj *stream, const void *stream_data, int length)
 
static pdf_objfilter_stream_decode_ASCIIHexDecode (const void *data, size_t len)
 
static void skip_white_a85 (const char **p, const char *endptr)
 
static pdf_objfilter_stream_decode_ASCII85Decode (const void *data, size_t len)
 
static pdf_objfilter_stream_decode (const char *filter_name, pdf_obj *src, pdf_obj *parm)
 
int pdf_concat_stream (pdf_obj *dst, pdf_obj *src)
 
static pdf_objpdf_stream_uncompress (pdf_obj *src)
 
static int pdf_add_objstm (pdf_out *p, pdf_obj *objstm, pdf_obj *object)
 
void pdf_release_obj (pdf_obj *object)
 
static int backup_line (FILE *pdf_input_file)
 
static int find_xref (FILE *pdf_input_file)
 
static pdf_objparse_trailer (pdf_file *pf)
 
static int next_object_offset (pdf_file *pf, uint32_t obj_num)
 
pdf_objpdf_new_indirect (pdf_file *pf, uint32_t obj_num, uint16_t obj_gen)
 
static pdf_objpdf_read_object (uint32_t obj_num, uint16_t obj_gen, pdf_file *pf, size_t offset, size_t limit)
 
static pdf_objread_objstm (pdf_file *pf, uint32_t num)
 
static pdf_objpdf_get_object (pdf_file *pf, uint32_t obj_num, uint16_t obj_gen)
 
pdf_objpdf_deref_obj (pdf_obj *obj)
 
static void extend_xref (pdf_file *pf, size_t new_size)
 
static int parse_xref_table (pdf_file *pf, size_t xref_pos)
 
static uint32_t parse_xrefstm_field (const char **p, size_t length, uint32_t def)
 
static int parse_xrefstm_subsec (pdf_file *pf, const char **p, size_t *length, int *W, int wsum, int first, int size)
 
static int parse_xref_stream (pdf_file *pf, size_t xref_pos, pdf_obj **trailer)
 
static pdf_objread_xref (pdf_file *pf)
 
static pdf_filepdf_file_new (FILE *file)
 
static void pdf_file_free (pdf_file *pf)
 
void pdf_files_init (void)
 
int pdf_file_get_version (pdf_file *pf)
 
pdf_objpdf_file_get_trailer (pdf_file *pf)
 
pdf_objpdf_file_get_catalog (pdf_file *pf)
 
pdf_filepdf_open (const char *ident, FILE *file)
 
void pdf_close (pdf_file *pf)
 
void pdf_files_close (void)
 
int check_for_pdf (FILE *file)
 
static int import_dict (pdf_obj *key, pdf_obj *value, void *pdata)
 
static pdf_objpdf_import_indirect (pdf_obj *object)
 
pdf_objpdf_import_object (pdf_obj *object)
 
int pdf_compare_reference (pdf_obj *ref1, pdf_obj *ref2)
 
int pdf_compare_object (pdf_obj *obj1, pdf_obj *obj2)
 

Variables

static int error_out = 0
 
static pdf_out pout
 
static char xchar [] = "0123456789abcdef"
 
static struct ht_tablepdf_files = NULL
 

Macro Definition Documentation

◆ ARRAY_ALLOC_SIZE

#define ARRAY_ALLOC_SIZE   256

Definition at line 51 of file pdfobj.c.

◆ BINARY_MARKER

#define BINARY_MARKER   "%\344\360\355\370\n"

Definition at line 448 of file pdfobj.c.

◆ checklabel

#define checklabel (   pf,
  n,
  g 
)
Value:
((n) > 0 && (n) < (pf)->num_obj && ( \
((pf)->xref_table[(n)].type == 1 && (pf)->xref_table[(n)].field3 == (g)) || \
((pf)->xref_table[(n)].type == 2 && !(g))))
static int pf(int(*writeFunc)(void *stream, const char *data, int size), void *stream, const char *fmt,...)
Definition: HTMLGen.cc:254
#define type(a)
Definition: aptex-macros.h:171
#define n
Definition: t4ht.c:1290
int g
Definition: ppmqvga.c:68

Definition at line 3420 of file pdfobj.c.

◆ IND_OBJECTS_ALLOC_SIZE

#define IND_OBJECTS_ALLOC_SIZE   512

Definition at line 52 of file pdfobj.c.

◆ INVALIDOBJ

#define INVALIDOBJ (   o)    ((o) == NULL || (o)->type <= 0 || (o)->type > PDF_UNDEFINED)

Definition at line 872 of file pdfobj.c.

◆ is_free

#define is_free (   b,
  c 
)    (((b)[(c)/8]) & (1 << (7-((c)%8))))

Definition at line 3214 of file pdfobj.c.

◆ is_space

#define is_space (   c)
Value:
((c) == ' ' || (c) == '\t' || (c) == '\f' || \
(c) == '\r' || (c) == '\n' || (c) == '\0')
#define c(n)
Definition: gpos-common.c:150

Definition at line 2804 of file pdfobj.c.

◆ OBJ_FILE

#define OBJ_FILE (   o)    (((pdf_indirect *)((o)->data))->pf)

Definition at line 3665 of file pdfobj.c.

◆ OBJ_GEN

#define OBJ_GEN (   o)    (((pdf_indirect *)((o)->data))->generation)

Definition at line 3668 of file pdfobj.c.

◆ OBJ_NO_ENCRYPT

#define OBJ_NO_ENCRYPT   (1 << 1)

Definition at line 57 of file pdfobj.c.

◆ OBJ_NO_OBJSTM

#define OBJ_NO_OBJSTM   (1 << 0)

Definition at line 54 of file pdfobj.c.

◆ OBJ_NUM

#define OBJ_NUM (   o)    (((pdf_indirect *)((o)->data))->label)

Definition at line 3667 of file pdfobj.c.

◆ OBJ_OBJ

#define OBJ_OBJ (   o)    (((pdf_indirect *)((o)->data))->obj)

Definition at line 3666 of file pdfobj.c.

◆ OBJSTM_MAX_OBJS

#define OBJSTM_MAX_OBJS   200

Definition at line 187 of file pdfobj.c.

◆ pdf_match_name

#define pdf_match_name (   o,
  s 
)    ((o) && (s) && !strcmp(((pdf_name *)(o)->data)->name, (s)))

Definition at line 1798 of file pdfobj.c.

◆ STREAM_ALLOC_SIZE

#define STREAM_ALLOC_SIZE   4096u

Definition at line 50 of file pdfobj.c.

◆ TYPECHECK

#define TYPECHECK (   o,
  t 
)
Value:
if (!(o) || (o)->type != (t)) {\
ERROR("typecheck: Invalid object type: %d %d (line %d)", (o) ? (o)->type : -1, (t), __LINE__);\
}
Definition: dvips.h:235

Definition at line 868 of file pdfobj.c.

Typedef Documentation

◆ pdf_array

typedef struct pdf_array pdf_array

Definition at line 155 of file pdfobj.c.

◆ pdf_boolean

typedef struct pdf_boolean pdf_boolean

Definition at line 155 of file pdfobj.c.

◆ pdf_dict

typedef struct pdf_dict pdf_dict

Definition at line 155 of file pdfobj.c.

◆ pdf_indirect

typedef struct pdf_indirect pdf_indirect

Definition at line 155 of file pdfobj.c.

◆ pdf_name

typedef struct pdf_name pdf_name

Definition at line 155 of file pdfobj.c.

◆ pdf_null

typedef void pdf_null

Definition at line 155 of file pdfobj.c.

◆ pdf_number

typedef struct pdf_number pdf_number

Definition at line 155 of file pdfobj.c.

◆ pdf_stream

typedef struct pdf_stream pdf_stream

Definition at line 155 of file pdfobj.c.

◆ pdf_string

typedef struct pdf_string pdf_string

Definition at line 155 of file pdfobj.c.

◆ xref_entry

typedef struct xref_entry xref_entry

Function Documentation

◆ add_xref_entry()

static void add_xref_entry ( pdf_out p,
uint32_t  label,
uint8_t  type,
uint32_t  field2,
uint16_t  field3 
)
static

Definition at line 431 of file pdfobj.c.

References ASSERT, IND_OBJECTS_ALLOC_SIZE, label, NULL, p, RENEW, and type.

Referenced by dump_xref_stream(), pdf_add_objstm(), pdf_flush_obj(), and pdf_out_init().

◆ apply_filter_TIFF2_1_2_4()

static void apply_filter_TIFF2_1_2_4 ( unsigned char *  raster,
int32_t  width,
int32_t  height,
int8_t  bpc,
int8_t  num_comp 
)
static

Definition at line 2044 of file pdfobj.c.

References ASSERT, c, cur, height, i, inbuf, j, k, cutout::l, mask, memset(), NEW, outbuf, prev, raster, RELEASE, sub, and width.

Referenced by filter_TIFF2_apply_filter().

◆ backup_line()

static int backup_line ( FILE pdf_input_file)
static

Definition at line 3301 of file pdfobj.c.

References ch, fgetc, pdf_input_file, seek_relative(), and tell_position().

Referenced by find_xref().

◆ check_for_pdf()

int check_for_pdf ( FILE file)

Definition at line 4346 of file pdfobj.c.

References check_for_pdf_version(), pdf_get_version(), and version.

Referenced by embed_image(), extractbb(), main(), pdf_open(), and source_image_type().

◆ check_for_pdf_version()

static int check_for_pdf_version ( FILE file)
static

Definition at line 4335 of file pdfobj.c.

References fgetc, major, minor, and ungetc.

Referenced by check_for_pdf(), and pdf_open().

◆ clean_pdf_out_struct()

static void clean_pdf_out_struct ( pdf_out p)
static

Definition at line 299 of file pdfobj.c.

References memset(), p, and RELEASE.

Referenced by pdf_out_flush().

◆ current_output()

◆ dump_trailer()

static void dump_trailer ( pdf_out p)
static

Definition at line 590 of file pdfobj.c.

References ASSERT, NULL, p, pdf_out_char(), pdf_out_str(), pdf_release_obj(), and write_dict().

Referenced by pdf_out_flush().

◆ dump_xref_stream()

static void dump_xref_stream ( pdf_out p)
static

◆ dump_xref_table()

static void dump_xref_table ( pdf_out p)
static

Definition at line 561 of file pdfobj.c.

References ASSERT, buf, ERROR, i, length, p, pdf_out_str(), sprintf, and type.

Referenced by pdf_out_flush().

◆ extend_xref()

static void extend_xref ( pdf_file pf,
size_t  new_size 
)
static

Definition at line 3731 of file pdfobj.c.

References i, L, new_size(), NULL, pf(), and RENEW.

Referenced by parse_xref_table(), and parse_xrefstm_subsec().

◆ filter_create_predictor_dict()

static pdf_obj* filter_create_predictor_dict ( int  predictor,
int32_t  columns,
int  bpc,
int  colors 
)
static

Definition at line 2168 of file pdfobj.c.

References colors, columns, pdf_add_dict(), pdf_new_dict(), pdf_new_name(), and pdf_new_number().

Referenced by write_stream().

◆ filter_PNG15_apply_filter()

static unsigned char* filter_PNG15_apply_filter ( unsigned char *  raster,
int32_t  columns,
int32_t  rows,
int8_t  bpc,
int8_t  colors,
int32_t length 
)
static

Definition at line 1925 of file pdfobj.c.

References abs, ASSERT, bits_per_pixel(), colors, columns, link_confs::dst, floor, i, j, length, memcpy, min, NEW, p, pp, q, qc(), raster, rows, type, and up.

Referenced by write_stream().

◆ filter_stream_decode()

◆ filter_stream_decode_ASCII85Decode()

static pdf_obj* filter_stream_decode_ASCII85Decode ( const void data,
size_t  len 
)
static

◆ filter_stream_decode_ASCIIHexDecode()

static pdf_obj* filter_stream_decode_ASCIIHexDecode ( const void data,
size_t  len 
)
static

Definition at line 2749 of file pdfobj.c.

References buf, c1, ch, data, link_confs::dst, error, len, n, NEW, NULL, p, pdf_add_stream(), pdf_new_stream(), pos, RELEASE, skip_white(), val, and WARN().

Referenced by filter_stream_decode().

◆ filter_TIFF2_apply_filter()

static unsigned char* filter_TIFF2_apply_filter ( unsigned char *  raster,
int32_t  columns,
int32_t  rows,
int8_t  bpc,
int8_t  colors,
int32_t length 
)
static

Definition at line 2104 of file pdfobj.c.

References apply_filter_TIFF2_1_2_4(), ASSERT, c, colors, columns, cur, link_confs::dst, i, j, length, memcpy, memset(), NEW, pos, prev, raster, RELEASE, rows, sub, and uint8_t.

Referenced by write_stream().

◆ find_xref()

◆ get_objstm_data()

static int * get_objstm_data ( pdf_obj objstm)
static

Definition at line 2417 of file pdfobj.c.

References pdf_obj::data, PDF_STREAM, and TYPECHECK.

Referenced by pdf_add_objstm(), pdf_get_object(), and release_objstm().

◆ import_dict()

static int import_dict ( pdf_obj key,
pdf_obj value,
void pdata 
)
inlinestatic

Definition at line 4360 of file pdfobj.c.

References copy(), key, pdf_add_dict(), pdf_import_object(), and pdf_link_obj().

Referenced by pdf_import_object().

◆ init_pdf_out_struct()

static void init_pdf_out_struct ( pdf_out p)
static

Definition at line 257 of file pdfobj.c.

References ASSERT, memset(), NEW, NULL, p, PDF_NUM_INDIRECT_MAX, and PDF_VERSION_DEFAULT.

Referenced by pdf_out_init().

◆ next_object_offset()

static int next_object_offset ( pdf_file pf,
uint32_t  obj_num 
)
static

Definition at line 3402 of file pdfobj.c.

References curr, i, next, and pf().

Referenced by pdf_get_object(), and read_objstm().

◆ parse_trailer()

static pdf_obj* parse_trailer ( pdf_file pf)
static

◆ parse_xref_stream()

◆ parse_xref_table()

static int parse_xref_table ( pdf_file pf,
size_t  xref_pos 
)
static

◆ parse_xrefstm_field()

static uint32_t parse_xrefstm_field ( const char **  p,
size_t  length,
uint32_t  def 
)
static

Definition at line 3953 of file pdfobj.c.

References def, length, p, and val.

Referenced by parse_xrefstm_subsec().

◆ parse_xrefstm_subsec()

static int parse_xrefstm_subsec ( pdf_file pf,
const char **  p,
size_t length,
int W,
int  wsum,
int  first,
int  size 
)
static

Definition at line 3969 of file pdfobj.c.

References e, extend_xref(), first, length, p, parse_xrefstm_field(), pf(), size, type, uint16_t, uint32_t, W, and WARN().

Referenced by parse_xref_stream().

◆ pdf_add_array()

◆ pdf_add_dict()

int pdf_add_dict ( pdf_obj dict,
pdf_obj key,
pdf_obj value 
)

Definition at line 1680 of file pdfobj.c.

References pdf_obj::data, data, ERROR, INVALIDOBJ, key, NEW, new_node(), NULL, PDF_DICT, PDF_NAME, pdf_name_value(), pdf_release_obj(), strcmp(), and TYPECHECK.

Referenced by add_CIDHMetrics(), add_CIDVMetrics(), add_metrics(), add_SimpleMetrics(), add_TTCIDHMetrics(), add_TTCIDVMetrics(), bmp_include_image(), build_name_tree(), build_page_tree(), cid_add_system_info(), cidbase_get_id(), cidbase_start_font_descriptor(), CIDFont_base_open(), CIDFont_type0_add_CIDSet(), CIDFont_type0_dofont(), CIDFont_type0_open(), CIDFont_type0_open_from_t1(), CIDFont_type0_open_from_t1c(), CIDFont_type0_t1cdofont(), CIDFont_type0_t1dofont(), CIDFont_type2_dofont(), CIDFont_type2_open(), CMap_create_stream(), create_catalog(), create_encoding_resource(), create_xgstate(), do_ann(), do_bead(), do_character(), do_currentfont(), do_findfont(), do_fnt(), do_pfb(), do_pk_font(), do_ttf(), do_widths(), doc_flush_page(), doc_make_form_xobj(), dump_xref_stream(), end_form_xobj(), filter_create_predictor_dict(), finish_articles(), finish_dests_tree(), finish_docinfo(), finish_image(), finish_outline(), finish_page_tree(), flush_bookmarks(), forallresourcecategory(), get_encoding(), get_font_attr(), html_make_link_dict(), iccp_load_profile(), import_dict(), jp2_include_image(), JPEG_get_XMP(), jpeg_include_image(), jpeg_start_image(), make_article(), name_subtree(), page_subtree(), parse_body(), parse_header(), parse_key_val(), parse_pdf_dict(), parse_pdf_dict_extended(), pdf_close_fonts(), pdf_dev_reset_xgstate(), pdf_dev_xgstate_pop(), pdf_doc_add_annot(), pdf_doc_add_bead(), pdf_doc_add_goto(), pdf_doc_add_page_resource(), pdf_doc_add_to_page_fonts(), pdf_doc_add_to_page_resources(), pdf_doc_add_to_page_xobjects(), pdf_doc_bookmarks_down(), pdf_doc_change_outline_depth(), pdf_doc_close(), pdf_doc_close_articles(), pdf_doc_close_bookmarks(), pdf_doc_close_catalog(), pdf_doc_close_docinfo(), pdf_doc_close_names(), pdf_doc_close_page_tree(), pdf_doc_creator(), pdf_doc_end_grabbing(), pdf_doc_finish_page(), pdf_doc_flush_annot(), pdf_doc_get_page_resources(), pdf_doc_make_xform(), pdf_doc_new_page(), pdf_enc_get_encrypt_dict(), pdf_enc_get_extension_dict(), pdf_flush_font(), pdf_font_get_descriptor(), pdf_font_get_resource(), pdf_font_load_pkfont(), pdf_font_load_truetype(), pdf_font_load_type1(), pdf_font_load_type1c(), pdf_font_open_truetype(), pdf_font_open_type0(), pdf_get_font_reference(), pdf_include_page(), pdf_merge_dict(), pdf_new_stream(), pdf_open_document(), pdf_out_flush(), pdf_out_init(), pdf_out_set_encrypt(), pdf_set_info(), pdf_set_root(), pdf_ximage_set_image(), pk_font(), release_objstm(), safeputresdent(), safeputresdict(), sfnt_create_FontFile_stream(), spc_parse_kvpairs(), start_current_page_resources(), start_png_image(), try_load_ToUnicode_CMap(), tt_get_fontdesc(), ttf_font(), ttf_start_font_descriptor(), type0_font(), Type0Font_attach_ToUnicode_stream(), type1_font(), type1_start_font_descriptor(), write_fontfile(), and write_stream().

◆ pdf_add_objstm()

static int pdf_add_objstm ( pdf_out p,
pdf_obj objstm,
pdf_obj object 
)
static

◆ pdf_add_stream()

◆ pdf_array_length()

◆ pdf_boolean_value()

char pdf_boolean_value ( pdf_obj object)

Definition at line 1064 of file pdfobj.c.

References data, PDF_BOOLEAN, and TYPECHECK.

Referenced by pdf_compare_object(), and pdf_include_page().

◆ pdf_check_version()

◆ pdf_close()

void pdf_close ( pdf_file pf)

Definition at line 4320 of file pdfobj.c.

References NULL, and pf().

Referenced by do_pdf(), pdf_copy_clip(), pdf_include_page(), and pdf_open().

◆ pdf_compare_object()

◆ pdf_compare_reference()

int pdf_compare_reference ( pdf_obj ref1,
pdf_obj ref2 
)

◆ pdf_concat_stream()

◆ pdf_deref_obj()

◆ pdf_dict_keys()

◆ pdf_error_cleanup()

void pdf_error_cleanup ( void  )

Definition at line 750 of file pdfobj.c.

References current_output(), MFCLOSE, NULL, and p.

Referenced by error_cleanup().

◆ pdf_file_free()

static void pdf_file_free ( pdf_file pf)
static

Definition at line 4186 of file pdfobj.c.

References i, pdf_release_obj(), pf(), and RELEASE.

Referenced by pdf_files_init(), and pdf_open().

◆ pdf_file_get_catalog()

pdf_obj* pdf_file_get_catalog ( pdf_file pf)

Definition at line 4236 of file pdfobj.c.

References ASSERT, and pf().

Referenced by pdf_doc_get_page(), pdf_doc_get_page_count(), and pdf_include_page().

◆ pdf_file_get_trailer()

pdf_obj* pdf_file_get_trailer ( pdf_file pf)

Definition at line 4225 of file pdfobj.c.

References ASSERT, pdf_link_obj(), and pf().

◆ pdf_file_get_version()

int pdf_file_get_version ( pdf_file pf)

Definition at line 4218 of file pdfobj.c.

References ASSERT, and pf().

Referenced by do_pdf().

◆ pdf_file_new()

static pdf_file* pdf_file_new ( FILE file)
static

Definition at line 4167 of file pdfobj.c.

References ASSERT, file, NEW, NULL, pf(), seek_end(), and tell_position().

Referenced by pdf_open().

◆ pdf_files_close()

void pdf_files_close ( void  )

Definition at line 4327 of file pdfobj.c.

References ASSERT, ht_clear_table(), pdf_files, and RELEASE.

Referenced by extractbb(), and pdf_close_document().

◆ pdf_files_init()

void pdf_files_init ( void  )

Definition at line 4211 of file pdfobj.c.

References ht_init_table(), NEW, pdf_file_free(), and pdf_files.

Referenced by extractbb(), and pdf_open_document().

◆ pdf_flush_obj()

static void pdf_flush_obj ( pdf_out p,
pdf_obj object 
)
static

◆ pdf_foreach_dict()

◆ pdf_get_array()

◆ pdf_get_object()

◆ pdf_get_output_file()

FILE* pdf_get_output_file ( void  )

Definition at line 371 of file pdfobj.c.

References current_output(), and p.

Referenced by error_cleanup().

◆ pdf_get_version()

◆ pdf_get_version_major()

int pdf_get_version_major ( void  )

Definition at line 402 of file pdfobj.c.

References current_output(), and p.

Referenced by get_cidsysinfo(), and jp2_include_image().

◆ pdf_get_version_minor()

int pdf_get_version_minor ( void  )

Definition at line 409 of file pdfobj.c.

References current_output(), and p.

Referenced by get_cidsysinfo(), and jp2_include_image().

◆ pdf_import_indirect()

◆ pdf_import_object()

◆ pdf_label_obj()

static void pdf_label_obj ( pdf_out p,
pdf_obj object 
)
static

Definition at line 909 of file pdfobj.c.

References ASSERT, ERROR, INVALIDOBJ, p, and PDF_NUM_INDIRECT_MAX.

Referenced by pdf_new_ref(), pdf_out_flush(), and pdf_release_obj().

◆ pdf_link_obj()

pdf_obj* pdf_link_obj ( pdf_obj object)

Definition at line 948 of file pdfobj.c.

References ERROR, INVALIDOBJ, and object.

Referenced by add_metrics(), begin_form_xobj(), build_name_tree(), build_page_tree(), cid_call_descendant(), copy_a_gstate(), create_catalog(), create_encoding_resource(), dev_locate_font(), dev_set_font(), do_article(), do_bead(), doc_make_form_xobj(), embed_image(), encoding_ref(), filter_stream_decode(), find_encoding_differences(), finish_page_tree(), flat_table(), flush_bookmarks(), forallresourcecategory(), import_dict(), lookup_reference(), make_article(), make_differences_encoding(), name_subtree(), page_subtree(), parse_xref_stream(), pdf_close_fonts(), pdf_concat_stream(), pdf_deref_obj(), pdf_dev_reset_xgstate(), pdf_dev_set_font(), pdf_dev_set_xgstate(), pdf_dev_xgstate_pop(), pdf_doc_add_bead(), pdf_doc_add_goto(), pdf_doc_begin_grabbing(), pdf_doc_bookmarks_add(), pdf_doc_bookmarks_down(), pdf_doc_change_outline_depth(), pdf_doc_close_catalog(), pdf_doc_finish_page(), pdf_doc_get_page(), pdf_doc_new_page(), pdf_doc_ref_page(), pdf_file_get_trailer(), pdf_get_colorspace_reference(), pdf_get_font_reference(), pdf_get_object(), pdf_get_resource_reference(), pdf_import_indirect(), pdf_import_object(), pdf_merge_dict(), pdf_names_lookup_reference(), pdf_names_reserve(), pdf_ref_file_obj(), pdf_ref_obj(), pdf_ximage_get_reference(), pdf_ximage_set_form(), pdf_ximage_set_image(), pk_font_resource(), putpageresources(), read_xref(), safeputresdent(), safeputresdict(), set_bounding_box(), spc_handler_pdfm_annot(), spc_handler_pdfm_article(), spc_handler_pdfm_bann(), spc_handler_pdfm_bead(), spc_handler_pdfm_names(), spc_handler_pdfm_put(), spc_handler_pdfm_tounicode(), spc_read_color_pdf(), ttf_font_resource(), ttf_fontfile(), type0_font_resource(), type1_font_resource(), and type1_fontfile().

◆ pdf_lookup_dict()

◆ pdf_merge_dict()

◆ pdf_name_value()

◆ pdf_need_white()

static int pdf_need_white ( int  type1,
int  type2 
)
static

Definition at line 849 of file pdfobj.c.

References PDF_ARRAY, PDF_DICT, PDF_NAME, and PDF_STRING.

Referenced by write_array(), and write_dict().

◆ pdf_new_array()

◆ pdf_new_boolean()

pdf_obj* pdf_new_boolean ( char  value)

◆ pdf_new_dict()

pdf_obj* pdf_new_dict ( void  )

Definition at line 1645 of file pdfobj.c.

References data, NEW, NULL, PDF_DICT, pdf_new_obj(), and check-static-inits::result.

Referenced by build_name_tree(), build_page_tree(), cid_add_system_info(), cidbase_get_id(), cidbase_start_font_descriptor(), CIDFont_type0_open(), CIDFont_type0_open_from_t1(), CIDFont_type0_open_from_t1c(), CIDFont_type2_dofont(), CIDFont_type2_open(), CMap_create_stream(), create_catalog(), create_docinfo(), create_encoding_resource(), create_xgstate(), do_bead(), do_currentfont(), do_findfont(), do_fnt(), do_pk_font(), filter_create_predictor_dict(), get_encoding(), html_make_link_dict(), make_article(), name_subtree(), page_subtree(), parse_pdf_dict(), parse_pdf_dict_extended(), pdf_dev_reset_xgstate(), pdf_dev_xgstate_pop(), pdf_dev_xgstate_push(), pdf_doc_add_to_page_fonts(), pdf_doc_add_to_page_xobjects(), pdf_doc_begin_grabbing(), pdf_doc_bookmarks_down(), pdf_doc_break_annot(), pdf_doc_close_bookmarks(), pdf_doc_close_catalog(), pdf_doc_close_names(), pdf_doc_current_page_resources(), pdf_doc_finish_page(), pdf_doc_flush_annot(), pdf_doc_get_dictionary(), pdf_doc_get_page_resources(), pdf_doc_init_catalog(), pdf_doc_init_docinfo(), pdf_doc_init_page_tree(), pdf_doc_new_page(), pdf_doc_ref_page(), pdf_doc_start_article(), pdf_enc_get_encrypt_dict(), pdf_enc_get_extension_dict(), pdf_font_get_descriptor(), pdf_font_get_resource(), pdf_font_load_pkfont(), pdf_font_open_type0(), pdf_get_font_resource(), pdf_import_object(), pdf_include_page(), pdf_new_stream(), pdf_out_init(), pk_font(), spc_handler_html_default(), spc_handler_pdfm_bead(), spc_parse_kvpairs(), start_current_page_resources(), start_name_tree(), start_outline_tree(), start_page_tree(), tt_get_fontdesc(), ttf_font(), ttf_start_font_descriptor(), type0_font(), type1_font(), and type1_start_font_descriptor().

◆ pdf_new_indirect()

pdf_obj* pdf_new_indirect ( pdf_file pf,
uint32_t  obj_num,
uint16_t  obj_gen 
)

◆ pdf_new_name()

pdf_obj* pdf_new_name ( const char *  name)

Definition at line 1330 of file pdfobj.c.

References data, length, memcpy, name, NEW, NULL, PDF_NAME, pdf_new_obj(), check-static-inits::result, and strlen().

Referenced by add_CIDHMetrics(), add_CIDVMetrics(), add_metrics(), add_SimpleMetrics(), add_TTCIDHMetrics(), add_TTCIDVMetrics(), bmp_include_image(), build_name_tree(), build_page_tree(), cid_add_system_info(), cidbase_get_id(), cidbase_start_font_descriptor(), CIDFont_base_open(), CIDFont_type0_add_CIDSet(), CIDFont_type0_dofont(), CIDFont_type0_open(), CIDFont_type0_open_from_t1(), CIDFont_type0_open_from_t1c(), CIDFont_type0_t1cdofont(), CIDFont_type0_t1dofont(), CIDFont_type2_dofont(), CIDFont_type2_open(), CMap_create_stream(), create_catalog(), create_encoding_resource(), create_xgstate(), do_ann(), do_bead(), do_character(), do_currentfont(), do_findfont(), do_fnt(), do_operator(), do_pfb(), do_pk_font(), do_ttf(), do_widths(), doc_flush_page(), doc_make_form_xobj(), dump_xref_stream(), end_form_xobj(), filter_create_predictor_dict(), finish_articles(), finish_dests_tree(), finish_docinfo(), finish_image(), finish_outline(), flush_bookmarks(), forallresourcecategory(), get_encoding(), get_font_attr(), html_make_dest(), html_make_link_dict(), iccp_get_rendering_intent(), iccp_load_profile(), jp2_include_image(), JPEG_get_XMP(), jpeg_include_image(), jpeg_start_image(), make_article(), make_encoding_differences(), make_short_cuts(), name_subtree(), parse_body(), parse_header(), parse_key_val(), parse_pdf_name(), pdf_close_fonts(), pdf_dict_keys(), pdf_doc_add_annot(), pdf_doc_add_bead(), pdf_doc_add_goto(), pdf_doc_add_page_resource(), pdf_doc_add_to_page_fonts(), pdf_doc_add_to_page_resources(), pdf_doc_add_to_page_xobjects(), pdf_doc_bookmarks_down(), pdf_doc_change_outline_depth(), pdf_doc_close(), pdf_doc_close_articles(), pdf_doc_close_bookmarks(), pdf_doc_close_catalog(), pdf_doc_close_docinfo(), pdf_doc_close_names(), pdf_doc_close_page_tree(), pdf_doc_creator(), pdf_doc_end_grabbing(), pdf_doc_finish_page(), pdf_doc_flush_annot(), pdf_doc_get_page_resources(), pdf_doc_make_xform(), pdf_enc_get_encrypt_dict(), pdf_enc_get_extension_dict(), pdf_encoding_new_encoding(), pdf_flush_font(), pdf_font_get_descriptor(), pdf_font_get_resource(), pdf_font_load_pkfont(), pdf_font_load_truetype(), pdf_font_load_type1(), pdf_font_load_type1c(), pdf_font_open_truetype(), pdf_font_open_type0(), pdf_get_font_reference(), pdf_include_page(), pdf_new_stream(), pdf_open_document(), pdf_out_flush(), pdf_out_init(), pdf_out_set_encrypt(), pdf_set_info(), pdf_set_root(), pdf_ximage_set_image(), pk_font(), release_objstm(), safeputresdict(), sfnt_create_FontFile_stream(), spc_handler_pdfm__init(), spc_parse_kvpairs(), start_current_page_resources(), start_png_image(), try_load_ToUnicode_CMap(), tt_get_fontdesc(), ttf_font(), ttf_start_font_descriptor(), type0_font(), Type0Font_attach_ToUnicode_stream(), type1_font(), type1_start_font_descriptor(), write_fontfile(), and write_stream().

◆ pdf_new_null()

◆ pdf_new_number()

pdf_obj* pdf_new_number ( double  value)

Definition at line 1076 of file pdfobj.c.

References data, NEW, pdf_new_obj(), PDF_NUMBER, and check-static-inits::result.

Referenced by add_CIDHMetrics(), add_CIDVMetrics(), add_metrics(), add_SimpleMetrics(), add_TTCIDHMetrics(), add_TTCIDVMetrics(), begin_form_xobj(), bmp_include_image(), build_page_tree(), build_scale_array(), cid_add_system_info(), cidbase_get_id(), cidbase_start_font_descriptor(), CIDFont_type0_dofont(), CIDFont_type0_open(), CIDFont_type0_open_from_t1(), CIDFont_type0_open_from_t1c(), CIDFont_type0_t1cdofont(), CIDFont_type2_dofont(), CMap_create_stream(), create_xgstate(), do_ann(), do_bead(), do_currentfont(), do_findfont(), do_fnt(), do_one_ps_line(), do_operator(), do_pfb(), do_pk_font(), do_ttf(), do_widths(), doc_flush_page(), doc_make_form_xobj(), dump_xref_stream(), filter_create_predictor_dict(), find_encoding_differences(), finish_page_tree(), flush_bookmarks(), get_font_attr(), html_make_dest(), html_make_link_dict(), iccp_load_profile(), jp2_include_image(), jpeg_include_image(), jpeg_start_image(), lookup_reference(), make_article(), make_differences_encoding(), make_encoding_differences(), mp_parse_body(), page_subtree(), parse_body(), parse_header(), parse_pdf_number(), pdf_doc_add_annot(), pdf_doc_bookmarks_down(), pdf_doc_change_outline_depth(), pdf_doc_close_bookmarks(), pdf_doc_close_page_tree(), pdf_doc_flush_annot(), pdf_doc_make_xform(), pdf_enc_get_encrypt_dict(), pdf_enc_get_extension_dict(), pdf_font_load_pkfont(), pdf_font_load_type1c(), pdf_font_open_truetype(), pdf_include_page(), pdf_out_flush(), pdf_ximage_set_image(), release_objstm(), sfnt_create_FontFile_stream(), spc_lookup_object(), spc_lookup_reference(), start_png_image(), tt_get_fontdesc(), ttf_font(), ttf_start_font_descriptor(), type1_font(), type1_start_font_descriptor(), and write_stream().

◆ pdf_new_obj()

◆ pdf_new_ref()

static pdf_obj * pdf_new_ref ( pdf_out p,
pdf_obj object 
)
static

◆ pdf_new_stream()

◆ pdf_new_string()

◆ pdf_new_undefined()

pdf_obj* pdf_new_undefined ( void  )

Definition at line 1006 of file pdfobj.c.

References NULL, pdf_new_obj(), PDF_UNDEFINED, and check-static-inits::result.

Referenced by pdf_names_reserve().

◆ pdf_number_value()

◆ pdf_obj_typeof()

◆ pdf_open()

◆ pdf_out_char()

static void pdf_out_char ( pdf_out p,
char  c 
)
static

◆ pdf_out_flush()

◆ pdf_out_init()

pdf_out* pdf_out_init ( const char *  filename,
const unsigned char *  id1,
const unsigned char *  id2,
int  ver_major,
int  ver_minor,
int  compression_level,
int  enable_encrypt,
int  enable_objstm,
int  enable_predictor 
)

◆ pdf_out_set_compression()

static void pdf_out_set_compression ( pdf_out p,
int  level 
)
static

Definition at line 349 of file pdfobj.c.

References ASSERT, ERROR, level, p, and WARN().

Referenced by pdf_out_init().

◆ pdf_out_set_encrypt()

void pdf_out_set_encrypt ( int  keybits,
int32_t  permission,
const char *  opasswd,
const char *  upasswd,
int  use_aes,
int  encrypt_metadata 
)

◆ pdf_out_set_version()

static void pdf_out_set_version ( pdf_out p,
int  ver_major,
int  ver_minor 
)
static

Definition at line 378 of file pdfobj.c.

References ASSERT, p, PDF_VERSION_MAX, PDF_VERSION_MIN, version, and WARN().

Referenced by pdf_out_init().

◆ pdf_out_str()

◆ pdf_out_white()

static void pdf_out_white ( pdf_out p)
static

Definition at line 857 of file pdfobj.c.

References ASSERT, p, and pdf_out_char().

Referenced by write_array(), and write_dict().

◆ pdf_out_xchar()

static void pdf_out_xchar ( pdf_out p,
char  c 
)
static

Definition at line 816 of file pdfobj.c.

References ASSERT, c, p, pdf_out_char(), and xchar.

Referenced by write_name(), and write_string().

◆ pdf_read_object()

static pdf_obj* pdf_read_object ( uint32_t  obj_num,
uint16_t  obj_gen,
pdf_file pf,
size_t  offset,
size_t  limit 
)
static

◆ pdf_ref_obj()

pdf_obj* pdf_ref_obj ( pdf_obj object)

Definition at line 960 of file pdfobj.c.

References current_output(), ERROR, error_out, INVALIDOBJ, MESG(), p, pdf_link_obj(), pdf_new_ref(), PDF_OBJ_INDIRECTTYPE, and pdf_write_obj().

Referenced by add_CIDHMetrics(), add_CIDVMetrics(), add_metrics(), add_reference(), add_SimpleMetrics(), add_TTCIDHMetrics(), add_TTCIDVMetrics(), begin_form_xobj(), build_name_tree(), build_page_tree(), cidbase_get_id(), CIDFont_type0_add_CIDSet(), CIDFont_type0_dofont(), CIDFont_type0_t1cdofont(), CIDFont_type0_t1create_ToUnicode_stream(), CIDFont_type0_t1dofont(), CIDFont_type2_dofont(), do_ann(), do_character(), do_dest(), do_operator(), do_pk_font(), do_thumbnail(), do_widths(), doc_flush_page(), embed_image(), end_form_xobj(), finish_articles(), finish_dests_tree(), finish_outline(), flush_bookmarks(), get_encoding(), html_make_dest(), html_make_link_dict(), iccp_load_profile(), init_pdf_backend_functions(), jpeg_include_image(), lookup_reference(), make_article(), name_subtree(), page_subtree(), pdf_close_fonts(), pdf_defineresource(), pdf_doc_add_annot(), pdf_doc_add_bead(), pdf_doc_change_outline_depth(), pdf_doc_close(), pdf_doc_close_articles(), pdf_doc_close_bookmarks(), pdf_doc_close_catalog(), pdf_doc_close_names(), pdf_doc_close_page_tree(), pdf_doc_end_grabbing(), pdf_doc_finish_page(), pdf_doc_flush_annot(), pdf_doc_new_page(), pdf_doc_ref_page(), pdf_flush_font(), pdf_font_load_pkfont(), pdf_font_load_truetype(), pdf_font_load_type1(), pdf_font_load_type1c(), pdf_get_colorspace_reference(), pdf_get_font_reference(), pdf_get_resource_reference(), pdf_include_page(), pdf_names_lookup_reference(), pdf_names_reserve(), pdf_out_set_encrypt(), pdf_ref_file_obj(), pdf_set_info(), pdf_set_root(), pdf_ximage_get_reference(), pdf_ximage_set_form(), pdf_ximage_set_image(), pfb_get_id(), pk_font_resource(), set_fillstyle(), spc_lookup_reference(), start_page_tree(), try_load_ToUnicode_CMap(), ttf_font(), ttf_get_id(), type0_font(), type1_font(), and write_fontfile().

◆ pdf_release_obj()

void pdf_release_obj ( pdf_obj object)

Definition at line 3217 of file pdfobj.c.

References current_output(), data, ERROR, error_out, object::generation, INVALIDOBJ, MESG(), NEW, NULL, OBJ_NO_ENCRYPT, OBJ_NO_OBJSTM, OBJSTM_MAX_OBJS, p, pdf_add_objstm(), PDF_ARRAY, PDF_BOOLEAN, PDF_DICT, pdf_flush_obj(), PDF_INDIRECT, pdf_label_obj(), PDF_NAME, pdf_new_stream(), PDF_NULL, PDF_NUMBER, PDF_STREAM, PDF_STRING, pdf_write_obj(), RELEASE, release_array(), release_boolean(), release_dict(), release_indirect(), release_name(), release_number(), release_objstm(), release_stream(), release_string(), set_objstm_data(), and STREAM_COMPRESS.

Referenced by add_CIDHMetrics(), add_CIDVMetrics(), add_metrics(), add_SimpleMetrics(), add_TTCIDHMetrics(), add_TTCIDVMetrics(), bmp_include_image(), build_name_tree(), build_page_tree(), cat_contents(), cid_flush_all(), cidbase_get_id(), CIDFont_type0_add_CIDSet(), CIDFont_type0_t1create_ToUnicode_stream(), CIDFont_type2_dofont(), clean_bookmarks(), clear_a_gstate(), clear_xgstate(), cvr_array(), dev_close_all_fonts(), do_ann(), do_bcolor(), do_bead(), do_bgcolor(), do_character(), do_clear(), do_currentfont(), do_dest(), do_docinfo(), do_docview(), do_eann(), do_findfont(), do_image(), do_operator(), do_outline(), do_pdf(), do_pfb(), do_pk_font(), do_put(), do_scalefont(), do_scolor(), do_setfont(), do_show(), do_texfig(), do_thumbnail(), do_ttf(), do_widths(), doc_flush_page(), dump_trailer(), dump_xref_stream(), encoding_flush_all(), end_form_xobj(), finish_articles(), finish_dests_tree(), finish_docinfo(), finish_outline(), finish_page_tree(), flush_bookmarks(), forallresourcecategory(), get_encoding(), get_numbers_from_stack(), get_page_content(), html_end_anchor(), html_make_dest(), html_make_link_dict(), hval_free(), iccp_load_profile(), JPEG_get_iccp(), jpeg_include_image(), load_encoding_file(), make_article(), make_encoding_differences(), make_tt_subset(), mp_cleanup(), mps_stack_clear_to(), name_subtree(), page_subtree(), parse_body(), parse_header(), parse_pdf_array(), parse_pdf_array_extended(), parse_pdf_dict(), parse_pdf_dict_extended(), parse_pdf_dict_with_tounicode(), parse_pdf_object(), parse_pdf_object_extended(), parse_pdf_stream(), parse_psfile(), parse_xref_stream(), pdf_add_dict(), pdf_clean_colorspace_struct(), pdf_clean_encoding_struct(), pdf_clean_resource(), pdf_clean_ximage_struct(), pdf_close(), pdf_close_device(), pdf_compare_object(), pdf_concat_stream(), pdf_copy_clip(), pdf_defineresource(), pdf_deref_obj(), pdf_dev_reset_xgstate(), pdf_dev_set_xgstate(), pdf_dev_xgstate_pop(), pdf_doc_add_bead(), pdf_doc_add_goto(), pdf_doc_add_page_resource(), pdf_doc_bookmarks_down(), pdf_doc_break_annot(), pdf_doc_change_outline_depth(), pdf_doc_close(), pdf_doc_close_articles(), pdf_doc_close_bookmarks(), pdf_doc_close_catalog(), pdf_doc_close_docinfo(), pdf_doc_close_names(), pdf_doc_close_page_tree(), pdf_doc_end_annot(), pdf_doc_end_grabbing(), pdf_doc_finish_page(), pdf_doc_flush_annot(), pdf_doc_get_page(), pdf_doc_get_page_count(), pdf_doc_get_page_resources(), pdf_doc_init_names(), pdf_doc_set_bop_content(), pdf_doc_set_eop_content(), pdf_file_free(), pdf_finish_specials(), pdf_flush_colorspace(), pdf_flush_encoding(), pdf_flush_font(), pdf_flush_resource(), pdf_font_load_pkfont(), pdf_font_load_truetype(), pdf_font_load_type1(), pdf_font_load_type1c(), pdf_font_open_truetype(), pdf_font_open_type1c(), pdf_get_colorspace_reference(), pdf_import_indirect(), pdf_import_object(), pdf_include_page(), pdf_names_add_object(), pdf_names_close_object(), pdf_open(), pdf_out_set_encrypt(), pdf_read_object(), pdf_remove_dict(), pdf_ximage_set_form(), pdf_ximage_set_image(), pdfcolorstack__clean(), pdfcolorstack__pop(), pdfcolorstack__set(), pfb_find_name(), pfb_release(), pk_close_all(), pop_get_numbers(), read_objstm(), read_xref(), release_array(), release_dict(), release_objstm(), release_reference(), release_short_cuts(), release_stream(), safeputresdict(), scan_special_encrypt(), scan_special_trailerid(), set_bounding_box(), set_fillstyle(), sfnt_create_FontFile_stream(), spc_handler_html_default(), spc_handler_pdffontattr(), spc_handler_pdfm__clean(), spc_handler_pdfm_annot(), spc_handler_pdfm_bann(), spc_handler_pdfm_bead(), spc_handler_pdfm_bxgstate(), spc_handler_pdfm_dest(), spc_handler_pdfm_docinfo(), spc_handler_pdfm_docview(), spc_handler_pdfm_eann(), spc_handler_pdfm_eform(), spc_handler_pdfm_image(), spc_handler_pdfm_names(), spc_handler_pdfm_outline(), spc_handler_pdfm_pageresources(), spc_handler_pdfm_put(), spc_handler_pdfm_stream_with_type(), spc_handler_pdfm_tounicode(), spc_html__anchor_close(), spc_misc_at_end_document(), spc_parse_kvpairs(), spc_read_color_pdf(), try_load_ToUnicode_CMap(), ttf_close_all(), ttf_font(), ttf_release(), type0_close_all(), type0_font(), type1_close_all(), type1_font(), write_fontfile(), and write_indirect().

◆ pdf_remove_dict()

◆ pdf_set_info()

void pdf_set_info ( pdf_obj object)

◆ pdf_set_number()

void pdf_set_number ( pdf_obj object,
double  value 
)

Definition at line 1108 of file pdfobj.c.

References data, PDF_NUMBER, and TYPECHECK.

Referenced by do_operator(), and do_scalefont().

◆ pdf_set_root()

void pdf_set_root ( pdf_obj object)

◆ pdf_set_string()

void pdf_set_string ( pdf_obj object,
unsigned char *  str,
unsigned  length 
)

Definition at line 1307 of file pdfobj.c.

References data, length, memcpy, NEW, NULL, PDF_STRING, RELEASE, str, and TYPECHECK.

Referenced by reencode_string(), and reencode_string_from_utf8_to_utf16be().

◆ pdf_stream_dataptr()

◆ pdf_stream_dict()

◆ pdf_stream_length()

◆ pdf_stream_set_predictor()

void pdf_stream_set_predictor ( pdf_obj stream,
int  predictor,
int32_t  columns,
int  bpc,
int  colors 
)

Definition at line 1894 of file pdfobj.c.

References colors, columns, data, pdf_obj_typeof(), PDF_STREAM, and STREAM_USE_PREDICTOR.

Referenced by bmp_include_image().

◆ pdf_stream_uncompress()

◆ pdf_string_length()

◆ pdf_string_value()

◆ pdf_transfer_label()

void pdf_transfer_label ( pdf_obj dst,
pdf_obj src 
)

Definition at line 933 of file pdfobj.c.

References ASSERT, link_confs::dst, and link_confs::src.

Referenced by pdf_names_add_object().

◆ pdf_unshift_array()

static void pdf_unshift_array ( pdf_obj array,
pdf_obj object 
)
static

Definition at line 1585 of file pdfobj.c.

References ARRAY_ALLOC_SIZE, data, memmove, object, PDF_ARRAY, RENEW, and TYPECHECK.

Referenced by write_stream().

◆ pdf_write_obj()

◆ pdfobj_escape_str()

int pdfobj_escape_str ( char *  buffer,
int  bufsize,
const unsigned char *  s,
int  len 
)

Definition at line 1183 of file pdfobj.c.

References bufsize, ch, ERROR, i, isdigit, len, check-static-inits::result, s, and sprintf.

Referenced by dev_set_string(), pdf_dev_set_string(), and write_string().

◆ read_objstm()

◆ read_xref()

◆ release_array()

static void release_array ( pdf_array array)
static

Definition at line 1491 of file pdfobj.c.

References data, i, NULL, pdf_release_obj(), and RELEASE.

Referenced by pdf_release_obj().

◆ release_boolean()

static void release_boolean ( pdf_obj data)
static

Definition at line 1048 of file pdfobj.c.

References data, and RELEASE.

Referenced by pdf_release_obj().

◆ release_dict()

static void release_dict ( pdf_dict dict)
static

Definition at line 1661 of file pdfobj.c.

References data, next, NULL, pdf_release_obj(), and RELEASE.

Referenced by pdf_release_obj().

◆ release_indirect()

static void release_indirect ( pdf_indirect data)
static

Definition at line 983 of file pdfobj.c.

References data, and RELEASE.

Referenced by pdf_release_obj().

◆ release_name()

static void release_name ( pdf_name name)
static

Definition at line 1394 of file pdfobj.c.

References data, NULL, and RELEASE.

Referenced by pdf_release_obj().

◆ release_number()

static void release_number ( pdf_number number)
static

Definition at line 1090 of file pdfobj.c.

References data, and RELEASE.

Referenced by pdf_release_obj().

◆ release_objstm()

◆ release_stream()

static void release_stream ( pdf_stream stream)
static

Definition at line 2355 of file pdfobj.c.

References NULL, pdf_release_obj(), and RELEASE.

Referenced by pdf_release_obj().

◆ release_string()

static void release_string ( pdf_string str)
static

Definition at line 1297 of file pdfobj.c.

References data, NULL, and RELEASE.

Referenced by pdf_release_obj().

◆ set_objstm_data()

static void set_objstm_data ( pdf_obj objstm,
int data 
)
static

Definition at line 2410 of file pdfobj.c.

References pdf_obj::data, data, PDF_STREAM, and TYPECHECK.

Referenced by pdf_release_obj(), and read_objstm().

◆ skip_white_a85()

static void skip_white_a85 ( const char **  p,
const char *  endptr 
)
static

Definition at line 2807 of file pdfobj.c.

References is_space, and p.

Referenced by filter_stream_decode_ASCII85Decode().

◆ write_array()

static void write_array ( pdf_out p,
pdf_array array 
)
static

Definition at line 1437 of file pdfobj.c.

References ASSERT, i, p, pdf_need_white(), pdf_out_char(), pdf_out_white(), PDF_UNDEFINED, pdf_write_obj(), and WARN().

Referenced by pdf_write_obj().

◆ write_boolean()

static void write_boolean ( pdf_out p,
pdf_boolean data 
)
static

Definition at line 1054 of file pdfobj.c.

References data, p, and pdf_out_str().

Referenced by pdf_write_obj().

◆ write_dict()

static void write_dict ( pdf_out p,
pdf_dict dict 
)
static

◆ write_indirect()

static void write_indirect ( pdf_out p,
pdf_indirect indirect 
)
static

◆ write_name()

static void write_name ( pdf_out p,
pdf_name name 
)
static

Definition at line 1352 of file pdfobj.c.

References ASSERT, i, is_delim, length, name, p, pdf_out_char(), pdf_out_xchar(), s, and strlen().

Referenced by pdf_write_obj().

◆ write_null()

static void write_null ( pdf_out p)
static

Definition at line 1028 of file pdfobj.c.

References p, and pdf_out_str().

Referenced by pdf_write_obj().

◆ write_number()

static void write_number ( pdf_out p,
pdf_number number 
)
static

Definition at line 1096 of file pdfobj.c.

References buf, count, p, pdf_out_str(), and pdf_sprint_number().

Referenced by pdf_write_obj().

◆ write_stream()

◆ write_string()

static void write_string ( pdf_out p,
pdf_string str 
)
static

Variable Documentation

◆ error_out

int error_out = 0
static

◆ pdf_files

struct ht_table* pdf_files = NULL
static

Definition at line 4164 of file pdfobj.c.

Referenced by pdf_files_close(), pdf_files_init(), and pdf_open().

◆ pout

◆ xchar

char xchar[] = "0123456789abcdef"
static

Definition at line 813 of file pdfobj.c.

Referenced by pdf_out_xchar().