2
* PDF file output routines.
4
* Copyright 2008 by Tobias Hoffmann.
6
* This file is licensed as noted in "LICENSE.txt"
7
* which should have been included with this file. If this file is
8
* file is missing or damaged, see the license at "http://www.cups.org/".
20
int pagessize,pagesalloc;
23
int xrefsize,xrefalloc;
30
/* allocates a new pdfOut structure
31
* returns NULL on error
34
void pdfOut_free(pdfOut *pdf);
36
/* start outputting a pdf
37
* returns false on error
39
int pdfOut_begin_pdf(pdfOut *pdf);
40
void pdfOut_finish_pdf(pdfOut *pdf);
42
/* General output routine for our pdf.
43
* Keeps track of characters actually written out
45
void pdfOut_printf(pdfOut *pdf,const char *fmt,...);
47
/* write out an escaped pdf string: e.g. (Text \(Test\)\n)
48
* >len==-1: use strlen(str)
50
void pdfOut_putString(pdfOut *pdf,const char *str,int len);
51
void pdfOut_putHexString(pdfOut *pdf,const char *str,int len);
53
/* Format the broken up timestamp according to
54
* pdf requirements for /CreationDate
55
* NOTE: uses statically allocated buffer
57
const char *pdfOut_to_pdfdate(struct tm *curtm);
59
/* begin a new object at current point of the
60
* output stream and add it to the xref table.
61
* returns the obj number.
63
int pdfOut_add_xref(pdfOut *pdf);
65
/* adds page dictionary >obj to the global Pages tree
66
* returns false on error
68
int pdfOut_add_page(pdfOut *pdf,int obj);
70
/* add a >key,>val pair to the document's Info dictionary
71
* returns false on error
73
int pdfOut_add_kv(pdfOut *pdf,const char *key,const char *val);
75
/* Writes the font >emb including descriptor to the pdf
76
* and returns the object number.
77
* On error 0 is returned.
80
int pdfOut_write_font(pdfOut *pdf,struct _EMB_PARAMS *emb);