Blame SOURCES/ghostscript-pdf2dsc-regression.patch

3cc549
From db24f253409d5d085c2760c814c3e1d3fa2dac59 Mon Sep 17 00:00:00 2001
3cc549
From: Ray Johnston <ray.johnston@artifex.com>
3cc549
Date: Tue, 19 Mar 2019 09:25:48 -0700
3cc549
Subject: Fix lib/pdf2dsc.ps to use documented Ghostscript pdf procedures.
3cc549
3cc549
We eliminated GS_PDF_ProcSet and pdfdict, but runpdfbegin, dopdfpages,
3cc549
and runpdfend are still available.
3cc549
3cc549
diff --git a/lib/pdf2dsc.ps b/lib/pdf2dsc.ps
3cc549
index 4547849c2..d836bf320 100644
3cc549
--- a/lib/pdf2dsc.ps
3cc549
+++ b/lib/pdf2dsc.ps
3cc549
@@ -52,10 +52,7 @@ systemdict /.setsafe known { .setsafe } if
3cc549
 /DSCstring 255 string def
3cc549
 /MediaTypes 10 dict def
3cc549
 
3cc549
-   GS_PDF_ProcSet begin
3cc549
-   pdfdict begin
3cc549
-   PDFfile
3cc549
-   pdfopen begin
3cc549
+   PDFfile runpdfbegin
3cc549
    /FirstPage where { pop } { /FirstPage 1 def } ifelse
3cc549
    /LastPage where { pop } { /LastPage pdfpagecount def } ifelse
3cc549
 
3cc549
@@ -108,13 +105,12 @@ systemdict /.setsafe known { .setsafe } if
3cc549
    (%%BeginProlog\n) puts
3cc549
    (/Page null def\n/Page# 0 def\n/PDFSave null def\n) puts
3cc549
    (/DSCPageCount 0 def\n) puts
3cc549
-   (/DoPDFPage {dup /Page# exch store pdfgetpage pdfshowpage } def\n) puts
3cc549
-   (GS_PDF_ProcSet begin\npdfdict begin\n) puts
3cc549
+   (/DoPDFPage {dup /Page# exch store dup dopdfpages } def\n) puts
3cc549
    (%%EndProlog\n) puts
3cc549
    (%%BeginSetup\n) puts
3cc549
    DSCfile PDFname write==only
3cc549
    ( \(r\) file { DELAYSAFER { .setsafe } if } stopped pop\n) puts
3cc549
-   ( pdfopen begin\n) puts
3cc549
+   ( runpdfbegin\n) puts
3cc549
    ( process_trailer_attrs\n) puts
3cc549
    (%%EndSetup\n) puts
3cc549
 
3cc549
@@ -239,13 +235,10 @@ systemdict /.setsafe known { .setsafe } if
3cc549
        DSCfile exch DSCstring cvs writestring
3cc549
        ( DoPDFPage\n) puts
3cc549
     } for
3cc549
-   currentdict pdfclose
3cc549
-   end
3cc549
-   end
3cc549
-   end
3cc549
+    runpdfend
3cc549
 % write trailer
3cc549
 (%%Trailer\n) puts
3cc549
-(currentdict pdfclose\nend\nend\nend\n) puts
3cc549
+(runpdfend\n) puts
3cc549
 (%%EOF\n) puts
3cc549
 % close output file and exit
3cc549
 DSCfile closefile