From ebff4f7268482c373d0c70e877920261c5658f13 Mon Sep 17 00:00:00 2001 From: rmkaplan Date: Mon, 17 Jul 2023 23:04:38 -0700 Subject: [PATCH] PDFSTREAM: Fix logic around closing the postscript sub-stream --- library/PDFSTREAM | 23 ++++++++++++++--------- library/PDFSTREAM.LCOM | Bin 4987 -> 5072 bytes 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/library/PDFSTREAM b/library/PDFSTREAM index 48291023..d96b6716 100644 --- a/library/PDFSTREAM +++ b/library/PDFSTREAM @@ -1,10 +1,12 @@ (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) -(FILECREATED " 2-Jul-2023 17:00:18" {WMEDLEY}PDFSTREAM.;37 12671 +(FILECREATED "17-Jul-2023 22:33:21" {WMEDLEY}PDFSTREAM.;38 12982 :EDIT-BY rmk - :PREVIOUS-DATE "25-Jun-2023 16:41:34" {WMEDLEY}PDFSTREAM.;36) + :CHANGES-TO (FNS CLOSE-PDF-STREAM) + + :PREVIOUS-DATE " 2-Jul-2023 17:00:18" {WMEDLEY}PDFSTREAM.;37) (PRETTYCOMPRINT PDFSTREAMCOMS) @@ -158,7 +160,8 @@ PSSTREAM]) (CLOSE-PDF-STREAM - [LAMBDA (PSSTREAM) (* ; "Edited 24-Jun-2023 13:57 by rmk") + [LAMBDA (PSSTREAM) (* ; "Edited 17-Jul-2023 22:32 by rmk") + (* ; "Edited 24-Jun-2023 13:57 by rmk") (* ;; "PSSTREAM is a tmp/ postscript rendition of what is intended to end up as a pdf. If we are going directly to a printer, we can probably just pass it along without worrying about conversion. In fact, in that case we probably should not have bothered even setting up the PDF stream.") @@ -166,9 +169,11 @@ (* ;; "We have to back up to the ordinary POSTSCRIPT close, so that we don't loop through here") - (replace (STREAM IMAGEOPS) of PSSTREAM with \POSTSCRIPTIMAGEOPS) - (PDF-CONVERT (CLOSEF PSSTREAM) - (fetch (\POSTSCRIPTDATA POSTSCRIPTTARGETINFO) of (fetch (STREAM IMAGEDATA) of PSSTREAM]) + (CL:WHEN (EQ \PDFIMAGEOPS (fetch (STREAM IMAGEOPS) of PSSTREAM)) + (replace (STREAM IMAGEOPS) of PSSTREAM with \POSTSCRIPTIMAGEOPS) + (PDF-CONVERT (CLOSEF PSSTREAM) + (fetch (\POSTSCRIPTDATA POSTSCRIPTTARGETINFO) of (fetch (STREAM IMAGEDATA) + of PSSTREAM))))]) (PDF-CONVERT [LAMBDA (PSTMPFILENAME TARGETPDFNAME DONTDELETE) (* ; "Edited 24-Jun-2023 15:01 by rmk") @@ -225,7 +230,7 @@ (PDF-INIT) (DECLARE%: DONTCOPY - (FILEMAP (NIL (2668 5002 (PDFFILEP 2678 . 3592) (PDF.HARDCOPYW 3594 . 4021) (PDF.TEXT 4023 . 4631) ( -PDF.TEDIT 4633 . 5000)) (5428 12632 (PDF-INIT 5438 . 6163) (OPEN-PDF-STREAM 6165 . 8268) ( -CLOSE-PDF-STREAM 8270 . 9185) (PDF-CONVERT 9187 . 12630))))) + (FILEMAP (NIL (2710 5044 (PDFFILEP 2720 . 3634) (PDF.HARDCOPYW 3636 . 4063) (PDF.TEXT 4065 . 4673) ( +PDF.TEDIT 4675 . 5042)) (5470 12943 (PDF-INIT 5480 . 6205) (OPEN-PDF-STREAM 6207 . 8310) ( +CLOSE-PDF-STREAM 8312 . 9496) (PDF-CONVERT 9498 . 12941))))) STOP diff --git a/library/PDFSTREAM.LCOM b/library/PDFSTREAM.LCOM index 97a1344cf9b7705a55cb49e1c75d5e95e7d68cd7..dde4ea6f6487716270c554883fd9f388b38c664d 100644 GIT binary patch delta 384 zcmZvX%}T>S6or#b2?1AH++G4|BaCDwu}NlSOeQgsCLuFc1Q$i^qV&fa5qt`<T7dP&a3B59hn*yl*~l-5;-E8y((^5HW}egizC@1kZ*>>gb?qxcy^d zn;L`?SA(;%e||Zh4o3Y8=-*Du>kSHil5vLeAVgdg%}Yb^9>=j~CiR+MeJYr$fOpQT+^2r#WBHLSZ@Hk{@e q7u+x6T+~1hECW6#lXi8bG&O?14*1)$>R1rQ9WP>8&gXZ^tNH=eC}KSN!lVf@X?^5ZCYXl!GT+_bOA1+ z8xdTBV^`qB6a_nQe7^tu=WYLM?`5z9s-8ZKRjN}1#9_M5sIeI7&yE5~rkw^>Kad)X z*vxcfT-U|TbTTW)#Sq2gtiIo6sHXF~vbsfCK@NIRgw0b;(_{><=FR>;r$uE&Itapu zdntEw?nB1%RWv&w)OH9M_rqL0I!8Sjfh8&LhjA}c{bsuMS$~b|K*9`j@dVLcy^ELI zTZ$kE;_{?*I565s{6O{Mvp!FAkT$$1&Un!LHV7_~ILk9H4U@bPyPzhryvgZ;=$kO? Ry2m_DGFZQS_0js2z5zYmS5W`}