pdf.h

Sat, 08 Mar 2003 06:52:09 +0000

author
eric
date
Sat, 08 Mar 2003 06:52:09 +0000
changeset 85
dcfd1d4b5c24
parent 75
29d7cbc7c251
child 107
312753062c5b
permissions
-rw-r--r--

add linked list of name trees to struct pdf_file, and finalize all name trees when PDF file is closed.

eric@62 1 /*
eric@62 2 * t2p: Create a PDF file from the contents of one or more TIFF
eric@62 3 * bilevel image files. The images in the resulting PDF file
eric@62 4 * will be compressed using ITU-T T.6 (G4) fax encoding.
eric@62 5 *
eric@62 6 * PDF routines
eric@75 7 * $Id: pdf.h,v 1.6 2003/03/04 18:09:49 eric Exp $
eric@62 8 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
eric@62 9 *
eric@62 10 * This program is free software; you can redistribute it and/or modify
eric@62 11 * it under the terms of the GNU General Public License version 2 as
eric@62 12 * published by the Free Software Foundation. Note that permission is
eric@62 13 * not granted to redistribute this program under the terms of any
eric@62 14 * other version of the General Public License.
eric@62 15 *
eric@62 16 * This program is distributed in the hope that it will be useful,
eric@62 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eric@62 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eric@62 19 * GNU General Public License for more details.
eric@62 20 *
eric@62 21 * You should have received a copy of the GNU General Public License
eric@62 22 * along with this program; if not, write to the Free Software
eric@62 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
eric@62 24 */
eric@62 25
eric@62 26
eric@59 27 typedef struct pdf_file *pdf_file_handle;
eric@59 28
eric@59 29 typedef struct pdf_page *pdf_page_handle;
eric@59 30
eric@74 31 typedef struct pdf_bookmark *pdf_bookmark_handle;
eric@74 32
eric@59 33
eric@75 34 #define PDF_PAGE_MODE_USE_NONE 0
eric@75 35 #define PDF_PAGE_MODE_USE_OUTLINES 1
eric@75 36 #define PDF_PAGE_MODE_USE_THUMBS 2 /* not yet implemented */
eric@75 37
eric@75 38
eric@59 39 void pdf_init (void);
eric@59 40
eric@75 41 pdf_file_handle pdf_create (char *filename, int page_mode);
eric@59 42
eric@59 43 void pdf_close (pdf_file_handle pdf_file);
eric@59 44
eric@59 45 void pdf_set_author (pdf_file_handle pdf_file, char *author);
eric@59 46 void pdf_set_creator (pdf_file_handle pdf_file, char *author);
eric@59 47 void pdf_set_title (pdf_file_handle pdf_file, char *author);
eric@59 48 void pdf_set_subject (pdf_file_handle pdf_file, char *author);
eric@59 49 void pdf_set_keywords (pdf_file_handle pdf_file, char *author);
eric@59 50
eric@59 51
eric@59 52 /* width and height in units of 1/72 inch */
eric@59 53 pdf_page_handle pdf_new_page (pdf_file_handle pdf_file,
eric@59 54 double width,
eric@59 55 double height);
eric@59 56
eric@59 57 void pdf_close_page (pdf_page_handle pdf_page);
eric@59 58
eric@59 59
eric@59 60 /* The length of the data must be Rows * rowbytes.
eric@59 61 Note that rowbytes must be at least (Columns+7)/8, but may be arbitrarily
eric@59 62 large. */
eric@59 63 void pdf_write_g4_fax_image (pdf_page_handle pdf_page,
eric@64 64 double x,
eric@64 65 double y,
eric@64 66 double width,
eric@64 67 double height,
eric@62 68 Bitmap *bitmap,
eric@66 69 bool ImageMask,
eric@66 70 double r, /* RGB fill color, only for ImageMask */
eric@66 71 double g,
eric@66 72 double b,
eric@66 73 bool BlackIs1); /* boolean, typ. false */
eric@59 74
eric@59 75
eric@59 76 void pdf_set_page_number (pdf_page_handle pdf_page, char *page_number);
eric@59 77
eric@74 78 /* Create a new bookmark, under the specified parent, or at the top
eric@74 79 level if parent is NULL. */
eric@74 80 pdf_bookmark_handle pdf_new_bookmark (pdf_bookmark_handle parent,
eric@74 81 char *title,
eric@74 82 bool open,
eric@74 83 pdf_page_handle pdf_page);
eric@59 84
eric@59 85 void pdf_insert_tiff_image (pdf_page_handle pdf_page, char *filename);