pdf.h

Wed, 05 Mar 2003 01:58:36 +0000

author
eric
date
Wed, 05 Mar 2003 01:58:36 +0000
changeset 74
12bc5088172e
parent 66
6e0551b59dba
child 75
29d7cbc7c251
permissions
-rw-r--r--

added bookmark support.

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@74 7 * $Id: pdf.h,v 1.5 2003/03/04 17:58:36 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@59 34 void pdf_init (void);
eric@59 35
eric@59 36 pdf_file_handle pdf_create (char *filename);
eric@59 37
eric@59 38 void pdf_close (pdf_file_handle pdf_file);
eric@59 39
eric@59 40 void pdf_set_author (pdf_file_handle pdf_file, char *author);
eric@59 41 void pdf_set_creator (pdf_file_handle pdf_file, char *author);
eric@59 42 void pdf_set_title (pdf_file_handle pdf_file, char *author);
eric@59 43 void pdf_set_subject (pdf_file_handle pdf_file, char *author);
eric@59 44 void pdf_set_keywords (pdf_file_handle pdf_file, char *author);
eric@59 45
eric@59 46
eric@59 47 /* width and height in units of 1/72 inch */
eric@59 48 pdf_page_handle pdf_new_page (pdf_file_handle pdf_file,
eric@59 49 double width,
eric@59 50 double height);
eric@59 51
eric@59 52 void pdf_close_page (pdf_page_handle pdf_page);
eric@59 53
eric@59 54
eric@59 55 /* The length of the data must be Rows * rowbytes.
eric@59 56 Note that rowbytes must be at least (Columns+7)/8, but may be arbitrarily
eric@59 57 large. */
eric@59 58 void pdf_write_g4_fax_image (pdf_page_handle pdf_page,
eric@64 59 double x,
eric@64 60 double y,
eric@64 61 double width,
eric@64 62 double height,
eric@62 63 Bitmap *bitmap,
eric@66 64 bool ImageMask,
eric@66 65 double r, /* RGB fill color, only for ImageMask */
eric@66 66 double g,
eric@66 67 double b,
eric@66 68 bool BlackIs1); /* boolean, typ. false */
eric@59 69
eric@59 70
eric@59 71 void pdf_set_page_number (pdf_page_handle pdf_page, char *page_number);
eric@59 72
eric@74 73 /* Create a new bookmark, under the specified parent, or at the top
eric@74 74 level if parent is NULL. */
eric@74 75 pdf_bookmark_handle pdf_new_bookmark (pdf_bookmark_handle parent,
eric@74 76 char *title,
eric@74 77 bool open,
eric@74 78 pdf_page_handle pdf_page);
eric@59 79
eric@59 80 void pdf_insert_tiff_image (pdf_page_handle pdf_page, char *filename);