[cairo-commit] cairo/src cairo-ps-surface.c,1.67,1.68

Carl Worth commit at pdx.freedesktop.org
Fri Jan 13 13:41:47 PST 2006


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv16134/src

Modified Files:
	cairo-ps-surface.c 
Log Message:

2006-01-13  Carl Worth  <cworth at cworth.org>

        * src/cairo-ps-surface.c: (_cairo_ps_surface_emit_header),
        (_cairo_ps_surface_emit_footer), (_cairo_ps_surface_end_page),
        (_cairo_ps_surface_copy_page), (_cairo_ps_surface_show_page): Fix
        things up to conform with Adobe PostScript Document Structuring
        Conventions Specification. Thanks to Michael Sweet for bringing
        several items to our attention. Things that are fixed: Add Pages:
        (atend) to header, add Pages: N to trailer, properly advertise
        DocumentData of Binary rather than Clean7Bit, remove fictitious
        EndPage, move showpage to after the grestore.


Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- cairo-ps-surface.c	12 Jan 2006 21:36:36 -0000	1.67
+++ cairo-ps-surface.c	13 Jan 2006 21:41:45 -0000	1.68
@@ -94,15 +94,9 @@
 				 "%%!PS-Adobe-3.0\n"
 				 "%%%%Creator: cairo (http://cairographics.org)\n"
 				 "%%%%CreationDate: %s"
-				 "%%%%Title: Some clever title\n"
-#if DONE_ADDING_PAGES_SUPPORT_AFTER_SWITCHING_TO_PAGINATED
-				 "%%%%Pages: %d\n"
-#endif
+				 "%%%%Pages: (atend)\n"
 				 "%%%%BoundingBox: %f %f %f %f\n",
 				 ctime (&now),
-#if DONE_ADDING_PAGES_SUPPORT_AFTER_SWITCHING_TO_PAGINATED
-				 surface->pages.num_elements,
-#endif
 				 0.0, 0.0, 
 				 surface->width,
 				 surface->height);
@@ -110,7 +104,7 @@
     /* The "/FlateDecode filter" currently used is a feature of
      * LanguageLevel 3 */
     _cairo_output_stream_printf (surface->stream,
-				 "%%%%DocumentData: Clean7Bit\n"
+				 "%%%%DocumentData: Binary\n"
 				 "%%%%LanguageLevel: 3\n"
 				 "%%%%Orientation: Portrait\n"
 				 "%%%%EndComments\n");
@@ -121,7 +115,9 @@
 {
     _cairo_output_stream_printf (surface->stream,
 				 "%%%%Trailer\n"
-				 "%%%%EOF\n");
+				 "%%%%Pages: %d\n"
+				 "%%%%EOF\n",
+				 surface->num_pages);
 }
 
 static cairo_surface_t *
@@ -294,9 +290,6 @@
     _cairo_output_stream_printf (surface->stream,
 				 "grestore\n");
 
-    _cairo_output_stream_printf (surface->stream,
-				 "%%%%EndPage\n");
-
     surface->need_start_page = TRUE;
 }
 
@@ -305,10 +298,10 @@
 {
     cairo_ps_surface_t *surface = abstract_surface;
 
-    _cairo_output_stream_printf (surface->stream, "copypage\n");
-
     _cairo_ps_surface_end_page (surface);
 
+    _cairo_output_stream_printf (surface->stream, "copypage\n");
+
     return CAIRO_STATUS_SUCCESS;
 }
 
@@ -317,10 +310,10 @@
 {
     cairo_ps_surface_t *surface = abstract_surface;
 
-    _cairo_output_stream_printf (surface->stream, "showpage\n");
-
     _cairo_ps_surface_end_page (surface);
 
+    _cairo_output_stream_printf (surface->stream, "showpage\n");
+
     surface->need_start_page = TRUE;
 
     return CAIRO_STATUS_SUCCESS;



More information about the cairo-commit mailing list