xref: /plan9/sys/src/cmd/gs/src/gdevpdfb.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 2001 Aladdin Enterprises.  All rights reserved.
2 
3   This software is provided AS-IS with no warranty, either express or
4   implied.
5 
6   This software is distributed under license and may not be copied,
7   modified or distributed except as expressly authorized under the terms
8   of the license contained in the file LICENSE in this distribution.
9 
10   For more information about licensing, please refer to
11   http://www.ghostscript.com/licensing/. For information on
12   commercial licensing, go to http://www.artifex.com/licensing/ or
13   contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14   San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15 */
16 
17 /* $Id: gdevpdfb.h,v 1.14 2005/10/12 08:16:50 leonardo Exp $ */
18 /* pdfwrite, ps2write device body template. */
19 
20 /* This file is allowed to #include several times into a single .c file.
21    The following macros to be defined in advance :
22    PDF_DEVICE_NAME - a string like "pdfwrite".
23    PDF_DEVICE_IDENT - an identifier like gs_pdfwrite_device.
24    PDF_DEVICE_MaxInlineImageSize - a value of PDF_DEVICE_MaxInlineImageSize.
25    PDF_FOR_OPDFREAD - an integer 0 (false) or 1 (true).
26  */
27 
28 
29 const gx_device_pdf PDF_DEVICE_IDENT =
30 {std_device_dci_type_body(gx_device_pdf, 0, PDF_DEVICE_NAME,
31 			  &st_device_pdfwrite,
32 			  DEFAULT_WIDTH_10THS * X_DPI / 10,
33 			  DEFAULT_HEIGHT_10THS * Y_DPI / 10,
34 			  X_DPI, Y_DPI,
35 			  3, 24, 255, 255, 256, 256),
36  {pdf_open,
37   gx_upright_get_initial_matrix,
38   NULL,				/* sync_output */
39   pdf_output_page,
40   pdf_close,
41   gx_default_rgb_map_rgb_color,
42   gx_default_rgb_map_color_rgb,
43   gdev_pdf_fill_rectangle,
44   NULL,				/* tile_rectangle */
45   gdev_pdf_copy_mono,
46   gdev_pdf_copy_color,
47   NULL,				/* draw_line */
48   psdf_get_bits,		/* get_bits */
49   gdev_pdf_get_params,
50   gdev_pdf_put_params,
51   NULL,				/* map_cmyk_color */
52   NULL,				/* get_xfont_procs */
53   NULL,				/* get_xfont_device */
54   NULL,				/* map_rgb_alpha_color */
55   gx_page_device_get_page_device,
56   NULL,				/* get_alpha_bits */
57   NULL,				/* copy_alpha */
58   NULL,				/* get_band */
59   NULL,				/* copy_rop */
60   gdev_pdf_fill_path,
61   gdev_pdf_stroke_path,
62   gdev_pdf_fill_mask,
63   NULL,				/* fill_trapezoid */
64   NULL,				/* fill_parallelogram */
65   NULL,				/* fill_triangle */
66   NULL,				/* draw_thin_line */
67   NULL,				/* begin_image */
68   NULL,				/* image_data */
69   NULL,				/* end_image */
70   gdev_pdf_strip_tile_rectangle,
71   NULL,				/* strip_copy_rop */
72   NULL,				/* get_clipping_box */
73   gdev_pdf_begin_typed_image,
74   psdf_get_bits_rectangle,	/* get_bits_rectangle */
75   NULL,				/* map_color_rgb_alpha */
76   gdev_pdf_create_compositor,	/* create_compositor */
77   NULL,				/* get_hardware_params */
78   gdev_pdf_text_begin,
79   NULL,				/* finish_copydevice */
80   gdev_pdf_begin_transparency_group,	/* begin_transparency_group */
81   gdev_pdf_end_transparency_group,	/* end_transparency_group */
82   gdev_pdf_begin_transparency_mask,	/* begin_transparency_mask */
83   gdev_pdf_end_transparency_mask,	/* end_transparency_mask */
84   gdev_pdf_discard_transparency_layer,	/* discard_transparency_layer */
85   NULL,				/* get_color_mapping_procs */
86   NULL,				/* get_color_comp_index */
87   NULL,				/* encode_color */
88   NULL,				/* decode_color */
89   gdev_pdf_pattern_manage, 	/* pattern_manage */
90   gdev_pdf_fill_rectangle_hl_color, 	/* fill_rectangle_hl_color */
91   gdev_pdf_include_color_space 	/* include_color_space */
92  },
93  psdf_initial_values(PSDF_VERSION_INITIAL, 0 /*false */ ),  /* (!ASCII85EncodePages) */
94  PDF_COMPATIBILITY_LEVEL_INITIAL,  /* CompatibilityLevel */
95  -1,				/* EndPage */
96  1,				/* StartPage */
97  1 /*true*/,			/* Optimize */
98  0 /*false*/,			/* ParseDSCCommentsForDocInfo */
99  1 /*true*/,			/* ParseDSCComments */
100  0 /*false*/,			/* EmitDSCWarnings */
101  0 /*false*/,			/* CreateJobTicket */
102  0 /*false*/,			/* PreserveEPSInfo */
103  1 /*true*/,			/* AutoPositionEPSFiles */
104  1 /*true*/,			/* PreserveCopyPage */
105  0 /*false*/,			/* UsePrologue */
106  0,				/* OffOptimizations */
107  1 /*true*/,			/* ReAssignCharacters */
108  1 /*true*/,			/* ReEncodeCharacters */
109  1,				/* FirstObjectNumber */
110  1 /*true*/,			/* CompressFonts */
111  0 /*false*/,			/* PrintStatistics */
112  PDF_FOR_OPDFREAD,		/* ForOPDFRead */
113  {0, 0, 0},			/* OPDFReadProcsetPath */
114  false,				/* CompressEntireFile */
115  0 /*false*/,			/* ResourcesBeforeUsage */
116  1 /*true*/,			/* HavePDFWidths */
117  0 /*false*/,			/* HaveStrokeColor */
118  1 /*true*/,			/* HaveTransparency */
119  0 /*false*/,			/* PatternImagemask */
120  0 /*false*/,			/* PDFX */
121  12000,				/* MaxClipPathSize */ /* HP LaserJet 1320 hangs with 14000. */
122  max_long,                      /* MaxViewerMemorySize */
123  256000,			/* MaxShadingBitmapSize */
124  PDF_DEVICE_MaxInlineImageSize,	/* MaxInlineImageSize */
125  {0, 0, 0},			/* OwnerPassword */
126  {0, 0, 0},			/* UserPassword */
127  0,				/* KeyLength */
128  -4,				/* Permissions */
129  0,				/* EncryptionR */
130  {0},				/* EncryptionO */
131  {0},				/* EncryptionU */
132  {0},				/* EncryptionKey */
133  0,				/* EncryptionV */
134  true,				/* EncryptMetadata */
135  {0, 0, 0},			/* NoEncrypt */
136  0 /*false*/,			/* is_EPS */
137  {-1, -1},			/* doc_dsc_info */
138  {-1, -1},			/* page_dsc_info */
139  0 /*false*/,			/* fill_overprint */
140  0 /*false*/,			/* stroke_overprint */
141  0,				/* overprint_mode */
142  gs_no_id,			/* halftone_id */
143  {gs_no_id, gs_no_id, gs_no_id, gs_no_id}, /* transfer_ids */
144  0,				/* transfer_not_identity */
145  gs_no_id,			/* black_generation_id */
146  gs_no_id,			/* undercolor_removal_id */
147  pdf_compress_none,		/* compression */
148  pdf_compress_none,		/* compression_at_page_start */
149  {{0}},				/* xref */
150  {{0}},				/* asides */
151  {{0}},				/* streams */
152  {{0}},				/* pictures */
153  0,				/* next_id */
154  0,				/* Catalog */
155  0,				/* Info */
156  0,				/* Pages */
157  0,				/* outlines_id */
158  0,				/* next_page */
159  -1,				/* max_referred_page */
160  0,				/* contents_id */
161  PDF_IN_NONE,			/* context */
162  0,				/* contents_length_id */
163  0,				/* contents_pos */
164  NoMarks,			/* procsets */
165  0,				/* text */
166  {{0}},				/* text_rotation */
167  0,				/* pages */
168  0,				/* num_pages */
169  1,				/* used_mask */
170  {
171      {
172 	 {0}}},			/* resources */
173  {0},				/* cs_Patterns */
174  {0},				/* Identity_ToUnicode_CMaps */
175  0,				/* last_resource */
176  {
177      {
178 	 {0}}},			/* outline_levels */
179  0,				/* outline_depth */
180  0,				/* closed_outline_depth */
181  0,				/* outlines_open */
182  0,				/* articles */
183  0,				/* Dests */
184  {0},				/* fileID */
185  0,				/* global_named_objects */
186  0,				/* local_named_objects */
187  0,				/* NI_stack */
188  0,				/* Namespace_stack */
189  0,				/* font_cache */
190  {0, 0},			/* char_width */
191  0,				/* clip_path */
192  0,                             /* PageLabels */
193  -1,                            /* PageLabels_current_page */
194  0,                             /* PageLabels_current_label */
195  0,				/* */
196  {				/* vgstack[2] */
197     {0}, {0}
198  },
199  0,				/* vgstack_depth */
200  0,				/* vgstack_bottom */
201  {0},				/* vg_initial */
202  false,				/* vg_initial_set */
203  0,				/* sbstack_size */
204  0,				/* sbstack_depth */
205  0,				/* sbstack */
206  0,				/* substream_Resources */
207  1,				/* pcm_color_info_index == DeviceRGB */
208  false,				/* skip_colors */
209  false,				/* AR4_save_bug */
210  0,				/* font3 */
211  0,				/* accumulating_substream_resource */
212  {0,0,0,0,0,0,0,0,0},		/* charproc_ctm */
213  0,				/* charproc_just_accumulated */
214  0,				/* accumulating_a_global_object */
215  0,				/* cgp */
216  0,				/* substituted_pattern_count */
217  0,				/* substituted_pattern_drop_page */
218  0,				/* image_mask_id */
219  0,				/* image_mask_is_SMask */
220  0,				/* image_mask_skip */
221  {0,0,0,0,0,0}, 		/* gs_matrix converting_image_matrix */
222  0,				/* image_mask_scale */
223  NULL,				/* pres_soft_mask_dict */
224  {0, 0}				/* objname */
225 };
226 
227