Index: /pkpgcounter/trunk/tests/colors.pdf
===================================================================
--- /pkpgcounter/trunk/tests/colors.pdf (revision 380)
+++ /pkpgcounter/trunk/tests/colors.pdf (revision 405)
@@ -4,5 +4,7 @@
 1 0 obj
 % The standard fonts dictionary
-<< /F1 2 0 R >>
+<< /F1 2 0 R
+ /F2 3 0 R
+ /F3 13 0 R >>
 endobj
 % 'F1': class PDFType1Font 
@@ -15,13 +17,22 @@
  /Type /Font >>
 endobj
+% 'F2': class PDFType1Font 
+3 0 obj
+% Font Courier
+<< /BaseFont /Courier
+ /Encoding /WinAnsiEncoding
+ /Name /F2
+ /Subtype /Type1
+ /Type /Font >>
+endobj
 % 'Page1': class PDFPage 
-3 0 obj
-% Page dictionary
-<< /Contents 15 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+4 0 obj
+% Page dictionary
+<< /Contents 18 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -35,12 +46,12 @@
 endobj
 % 'Page2': class PDFPage 
-4 0 obj
-% Page dictionary
-<< /Contents 16 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+5 0 obj
+% Page dictionary
+<< /Contents 19 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -54,12 +65,12 @@
 endobj
 % 'Page3': class PDFPage 
-5 0 obj
-% Page dictionary
-<< /Contents 17 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+6 0 obj
+% Page dictionary
+<< /Contents 20 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -73,12 +84,12 @@
 endobj
 % 'Page4': class PDFPage 
-6 0 obj
-% Page dictionary
-<< /Contents 18 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+7 0 obj
+% Page dictionary
+<< /Contents 21 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -92,12 +103,12 @@
 endobj
 % 'Page5': class PDFPage 
-7 0 obj
-% Page dictionary
-<< /Contents 19 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+8 0 obj
+% Page dictionary
+<< /Contents 22 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -111,12 +122,12 @@
 endobj
 % 'Page6': class PDFPage 
-8 0 obj
-% Page dictionary
-<< /Contents 20 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+9 0 obj
+% Page dictionary
+<< /Contents 23 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -130,12 +141,12 @@
 endobj
 % 'Page7': class PDFPage 
-9 0 obj
-% Page dictionary
-<< /Contents 21 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+10 0 obj
+% Page dictionary
+<< /Contents 24 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -149,12 +160,12 @@
 endobj
 % 'Page8': class PDFPage 
-10 0 obj
-% Page dictionary
-<< /Contents 22 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
+11 0 obj
+% Page dictionary
+<< /Contents 25 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
  /Resources << /Font 1 0 R
   /ProcSet [ /PDF
@@ -168,44 +179,71 @@
 endobj
 % 'Page9': class PDFPage 
-11 0 obj
-% Page dictionary
-<< /Contents 23 0 R
- /MediaBox [ 0
-  0
-  595.2756
-  841.8898 ]
- /Parent 14 0 R
- /Resources << /Font 1 0 R
-  /ProcSet [ /PDF
-   /Text
-   /ImageB
-   /ImageC
-   /ImageI ] >>
- /Rotate 0
- /Trans <<  >>
- /Type /Page >>
-endobj
-% 'R12': class PDFCatalog 
 12 0 obj
+% Page dictionary
+<< /Contents 26 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
+ /Resources << /Font 1 0 R
+  /ProcSet [ /PDF
+   /Text
+   /ImageB
+   /ImageC
+   /ImageI ] >>
+ /Rotate 0
+ /Trans <<  >>
+ /Type /Page >>
+endobj
+% 'F3': class PDFType1Font 
+13 0 obj
+% Font Helvetica-Bold
+<< /BaseFont /Helvetica-Bold
+ /Encoding /WinAnsiEncoding
+ /Name /F3
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'Page10': class PDFPage 
+14 0 obj
+% Page dictionary
+<< /Contents 27 0 R
+ /MediaBox [ 0
+  0
+  595.2756
+  841.8898 ]
+ /Parent 17 0 R
+ /Resources << /Font 1 0 R
+  /ProcSet [ /PDF
+   /Text
+   /ImageB
+   /ImageC
+   /ImageI ] >>
+ /Rotate 0
+ /Trans <<  >>
+ /Type /Page >>
+endobj
+% 'R15': class PDFCatalog 
+15 0 obj
 % Document Root
-<< /Outlines 24 0 R
+<< /Outlines 28 0 R
  /PageMode /UseNone
- /Pages 14 0 R
+ /Pages 17 0 R
  /Type /Catalog >>
 endobj
-% 'R13': class PDFInfo 
-13 0 obj
+% 'R16': class PDFInfo 
+16 0 obj
 << /Author (anonymous)
- /CreationDate (20060828233705)
+ /CreationDate (20060911231409)
  /Producer (ReportLab http://www.reportlab.com)
  /Subject (unspecified)
  /Title (untitled) >>
 endobj
-% 'R14': class PDFPages 
-14 0 obj
+% 'R17': class PDFPages 
+17 0 obj
 % page tree
-<< /Count 9
- /Kids [ 3 0 R
-  4 0 R
+<< /Count 10
+ /Kids [ 4 0 R
   5 0 R
   6 0 R
@@ -214,33 +252,35 @@
   9 0 R
   10 0 R
-  11 0 R ]
+  11 0 R
+  12 0 R
+  14 0 R ]
  /Type /Pages >>
 endobj
-% 'R15': class PDFStream 
-15 0 obj
-% page stream
-<< /Filter [ /ASCII85Decode
-  /FlateDecode ]
- /Length 887 >>
-stream
-Gat%!CJ3_B'`BZZ+"lQ)/m9WNc#dK_AOL*,@;uZ!pa)-\::$-B,u*dP^Ya.1
-C:584%.e4Sc:Q=+]pHOQ]ZBf1Q*<g<m"tf5+jGRk?3odI>c.CF0,*l!,4U%r
-Jd`Vrm)=gR&=C`eO!J]HBaI:D_&LH@CJ1`cFL2(GOD<"4j154r+;?5=OSSVE
-4k<Nq>IoJe8o_a+4<<\Wl1c+D5EL>B?Sa$IRe3"g6'hYhaB^5_papRC;2()^
-=[Jg)4[2$o]$=5Y4gWe)C?6-9VJd[(`?]\4r)3]]Q);3/+G#uaYW2_j1!sUG
->+(QnP@TB=M_q"O+5]@(>B.0KXOmj^br)M&8MFKu10gO*5gG(.M%#eG^@Y9r
-#,O.hXe<h9(g9dE;FkrYLEOKh.D@X_9,+[a\W_er_WWDQN;hA"OMEe2^;K[4
-<RP\)SKr21,4Po$Hd&#<0H,Lp!IS`:?fct<A-<DJpd2@5SVP=/KT69/`J-F]
-_s,gdGX1/S5N]sH$,Wredt-EhKaG1$muP/O]cNcN[1b_AH^>01LOs<>H,9+d
-(G1GppZbph_A^eLUf,[118>5W\+P^%Z>MPM>ZQ8.nS2n^4ejboFisNGZR*j-
-Q5cdSonpl"l;P3VC>JOXKn!lKVPH8r7kfc`IU%A7=dr#k"gW9cLQ-+MK-GO&
-YoeD2?9b[\"ZV0?.UYtFR42#K/0<aKH3"h+O8\q[cAh]rb"6&@mKTs`_SJZJ
-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j(Yf<+GBa<tr>$?H?:<lXZZ
+-Io=KkND2a\`[7DCupmq[R5_pgTkHRe.;P4VX<H[b6i@cQri]hkQ-jqMSj0o
+""g`E[DKZfMtShuJ4a^n8MS2hV.P;c/fd%d[Kn/8d\^u.n/#sU91A~>endstream
+
+endobj
+% 'R19': class PDFStream 
+19 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -252,6 +292,6 @@
 
 endobj
-% 'R17': class PDFStream 
-17 0 obj
+% 'R20': class PDFStream 
+20 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -263,6 +303,6 @@
 
 endobj
-% 'R18': class PDFStream 
-18 0 obj
+% 'R21': class PDFStream 
+21 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -274,6 +314,6 @@
 
 endobj
-% 'R19': class PDFStream 
-19 0 obj
+% 'R22': class PDFStream 
+22 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -285,6 +325,6 @@
 
 endobj
-% 'R20': class PDFStream 
-20 0 obj
+% 'R23': class PDFStream 
+23 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -296,6 +336,6 @@
 
 endobj
-% 'R21': class PDFStream 
-21 0 obj
+% 'R24': class PDFStream 
+24 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -307,6 +347,6 @@
 
 endobj
-% 'R22': class PDFStream 
-22 0 obj
+% 'R25': class PDFStream 
+25 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -318,6 +358,6 @@
 
 endobj
-% 'R23': class PDFStream 
-23 0 obj
+% 'R26': class PDFStream 
+26 0 obj
 % page stream
 << /Filter [ /ASCII85Decode
@@ -329,45 +369,73 @@
 
 endobj
-% 'R24': class PDFOutlines 
-24 0 obj
+% 'R27': class PDFStream 
+27 0 obj
+% page stream
+<< /Filter [ /ASCII85Decode
+  /FlateDecode ]
+ /Length 894 >>
+stream
+Gau0C9lJc?%)!J@J)I0=2@Q$BIJ9,'m@h_"0JMSO-H_dnW<:m\p[dRX7H5dK
+,WVh+":h9K8+P'7_LT':epYlr0Zi7n%0M?H/V+3P+SuJsg%ed[^k&J&_%Q)d
+YW!Y[MGV8#BPRq+PX2a40A$4^DVhl,gq3EnBPP'T$J?NB^?thB0\Z=CngYAO
+(+fXEhAJmRkOk^R^ub/XR$U6EeXLsS^-hMUTR(*N[MuZiMnEq8PQ,gqZ762`
+XHlL\5n4F+#*r9"L6ornJQ3-iXsdY5(Y`@0!d?q@XoHpt;cZWleA0tSG]kt*
+Q0X7L-eAO,jfSWX.D`mdBjNnTg`jspB#bS?ga`!2q<GX9E!__85qJiom%f=8
++Q64=XtE%CAX%u#PVB/:2IW[V%kAKZX[glLX>D!L(t&J>A7;PN*gXjebl(^^
+"$nQeL9\t+'k9W^TkQocWE1V$MFP3.Lm>u`'uXUi?Rt&&;Q<\U?`@^d"&#=O
+B]/dB8J'*me[aR,Bf0U9<_?U^GMN`H-i:n+$T%Z24Ul]gi#,HD:5,$mn*kLV
+3fuj5)Sn1r91%eJXiBLd_P2"N/h&=q7fB*)iA'U>gLC<LfN_<(7Xas3,/RO/
+g"oZl)(5=$&.>ra5@q>_+&&*'kq!*@rHIW-Hh'&dl&]nNp."/,qCJ3HdiiR?
+C"fqVm'@ZkS.8DoZ62W@%-E`"c((6-\KnDP4]).lE^:A6ris&-MGaE+*^bco
+F%N>J2a5F^$)Pu-)/!Yr)+5'$AWY<#Vp&EPh4@#1:psHc?/"XR-:Y7:?hC=m
+ARoQJ6[U_u'IT8Gj/<,E_<;e-NA5;D3E`]9KAfq7D:`@ST'G9,(l(SNQ9$1)
+9i"KSn0bG1h;8Y(BE%uHN0WZ~>endstream
+
+endobj
+% 'R28': class PDFOutlines 
+28 0 obj
 << /Count 0
  /Type /Outlines >>
 endobj
 xref
-0 25
+0 29
 0000000000 65535 f
 0000000113 00000 n
-0000000209 00000 n
-0000000372 00000 n
-0000000663 00000 n
-0000000954 00000 n
-0000001245 00000 n
-0000001536 00000 n
-0000001827 00000 n
-0000002118 00000 n
-0000002409 00000 n
-0000002701 00000 n
-0000002994 00000 n
-0000003132 00000 n
-0000003330 00000 n
-0000003511 00000 n
-0000004543 00000 n
-0000004796 00000 n
-0000005050 00000 n
-0000005304 00000 n
-0000005557 00000 n
-0000005808 00000 n
-0000006060 00000 n
-0000006312 00000 n
-0000006567 00000 n
+0000000234 00000 n
+0000000399 00000 n
+0000000558 00000 n
+0000000849 00000 n
+0000001140 00000 n
+0000001431 00000 n
+0000001722 00000 n
+0000002013 00000 n
+0000002304 00000 n
+0000002596 00000 n
+0000002888 00000 n
+0000003182 00000 n
+0000003357 00000 n
+0000003650 00000 n
+0000003788 00000 n
+0000003986 00000 n
+0000004179 00000 n
+0000005247 00000 n
+0000005500 00000 n
+0000005754 00000 n
+0000006008 00000 n
+0000006261 00000 n
+0000006512 00000 n
+0000006764 00000 n
+0000007016 00000 n
+0000007269 00000 n
+0000008310 00000 n
 trailer
 << /ID 
   % ReportLab generated PDF document -- digest (http://www.reportlab.com) 
-  [(\340\(*\203\347#4m\3439\361`\027\324\364\222) (\340\(*\203\347#4m\3439\361`\027\324\364\222)] 
+  [(s\242'\002\325\364\351\177k"\2261\351\326\222G) (s\242'\002\325\364\351\177k"\2261\351\326\222G)] 
  
- /Info 13 0 R
- /Root 12 0 R
- /Size 25 >>
+ /Info 16 0 R
+ /Root 15 0 R
+ /Size 29 >>
 startxref
-6619
+8362
 %%EOF
Index: /pkpgcounter/trunk/tests/runcolors.py
===================================================================
--- /pkpgcounter/trunk/tests/runcolors.py (revision 381)
+++ /pkpgcounter/trunk/tests/runcolors.py (revision 405)
@@ -23,24 +23,27 @@
 #
 
-"""This document was created with the help of the ReportLab ToolKit (tm)
-available as Free Software from http://www.reportlab.org
+"""This document was created with the help of the ReportLab
+ToolKit (tm) available as Free Software from :
 
-It contains 9 pages, including this one.
+        http://www.reportlab.org
 
-Each page after this one is entirely filled with 100% of a particular
-color, as described below :
+It contains 10 pages, including this one.
 
-Page 1 ====> This notice
-Page 2 ====> Red
-Page 3 ====> Green
-Page 4 ====> Blue
-Page 5 ====> Cyan
-Page 6 ====> Magenta
-Page 7 ====> Yellow
-Page 8 ====> Black
-Page 9 ====> White
+Each page after this one is entirely filled with 100%
+of a particular color, as described below :
 
-This document helps to ensure that the computation of ink coverage
-made by pkpgcounter works as expected.
+Page  1 ====> This notice
+Page  2 ====> Red
+Page  3 ====> Green
+Page  4 ====> Blue
+Page  5 ====> Cyan
+Page  6 ====> Magenta
+Page  7 ====> Yellow
+Page  8 ====> Black
+Page  9 ====> White
+Page 10 ====> The expected results.
+
+This document helps to ensure that the computation of
+ink coverage made by pkpgcounter works as expected.
 
 To check by yourself :
@@ -53,4 +56,56 @@
 
 Please report any problem to : alet@librelogiciel.com
+"""
+
+lastpage = """For each colorspace, the results for the last page will differ a bit from what is below.
+The important values are the one for pages 2 to 9 included.
+
+Colorspace : BW
+B :   2.355336%
+B :  70.196078%
+B :  41.568627%
+B :  88.627451%
+B :  30.196078%
+B :  58.823529%
+B :  11.764706%
+B : 100.000000%
+B :   0.000000%
+B :   3.500669%
+
+Colorspace : RGB
+R :  97.644664%      G :  97.644664%      B :  97.644664%
+R : 100.000000%      G :   0.000000%      B :   0.000000%
+R :   0.000000%      G : 100.000000%      B :   0.000000%
+R :   0.000000%      G :   0.000000%      B : 100.000000%
+R :   0.000000%      G : 100.000000%      B : 100.000000%
+R : 100.000000%      G :   0.000000%      B : 100.000000%
+R : 100.000000%      G : 100.000000%      B :   0.000000%
+R :   0.000000%      G :   0.000000%      B :   0.000000%
+R : 100.000000%      G : 100.000000%      B : 100.000000%
+R :  96.499331%      G :  96.499331%      B :  96.499331%
+
+Colorspace : CMY
+C :   2.355336%      M :   2.355336%      Y :   2.355336%
+C :   0.000000%      M : 100.000000%      Y : 100.000000%
+C : 100.000000%      M :   0.000000%      Y : 100.000000%
+C : 100.000000%      M : 100.000000%      Y :   0.000000%
+C : 100.000000%      M :   0.000000%      Y :   0.000000%
+C :   0.000000%      M : 100.000000%      Y :   0.000000%
+C :   0.000000%      M :   0.000000%      Y : 100.000000%
+C : 100.000000%      M : 100.000000%      Y : 100.000000%
+C :   0.000000%      M :   0.000000%      Y :   0.000000%
+C :   3.500669%      M :   3.500669%      Y :   3.500669%
+
+Colorspace : CMYK
+C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   2.355336%
+C :   0.000000%      M : 100.000000%      Y : 100.000000%      K :   0.000000%
+C : 100.000000%      M :   0.000000%      Y : 100.000000%      K :   0.000000%
+C : 100.000000%      M : 100.000000%      Y :   0.000000%      K :   0.000000%
+C : 100.000000%      M :   0.000000%      Y :   0.000000%      K :   0.000000%
+C :   0.000000%      M : 100.000000%      Y :   0.000000%      K :   0.000000%
+C :   0.000000%      M :   0.000000%      Y : 100.000000%      K :   0.000000%
+C :   0.000000%      M :   0.000000%      Y :   0.000000%      K : 100.000000%
+C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   0.000000%
+C :   0.000000%      M :   0.000000%      Y :   0.000000%      K :   3.500669%
 """
 
@@ -72,8 +127,8 @@
     
     # First we output the explanations on the first page.
-    canv.setFont("Helvetica", 16)
+    canv.setFont("Courier", 14)
     for line in __doc__.split("\n") :
         canv.drawString(xbase, ybase, line)
-        ybase -= 24
+        ybase -= 18
     canv.showPage()
     
@@ -96,3 +151,14 @@
         canv.rect(0, 0, width, height, fill=1)
         canv.showPage()
+        
+    # Finally outputs the expected results.
+    canv.setFont("Helvetica-Bold", 16)
+    canv.drawCentredString(width/2.0, height-1.5*cm, "Expected Results :")
+    ybase = height - 3*cm
+    canv.setFont("Courier", 10)
+    for line in lastpage.split("\n") :
+        canv.drawString(xbase, ybase, line)
+        ybase -= 14
+    canv.showPage()
+        
     canv.save()        
