pdf_page_label.c

Fri, 14 Mar 2003 08:56:38 +0000

author
eric
date
Fri, 14 Mar 2003 08:56:38 +0000
changeset 132
ccf1c28a2940
parent 131
4b8c80d77f76
permissions
-rw-r--r--

remove debug output.

eric@131 1 /*
eric@131 2 * tumble: build a PDF file from image files
eric@131 3 *
eric@131 4 * PDF routines
eric@132 5 * $Id: pdf_page_label.c,v 1.2 2003/03/14 00:56:38 eric Exp $
eric@131 6 * Copyright 2003 Eric Smith <eric@brouhaha.com>
eric@131 7 *
eric@131 8 * This program is free software; you can redistribute it and/or modify
eric@131 9 * it under the terms of the GNU General Public License version 2 as
eric@131 10 * published by the Free Software Foundation. Note that permission is
eric@131 11 * not granted to redistribute this program under the terms of any
eric@131 12 * other version of the General Public License.
eric@131 13 *
eric@131 14 * This program is distributed in the hope that it will be useful,
eric@131 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eric@131 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eric@131 17 * GNU General Public License for more details.
eric@131 18 *
eric@131 19 * You should have received a copy of the GNU General Public License
eric@131 20 * along with this program; if not, write to the Free Software
eric@131 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
eric@131 22 */
eric@131 23
eric@131 24
eric@131 25 #include <stdbool.h>
eric@131 26 #include <stdint.h>
eric@131 27 #include <stdio.h>
eric@131 28 #include <stdlib.h>
eric@131 29 #include <string.h>
eric@131 30
eric@131 31
eric@131 32 #include "bitblt.h"
eric@131 33 #include "pdf.h"
eric@131 34 #include "pdf_util.h"
eric@131 35 #include "pdf_prim.h"
eric@131 36 #include "pdf_private.h"
eric@131 37 #include "pdf_name_tree.h"
eric@131 38
eric@131 39
eric@131 40 void pdf_new_page_label (pdf_file_handle pdf_file,
eric@131 41 int page_index,
eric@131 42 int base,
eric@131 43 int count,
eric@131 44 char style,
eric@131 45 char *prefix)
eric@131 46 {
eric@131 47 struct pdf_obj *label_dict;
eric@131 48 char style_str [2] = { style, '\0' };
eric@131 49
eric@131 50 if (! pdf_file->page_label_tree)
eric@131 51 {
eric@131 52 pdf_file->page_label_tree = pdf_new_name_tree (pdf_file, 1);
eric@131 53 }
eric@131 54
eric@131 55 label_dict = pdf_new_obj (PT_DICTIONARY);
eric@131 56 pdf_set_dict_entry (label_dict, "S", pdf_new_name (style_str));
eric@131 57 if (prefix)
eric@131 58 pdf_set_dict_entry (label_dict, "P", pdf_new_string (prefix));
eric@131 59 if (base != 1)
eric@131 60 pdf_set_dict_entry (label_dict, "St", pdf_new_integer (base));
eric@131 61
eric@131 62 pdf_add_number_tree_element (pdf_file->page_label_tree,
eric@131 63 page_index,
eric@131 64 label_dict);
eric@131 65 }
eric@131 66