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.

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