diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2011-07-25 16:19:19 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2011-07-25 16:19:19 +0100 |
commit | 7dee8c1639a55e5b6ae4051afcfed9caa82e48b5 (patch) | |
tree | 96b668d8a19940c1c2d923c32181fee9b6553c65 | |
parent | 1562de0f7dc0615ed1397f42a7ad0eb23f4dcf22 (diff) |
Remove the last traces of OPDFReadProcsetPath
The old Procsets had to be moved from PostScript resources to C files, in order that
ps2write work with non-PostScript interpreters (XPS, PCL). As a result the
old OPDFReadProcsetPath is no longer used and has been removed.
-rw-r--r-- | gs/Resource/Init/gs_pdfwr.ps | 28 | ||||
-rw-r--r-- | gs/base/gdevpdf.c | 2 | ||||
-rw-r--r-- | gs/base/gdevpdfb.h | 1 | ||||
-rw-r--r-- | gs/base/gdevpdfp.c | 4 | ||||
-rw-r--r-- | gs/base/gdevpdfu.c | 54 | ||||
-rw-r--r-- | gs/base/gdevpdfx.h | 7 |
6 files changed, 8 insertions, 88 deletions
diff --git a/gs/Resource/Init/gs_pdfwr.ps b/gs/Resource/Init/gs_pdfwr.ps index 140854ed3..94f916be2 100644 --- a/gs/Resource/Init/gs_pdfwr.ps +++ b/gs/Resource/Init/gs_pdfwr.ps @@ -868,34 +868,6 @@ currentdict /.pdf_hook_DSC_Creator undef dup type /booleantype eq not { cleartomark pop } if pop pop } bind .schedule_init -% Set a path to library files (ps2write) -.defaultdevicename /ps2write eq { - mark - /OPDFReadProcsetPath - systemdict /OPDFReadProcsetPath .knownget dup { % check for a value on the command-line - 1 index () eq { - (Configuration warning : empty OPDFReadProcsetPath, will use defaults.) = - systemdict /OPDFReadProcsetPath undef - pop pop //false - } if - } if - not { % if necessary, compute a default - mark - (gs_mgl_e.ps) (gs_mro_e.ps) (gs_agl.ps) % Reverse order ! - () counttomark 1 sub { - exch - .libfile { .filename } { //false } ifelse not { - (Configuration error : library file opdfread.ps not found !) = - (opdfread.ps) /undefinedfilename signalerror - } if - .filenamelistseparator concatstrings concatstrings - } repeat - exch pop - } if - %stack: mark /OPDFReadProcsetPath <filelist> - /ps2write finddevice putdeviceprops pop % set the default instance's procset path -} if - 2000 % priority { % Note, this may not work if the initial device is not pdfwrite currentdevice .devicename dup /pdfwrite eq exch /ps2write eq or { diff --git a/gs/base/gdevpdf.c b/gs/base/gdevpdf.c index a4be62c19..32b17bee2 100644 --- a/gs/base/gdevpdf.c +++ b/gs/base/gdevpdf.c @@ -1491,7 +1491,7 @@ pdf_close(gx_device * dev) pdev->pages = 0; pdev->num_pages = 0; - if (pdev->ForOPDFRead && pdev->OPDFReadProcsetPath.size) { + if (pdev->ForOPDFRead) { /* pdf_open_dcument could set up filters for entire document. Removing them now. */ int status; diff --git a/gs/base/gdevpdfb.h b/gs/base/gdevpdfb.h index d9163a2f6..edd739ec9 100644 --- a/gs/base/gdevpdfb.h +++ b/gs/base/gdevpdfb.h @@ -123,7 +123,6 @@ const gx_device_pdf PDF_DEVICE_IDENT = {0, 0, 0}, /* InstanceUUID */ 0, /* DocumentTimeSeq */ PDF_FOR_OPDFREAD, /* ForOPDFRead */ - {0, 0, 0}, /* OPDFReadProcsetPath */ false, /* CompressEntireFile */ 0 /*false*/, /* ResourcesBeforeUsage */ 1 /*true*/, /* HavePDFWidths */ diff --git a/gs/base/gdevpdfp.c b/gs/base/gdevpdfp.c index af9ab0a6b..0a40a98e5 100644 --- a/gs/base/gdevpdfp.c +++ b/gs/base/gdevpdfp.c @@ -92,7 +92,6 @@ static const gs_param_item_t pdf_param_items[] = { pi("HaveTrueTypes", gs_param_type_bool, HaveTrueTypes), pi("HaveCIDSystem", gs_param_type_bool, HaveCIDSystem), pi("HaveTransparency", gs_param_type_bool, HaveTransparency), - /* pi("OPDFReadProcsetPath", gs_param_type_string, OPDFReadProcsetPath), ps2write-only */ pi("CompressEntireFile", gs_param_type_bool, CompressEntireFile), pi("PDFX", gs_param_type_bool, PDFX), pi("PDFA", gs_param_type_bool, PDFA), @@ -213,7 +212,6 @@ gdev_pdf_get_params(gx_device * dev, gs_param_list * plist) if (code < 0 || (code = param_write_int(plist, "CoreDistVersion", &cdv)) < 0 || (code = param_write_float(plist, "CompatibilityLevel", &cl)) < 0 || - (pdev->is_ps2write && (code = param_write_string(plist, "OPDFReadProcsetPath", &pdev->OPDFReadProcsetPath)) < 0) || (!pdev->is_ps2write && (code = param_write_bool(plist, "ForOPDFRead", &pdev->ForOPDFRead)) < 0) || /* Indicate that we can process pdfmark and DSC. */ (param_requested(plist, "pdfmark") > 0 && @@ -359,7 +357,6 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par plist->memory = pdev->pdf_memory; code = gs_param_read_items(plist, pdev, pdf_param_items); if (code < 0 || - (pdev->is_ps2write && (code = param_read_string(plist, "OPDFReadProcsetPath", &pdev->OPDFReadProcsetPath)) < 0) || (!pdev->is_ps2write && (code = param_read_bool(plist, "ForOPDFRead", &pdev->ForOPDFRead)) < 0) ){ } @@ -595,7 +592,6 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par (char *)save_dev + ppi->offset, gs_param_type_sizes[ppi->type]); pdev->ForOPDFRead = save_dev->ForOPDFRead; - pdev->OPDFReadProcsetPath = save_dev->OPDFReadProcsetPath; } return ecode; } diff --git a/gs/base/gdevpdfu.c b/gs/base/gdevpdfu.c index 3e8d70b6b..fc50081e1 100644 --- a/gs/base/gdevpdfu.c +++ b/gs/base/gdevpdfu.c @@ -354,53 +354,8 @@ static int write_tt_encodings(stream *s, bool HaveTrueTypes) } static int -copy_procsets(stream *s, const gs_param_string *path, bool HaveTrueTypes, bool stripping) +copy_procsets(stream *s, bool HaveTrueTypes, bool stripping) { -#ifdef PS2WRITE_USES_ROMFS - char fname[gp_file_name_sizeof]; - const byte *p = path->data, *e = path->data + path->size; - int l, i = 0, code; - const char *tt_encs[] = {"gs_agl.ps", "gs_mgl_e.ps"}; - - if (p != NULL) { - for (;; i++) { - const byte *c = memchr(p, gp_file_name_list_separator, e - p); - int k = 0; /* Initializing against a compiler warning only. */ - - if (c == NULL) - c = e; - l = c - p; - if (l > 0) { - if (l > sizeof(fname) - 1) - return_error(gs_error_limitcheck); - memcpy(fname, p, l); - fname[l] = 0; - if (!HaveTrueTypes) { - for (k = count_of(tt_encs) - 1; k >= 0; k--) { - int L = strlen(tt_encs[k]); - - if (!strcmp(fname + strlen(fname) - L, tt_encs[k])) - break; - } - } - if (HaveTrueTypes || k < 0) { - if (stripping) - code = copy_ps_file_stripping_all(s, fname, HaveTrueTypes); - else - code = copy_ps_file_strip_comments(s, fname, HaveTrueTypes); - if (code < 0) - return code; - } - } - if (c == e) - break; - p = c + 1; - } - } - if (!i) - return_error(gs_error_undefinedfilename); - return 0; -#else int code; code = write_opdfread(s); @@ -410,7 +365,6 @@ copy_procsets(stream *s, const gs_param_string *path, bool HaveTrueTypes, bool s code = write_tt_encodings(s, HaveTrueTypes); return code; -#endif } static int @@ -477,7 +431,7 @@ int ps2write_dsc_header(gx_device_pdf * pdev, int pages) stream_puts(s, "/DSC_OPDFREAD true def\n"); stream_puts(s, "/SetPageSize true def\n"); - code = copy_procsets(s, &pdev->OPDFReadProcsetPath, pdev->HaveTrueTypes, false); + code = copy_procsets(s, pdev->HaveTrueTypes, false); if (code < 0) return code; status = s_close_filters(&s, pdev->strm); @@ -498,7 +452,7 @@ pdf_open_document(gx_device_pdf * pdev) int level = (int)(pdev->CompatibilityLevel * 10 + 0.5); pdev->binary_ok = !pdev->params.ASCII85EncodePages; - if (pdev->ForOPDFRead && pdev->OPDFReadProcsetPath.size) { + if (pdev->ForOPDFRead) { int code, status; char BBox[256]; int width = (int)(pdev->width * 72.0 / pdev->HWResolution[0] + 0.5); @@ -526,7 +480,7 @@ pdf_open_document(gx_device_pdf * pdev) return code; } stream_puts(s, "/DSC_OPDFREAD false def\n"); - code = copy_procsets(s, &pdev->OPDFReadProcsetPath, pdev->HaveTrueTypes, true); + code = copy_procsets(s, pdev->HaveTrueTypes, true); if (code < 0) return code; if (!pdev->CompressEntireFile) { diff --git a/gs/base/gdevpdfx.h b/gs/base/gdevpdfx.h index 924671afa..4fdc87fb4 100644 --- a/gs/base/gdevpdfx.h +++ b/gs/base/gdevpdfx.h @@ -456,7 +456,6 @@ struct gx_device_pdf_s { gs_param_string InstanceUUID; int DocumentTimeSeq; bool ForOPDFRead; /* PS2WRITE only. */ - gs_param_string OPDFReadProcsetPath; /* PS2WRITE only. */ bool CompressEntireFile; /* PS2WRITE only. */ bool ResourcesBeforeUsage; /* PS2WRITE only. */ bool HavePDFWidths; /* PS2WRITE only. */ @@ -732,9 +731,9 @@ struct gx_device_pdf_s { m(36,Identity_ToUnicode_CMaps[0]) m(37,Identity_ToUnicode_CMaps[1]) #define gx_device_pdf_num_ptrs 38 #define gx_device_pdf_do_param_strings(m)\ - m(0, OPDFReadProcsetPath) m(1, OwnerPassword) m(2, UserPassword) m(3, NoEncrypt)\ - m(4, DocumentUUID) m(5, InstanceUUID) -#define gx_device_pdf_num_param_strings 6 + m(0, OwnerPassword) m(1, UserPassword) m(2, NoEncrypt)\ + m(3, DocumentUUID) m(4, InstanceUUID) +#define gx_device_pdf_num_param_strings 5 #define gx_device_pdf_do_const_strings(m)\ m(0, objname) #define gx_device_pdf_num_const_strings 1 |