Fri, 14 Mar 2003 08:57:40 +0000
specify page mode when file is closed rather than when it is initially created. if USE_OUTLINES but no bookmarks, use USE_NONE instead.
1 /*
2 * tumble: build a PDF file from image files
3 *
4 * PDF routines
5 * $Id: pdf.h,v 1.11 2003/03/14 00:57:40 eric Exp $
6 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. Note that permission is
11 * not granted to redistribute this program under the terms of any
12 * other version of the General Public License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
22 */
25 typedef struct pdf_file *pdf_file_handle;
27 typedef struct pdf_page *pdf_page_handle;
29 typedef struct pdf_bookmark *pdf_bookmark_handle;
32 #define PDF_PAGE_MODE_USE_NONE 0
33 #define PDF_PAGE_MODE_USE_OUTLINES 1 /* if no outlines, will use NONE */
34 #define PDF_PAGE_MODE_USE_THUMBS 2 /* not yet implemented */
37 void pdf_init (void);
39 pdf_file_handle pdf_create (char *filename);
41 void pdf_close (pdf_file_handle pdf_file, int page_mode);
43 void pdf_set_author (pdf_file_handle pdf_file, char *author);
44 void pdf_set_creator (pdf_file_handle pdf_file, char *author);
45 void pdf_set_title (pdf_file_handle pdf_file, char *author);
46 void pdf_set_subject (pdf_file_handle pdf_file, char *author);
47 void pdf_set_keywords (pdf_file_handle pdf_file, char *author);
50 /* width and height in units of 1/72 inch */
51 pdf_page_handle pdf_new_page (pdf_file_handle pdf_file,
52 double width,
53 double height);
55 void pdf_close_page (pdf_page_handle pdf_page);
58 void pdf_write_text (pdf_page_handle pdf_page);
61 /* The length of the data must be Rows * rowbytes.
62 Note that rowbytes must be at least (Columns+7)/8, but may be arbitrarily
63 large. */
64 void pdf_write_g4_fax_image (pdf_page_handle pdf_page,
65 double x,
66 double y,
67 double width,
68 double height,
69 Bitmap *bitmap,
70 bool ImageMask,
71 double r, /* RGB fill color, only for ImageMask */
72 double g,
73 double b,
74 bool BlackIs1); /* boolean, typ. false */
77 void pdf_write_jpeg_image (pdf_page_handle pdf_page,
78 double x,
79 double y,
80 double width,
81 double height,
82 FILE *f);
85 void pdf_set_page_number (pdf_page_handle pdf_page, char *page_number);
87 /* Create a new bookmark, under the specified parent, or at the top
88 level if parent is NULL. */
89 pdf_bookmark_handle pdf_new_bookmark (pdf_bookmark_handle parent,
90 char *title,
91 bool open,
92 pdf_page_handle pdf_page);
95 void pdf_new_page_label (pdf_file_handle pdf_file,
96 int page_index,
97 int base,
98 int count,
99 char style,
100 char *prefix);