Bug 5467

Summary: Multi page PDFs with clip masks
Product: cairo Reporter: Arno Pedusaar <arno>
Component: pdf backendAssignee: Kristian Høgsberg <krh>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 1.0.2   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Arno Pedusaar 2005-12-31 07:09:53 UTC
has_clip is not cleared in _cairo_pdf_document_add_page after writing out
the Q command, causing a mild panic in Acroread when opening the next page.

The following patch cures this for me (i do not know the innards of cairo,
so this might leak memory as hell):

--- cairo-1.0.2/src/cairo-pdf-surface.c 2005-08-20 00:05:14.000000000 +0300
+++ cairo-1.0.2-work/src/cairo-pdf-surface.c    2005-12-30 21:55:44.000000000 +0200
@@ -1758,8 +1758,10 @@

     _cairo_pdf_surface_ensure_stream (surface);

-    if (surface->has_clip)
+    if (surface->has_clip) {
        _cairo_output_stream_printf (output, "Q\r\n");
+       surface->has_clip=FALSE;
+    }

     _cairo_pdf_document_close_stream (document);
Comment 1 Chris Wilson 2007-08-18 01:09:43 UTC
Inspecting current source reveals that _cairo_pdf_surface_write_page() does reset the clip after use.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.