diff options
Diffstat (limited to 'Master/tlpkg/tlgs/lib/pdf_draw.ps')
-rw-r--r-- | Master/tlpkg/tlgs/lib/pdf_draw.ps | 123 |
1 files changed, 101 insertions, 22 deletions
diff --git a/Master/tlpkg/tlgs/lib/pdf_draw.ps b/Master/tlpkg/tlgs/lib/pdf_draw.ps index 68789c37de9..538c9f57614 100644 --- a/Master/tlpkg/tlgs/lib/pdf_draw.ps +++ b/Master/tlpkg/tlgs/lib/pdf_draw.ps @@ -13,7 +13,7 @@ % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
% San Rafael, CA 94903, U.S.A., +1(415)492-9861.
-% $Id: pdf_draw.ps 8061 2007-06-19 02:39:15Z alexcher $
+% $Id: pdf_draw.ps 8554 2008-02-27 19:36:18Z leonardo $
% pdf_draw.ps
% PDF drawing operations (graphics, text, and images).
@@ -433,7 +433,6 @@ end gsave //nodict begin
null SMask
1 .setopacityalpha 1 .setshapealpha
- 0 .inittransparencymask 1 .inittransparencymask
/Compatible .setblendmode
% Execute the body of the Form, similar to DoForm.
pdfopdict .pdfruncontext
@@ -739,16 +738,27 @@ end % so for simplicity, we always do it.
PDFfile fileposition 3 1 roll
q
- null sc1 null SC1
+ //null sc1 //null SC1
% save old value of pdfemptycount on opstack, set to new value
pdfemptycount /pdfemptycount count 3 sub def 3 1 roll
- exch false resolvestream pdfopdict .pdfruncontext
+ countdictstack 3 1 roll
+
+ exch //false resolvestream pdfopdict .pdfruncontext
+
+ countdictstack exch sub dup 0 gt {
+ ( **** Warning: Pattern stream has imbalanced q/Q operators (too many q's)\n)
+ pdfformaterror
+ { Q } repeat
+ } {
+ pop
+ } ifelse
+
% restore pdfemptycount
/pdfemptycount exch def
Q
- PDFDEBUG { pdfdict /PDFSTEPcount .knownget { 1 le } { true } ifelse { (%End PaintProc) print dup === flush } if } if
+ PDFDEBUG { pdfdict /PDFSTEPcount .knownget { 1 le } { //true } ifelse { (%End PaintProc) print dup === flush } if } if
PDFfile exch setfileposition
} bdef
@@ -787,22 +797,93 @@ end PDFDEBUG { pdfdict /PDFSTEPcount .knownget { 1 le } { true } ifelse { (%Pattern: ) print dup === flush } if } if
} bdef
+/ignore_color_op ( **** Warning: Ignoring a color operation in a cached context.\n) readonly def
+
drawopdict begin
- /g { /DeviceGray cssubst { cs sc1 } { g } ifelse } bdef
- /rg { /DeviceRGB cssubst { cs sc* } { rg } ifelse } bdef
- /k { k } bdef
- /cs { csresolve cs } bdef
- /sc { scresolve { sc* } { sc1 } ifelse } bdef
+ /g { .incachedevice { % Bug 689302
+ pop //ignore_color_op pdfformaterror
+ } {
+ /DeviceGray cssubst { cs sc1 } { g } ifelse
+ } ifelse
+ } bdef
+
+ /rg { .incachedevice {
+ pop pop pop //ignore_color_op pdfformaterror
+ } {
+ /DeviceRGB cssubst { cs sc* } { rg } ifelse
+ } ifelse
+ } bdef
+
+ /k { .incachedevice {
+ pop pop pop pop //ignore_color_op pdfformaterror
+ } {
+ k
+ } ifelse
+ } bdef
+
+ /cs { .incachedevice {
+ pop //ignore_color_op pdfformaterror
+ } {
+ csresolve cs
+ } ifelse
+ } bdef
+
+ /sc { .incachedevice {
+ .pdfcount { pop } repeat //ignore_color_op pdfformaterror
+ } {
+ scresolve { sc* } { sc1 } ifelse
+ } ifelse
+ } bdef
+
/scn /sc load def
- /G { /DeviceGray cssubst { CS SC1 } { G } ifelse } bdef
- /RG { /DeviceRGB cssubst { CS SC* } { RG } ifelse } bdef
- /K { K } bdef
- /CS { csresolve CS } bdef
- /ri { ri } bdef
- /SC { scresolve { SC* } { SC1 } ifelse } bdef
+
+ /G { .incachedevice {
+ pop //ignore_color_op pdfformaterror
+ } {
+ /DeviceGray cssubst { CS SC1 } { G } ifelse
+ } ifelse
+ } bdef
+
+ /RG { .incachedevice {
+ pop pop pop //ignore_color_op pdfformaterror
+ } {
+ /DeviceRGB cssubst { CS SC* } { RG } ifelse
+ } ifelse
+ } bdef
+
+ /K { .incachedevice {
+ pop pop pop pop //ignore_color_op pdfformaterror
+ } {
+ K
+ } ifelse
+ } bdef
+
+ /CS { .incachedevice {
+ pop //ignore_color_op pdfformaterror
+ } {
+ csresolve CS
+ } ifelse
+ } bdef
+
+ /ri { .incachedevice {
+ pop //ignore_color_op pdfformaterror
+ } {
+ ri
+ } ifelse
+ } bdef
+
+ /SC { .incachedevice {
+ .pdfcount { pop } repeat //ignore_color_op pdfformaterror
+ } {
+ scresolve { SC* } { SC1 } ifelse
+ } ifelse
+ } bdef
+
/SCN /SC load def
end
+currentdict /ignore_color_op undef
+
% ---------------- Paths ---------------- %
drawopdict begin
@@ -956,16 +1037,15 @@ end } if
% Check elements of array are within 0::(2**BitsPerComponent)-1
% This is a PostScript error, but AR ignores Mask in that case
- 2 BitsPerComponent exp cvi 1 sub //false 2 index {
+ 1 BitsPerComponent bitshift 1 sub //false 2 index {
% stack: max_value result_bool value
dup 0 lt exch 3 index gt or or
} forall exch pop {
(\n **** Warning: Some elements of Mask array are out of range.\n)
pdfformaterror
- pop /ImageType 1 def % revert to non-masked image
- } {
- /MaskColor exch def
- } ifelse
+ [ exch { 0 .max 1 BitsPerComponent bitshift 1 sub .min } forall ]
+ } if
+ /MaskColor exch def
} {
% Mask is a stream, another Image XObject.
% Stack: datasource imagemask(false) maskstreamdict
@@ -999,7 +1079,6 @@ end gsave //nodict begin
null /SoftMask gput
1 .setopacityalpha 1 .setshapealpha
- 0 .inittransparencymask 1 .inittransparencymask
/Compatible .setblendmode
DoImage
end grestore
|