summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2000-09-12 20:36:23 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2000-09-12 20:36:23 +0000
commit3bf3450689a8928c11c02713f3e31a84a0b22313 (patch)
tree787e2652d26367b1813214278080efaebb78b45d
parentcc4eb8912c5ed4f34b0b9bf2820f449c2b48ed67 (diff)
Renders pages that use any transparency features as transparency groups.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@715 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/lib/pdf_main.ps44
1 files changed, 32 insertions, 12 deletions
diff --git a/gs/lib/pdf_main.ps b/gs/lib/pdf_main.ps
index f5f71161a..125a3e14c 100644
--- a/gs/lib/pdf_main.ps
+++ b/gs/lib/pdf_main.ps
@@ -649,26 +649,46 @@ end readonly def
count 1 sub /pdfemptycount exch store
% If the page uses any transparency features, show it within
% a transparency group.
- dup pageusestransparency {
- %****** NYI ******
+ PDFversion 1.4 lt {
showpagecontents
} {
- showpagecontents
+ dup /Group known {
+ % In PDF 1.4, Group overrides Contents.
+ DoForm
+ } {
+ dup pageusestransparency {
+ % Show the page within a fake top-level group.
+ processcolorspace setcolorspace
+ 0 dict
+ currentdict /ClipRect .knownget not {
+ gsave initclip clippath [pathbbox] grestore
+ } if aload pop
+ .begintransparencygroup {
+ showpagecontents
+ } .internalstopped {
+ .discardtransparencygroup stop
+ } if .endtransparencygroup
+ } {
+ showpagecontents
+ } ifelse
+ } ifelse
} ifelse
/Annots knownoget { { oforce drawannot } forall } if
endpage
end % scratch dict
} bind def
/showpagecontents { % <pagedict> showpagecontents -
- dup /Group known PDFversion 1.4 ge and {
- % In PDF 1.4, Group overrides Contents.
- DoForm
- } {
- dup /Contents knownoget not { 0 array } if
- dup type /arraytype ne { 1 array astore } if {
- oforce false resolvestream pdfopdict .pdfrun
- } forall
- } ifelse
+ dup /Contents knownoget not { 0 array } if
+ dup type /arraytype ne { 1 array astore } if {
+ oforce false resolvestream pdfopdict .pdfrun
+ } forall
+} bind def
+/processcolorspace { % - processcolorspace <colorspace>
+ % The following is per the PLRM3.
+ currentdevice 1 dict dup /ProcessColorModel dup put .getdeviceparams
+ exch pop exch pop
+ dup type /nametype ne { cvn } if
+ dup { setcolorspace } .internalstopped { pop /DeviceRGB } if
} bind def
% ------ Transparency support ------ %