File ghostscript-8.64-pdf.dif of Package ghostscript-library
--- Resource/Init/pdf_main.ps
+++ Resource/Init/pdf_main.ps 2009-06-16 12:41:58.713901311 +0200
@@ -1436,11 +1436,15 @@ currentdict /PDF2PS_matrix_key undef
% Determine the number of spot colors used on the page. Note: This searches
% the pages resources. It may be high if a spot color is in a resource but
% is not actually used on the page.
- /PageSpotColors 2 index countspotcolors def
+ currentpagedevice /PageSpotColors known {
+ /PageSpotColors 2 index countspotcolors def
+ } if
% Let the device know if we will be using PDF 1.4 transparency.
% The clist logic may need to adjust the size of bands.
- 1 index pageusestransparency /PageUsesTransparency exch def
+ currentpagedevice /PageUsesTransparency known {
+ 1 index pageusestransparency /PageUsesTransparency exch def
+ } if
dup /Install .knownget {
% Don't let the Install procedure get more deeply
% nested after every page.
@@ -1567,7 +1571,9 @@ currentdict /PDF2PS_matrix_key undef
end % scratch dict
% Indicate that the number of spot colors is unknown in case the next page
% imaged is a PS file.
- << /PageSpotColors -1 >> .setpagedevice
+ currentpagedevice /PageSpotColors known {
+ << /PageSpotColors -1 >> .setpagedevice
+ } if
% Some PDF files don't have matching q/Q (gsave/grestore) so we need
% to clean up any left over dicts from the dictstack
countdictstack PDFdictstackcount sub dup 0 ne {
--- base/gdevbbox.c
+++ base/gdevbbox.c 2007-08-06 12:36:13.000000000 +0200
@@ -1173,6 +1173,17 @@ bbox_create_compositor(gx_device * dev,
{
gx_device_bbox *const bdev = (gx_device_bbox *) dev;
gx_device *target = bdev->target;
+ const gs_state *ps = (const gs_state *)pis;
+
+ /*
+ * Do not create a compositor for the target if overprint is active,
+ * this because then it is possible that the current page is erased
+ * for a bbox which equals the current page.
+ */
+ if (gs_currentoverprint(ps) || gs_currentoverprintmode(ps)) {
+ *pcdev = dev;
+ return 0;
+ }
/*
* If there isn't a target, all we care about is the bounding box,