[gs-commits] rev 11661 - trunk/gs/base

ken at ghostscript.com ken at ghostscript.com
Fri Aug 27 12:10:55 UTC 2010

Author: ken
Date: 2010-08-27 12:10:54 +0000 (Fri, 27 Aug 2010)
New Revision: 11661

Fix (pdfwrite) : FormDepth not tracked properly.

Part of the fix for Bug#690398. In order to know whether a pattern matrix should be
converted to the top level CTM, or to an enclosing Form CTM, we track the Form Depth
by noting when transparency groups begin and end (currently this is the only way to get
a form output by pdfwrite).

There was a problem with mask groups, because although pdf_begin_transparency_mask calls
pdf_begin_transparency_group, pdf_end_transparency_mask doe snot call
pdf_end_transparency_group. This resulted in the depth being incremented at the start
of the mask, but not decremented at the end, so patterns could be emitted at the page
level but with the CTM for a Form level, leading to missing content.

Fixed by decrementing the FormDepth appropriately.
Expected Differences
Bug689918.pdf, the large yellow star at top left now renders. This is a progression
and this file finally converts correctly.

Modified: trunk/gs/base/gdevpdft.c
--- trunk/gs/base/gdevpdft.c	2010-08-27 12:02:46 UTC (rev 11660)
+++ trunk/gs/base/gdevpdft.c	2010-08-27 12:10:54 UTC (rev 11661)
@@ -330,6 +330,11 @@
 	pdev->pres_soft_mask_dict->where_used |= pdev->used_mask;
 	pis->soft_mask_id = pdev->pres_soft_mask_dict->object->id;
 	pdev->pres_soft_mask_dict = NULL;
+	/* We called pdf_start_trnasparency_group (see pdf_begin_transparency_mask
+	 * above) but we don't call pdf_end_transparency_group, so we must reduce
+	 * the FormDepth ourselves.
+	 */
+	pdev->FormDepth--; 
     return 0;

More information about the gs-commits mailing list