pdf_page_label.c

Mon, 14 Dec 2009 16:18:21 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Mon, 14 Dec 2009 16:18:21 +0000
changeset 172
2fae6df568f6
parent 132
ccf1c28a2940
permissions
-rw-r--r--

remove erroneous 0.33-philpem1 tag

     1 /*
     2  * tumble: build a PDF file from image files
     3  *
     4  * PDF routines
     5  * $Id: pdf_page_label.c,v 1.2 2003/03/14 00:56:38 eric Exp $
     6  * Copyright 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 #include <stdbool.h>
    26 #include <stdint.h>
    27 #include <stdio.h>
    28 #include <stdlib.h>
    29 #include <string.h>
    32 #include "bitblt.h"
    33 #include "pdf.h"
    34 #include "pdf_util.h"
    35 #include "pdf_prim.h"
    36 #include "pdf_private.h"
    37 #include "pdf_name_tree.h"
    40 void pdf_new_page_label (pdf_file_handle pdf_file,
    41 			 int page_index,
    42 			 int base,
    43 			 int count,
    44 			 char style,
    45 			 char *prefix)
    46 {
    47   struct pdf_obj *label_dict;
    48   char style_str [2] = { style, '\0' };
    50   if (! pdf_file->page_label_tree)
    51     {
    52       pdf_file->page_label_tree = pdf_new_name_tree (pdf_file, 1);
    53     }
    55   label_dict = pdf_new_obj (PT_DICTIONARY);
    56   pdf_set_dict_entry (label_dict, "S", pdf_new_name (style_str));
    57   if (prefix)
    58     pdf_set_dict_entry (label_dict, "P", pdf_new_string (prefix));
    59   if (base != 1)
    60     pdf_set_dict_entry (label_dict, "St", pdf_new_integer (base));
    62   pdf_add_number_tree_element (pdf_file->page_label_tree,
    63 			       page_index,
    64 			       label_dict);
    65 }