1 /* Copyright (C) 2000 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: gdevpsu.h,v 1.9 2003/03/20 20:27:46 alexcher Exp $ */ 18 /* Interface to PostScript-writing utilities */ 19 20 #ifndef gdevpsu_INCLUDED 21 # define gdevpsu_INCLUDED 22 23 /* Define parameters and state for PostScript-writing drivers. */ 24 typedef struct gx_device_pswrite_common_s { 25 float LanguageLevel; 26 bool ProduceEPS; 27 int ProcSet_version; 28 long bbox_position; /* set when writing file header */ 29 } gx_device_pswrite_common_t; 30 #define PSWRITE_COMMON_PROCSET_VERSION 1000 /* for definitions in gdevpsu.c */ 31 #define PSWRITE_COMMON_VALUES(ll, eps, psv)\ 32 {ll, eps, PSWRITE_COMMON_PROCSET_VERSION + (psv)} 33 34 /* ---------------- Low level ---------------- */ 35 36 /* Write a 0-terminated array of strings as lines. */ 37 int psw_print_lines(FILE *f, const char *const lines[]); 38 39 /* ---------------- File level ---------------- */ 40 41 /* 42 * Write the file header, up through the BeginProlog. This must write to a 43 * file, not a stream, because it may be called during finalization. 44 */ 45 int psw_begin_file_header(FILE *f, const gx_device *dev, 46 const gs_rect *pbbox, 47 gx_device_pswrite_common_t *pdpc, bool ascii); 48 49 /* End the file header.*/ 50 int psw_end_file_header(FILE *f); 51 52 /* End the file. */ 53 int psw_end_file(FILE *f, const gx_device *dev, 54 const gx_device_pswrite_common_t *pdpc, 55 const gs_rect *pbbox, int page_count); 56 57 /* ---------------- Page level ---------------- */ 58 59 /* 60 * Write the page header. 61 */ 62 int psw_write_page_header(stream *s, const gx_device *dev, 63 const gx_device_pswrite_common_t *pdpc, 64 bool do_scale, long page_ord, int dictsize); 65 /* 66 * Write the page trailer. We do this directly to the file, rather than to 67 * the stream, because we may have to do it during finalization. 68 */ 69 int psw_write_page_trailer(FILE *f, int num_copies, int flush); 70 71 #endif /* gdevpsu_INCLUDED */ 72 73