[Checkins] SVN: z3c.rml/trunk/ Added `href` and `destination` to table cells.
Stephen Richter
cvs-admin at zope.org
Thu Dec 20 17:16:29 UTC 2012
Log message for revision 128807:
Added `href` and `destination` to table cells.
Changed:
U z3c.rml/trunk/CHANGES.txt
U z3c.rml/trunk/RML-DIFFERENCES.txt
U z3c.rml/trunk/src/z3c/rml/flowable.py
A z3c.rml/trunk/src/z3c/rml/tests/expected/tag-blockTable-10.pdf
A z3c.rml/trunk/src/z3c/rml/tests/input/tag-blockTable-10.rml
-=-
Modified: z3c.rml/trunk/CHANGES.txt
===================================================================
--- z3c.rml/trunk/CHANGES.txt 2012-12-20 16:34:40 UTC (rev 128806)
+++ z3c.rml/trunk/CHANGES.txt 2012-12-20 17:16:29 UTC (rev 128807)
@@ -60,6 +60,8 @@
- Implemented ``plugInGraphic`` which allows inserting graphics rendered in
Python.
+- Added `href` and `destination` to table cells.
+
- Bug: Due to a logic error, bad directives were never properly detected and
logged about.
Modified: z3c.rml/trunk/RML-DIFFERENCES.txt
===================================================================
--- z3c.rml/trunk/RML-DIFFERENCES.txt 2012-12-20 16:34:40 UTC (rev 128806)
+++ z3c.rml/trunk/RML-DIFFERENCES.txt 2012-12-20 17:16:29 UTC (rev 128807)
@@ -30,6 +30,10 @@
- ``<keepTogether>``: This directive is not implemented in RML2PDF, but there
exists an API flowable for it and it seems obviously useful.
+- ``catchForms``: This feature requires PageCatcher, which is a ReportLab
+ commercial product and there is no Open Source alternative.
+
+
To be Done
----------
@@ -64,8 +68,6 @@
- includePdfPages
-- plugInGraphic (Test 037)
-
- figure
- imageFigure
@@ -81,7 +83,6 @@
- form
-- catchForms
- lineMode: -miterLimit
@@ -135,6 +136,6 @@
- -pdfInclude
-- rectangle, table row, table cell, etc.: href and/or destination (Test 038)
+- rectangle.: href and/or destination (Test 038)
- -addMapping
Modified: z3c.rml/trunk/src/z3c/rml/flowable.py
===================================================================
--- z3c.rml/trunk/src/z3c/rml/flowable.py 2012-12-20 16:34:40 UTC (rev 128806)
+++ z3c.rml/trunk/src/z3c/rml/flowable.py 2012-12-20 17:16:29 UTC (rev 128807)
@@ -523,6 +523,18 @@
description=u'The space of the line right of the cell.',
required=False)
+ href = attr.Text(
+ title=u'Link URL',
+ description=u'When specified, the cell becomes a link to that URL.',
+ required=False)
+
+ destination = attr.Text(
+ title=u'Link Destination',
+ description=(u'When specified, the cell becomes a link to that '
+ u'destination.'),
+ required=False)
+
+
class TableCell(directive.RMLDirective):
signature = ITableCell
styleAttributesMapping = (
@@ -545,6 +557,8 @@
'lineLeftCap', 'lineLeftCount', 'lineLeftSpace')),
('LINEAFTER', ('lineRightThickness', 'lineRightColor',
'lineRightCap', 'lineRightCount', 'lineRightSpace')),
+ ('HREF', ('href',)),
+ ('DESTINATION', ('destination',)),
)
def processStyle(self):
Added: z3c.rml/trunk/src/z3c/rml/tests/expected/tag-blockTable-10.pdf
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/expected/tag-blockTable-10.pdf (rev 0)
+++ z3c.rml/trunk/src/z3c/rml/tests/expected/tag-blockTable-10.pdf 2012-12-20 17:16:29 UTC (rev 128807)
@@ -0,0 +1,183 @@
+%PDF-1.4
+% ReportLab Generated PDF document http://www.reportlab.com
+% 'BasicFonts': class PDFDictionary
+1 0 obj
+% The standard fonts dictionary
+<< /F1 2 0 R
+ /F2 3 0 R
+ /F3 4 0 R >>
+endobj
+% 'F1': class PDFType1Font
+2 0 obj
+% Font Helvetica
+<< /BaseFont /Helvetica
+ /Encoding /WinAnsiEncoding
+ /Name /F1
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'F2': class PDFType1Font
+3 0 obj
+% Font Courier-Bold
+<< /BaseFont /Courier-Bold
+ /Encoding /WinAnsiEncoding
+ /Name /F2
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'F3': class PDFType1Font
+4 0 obj
+% Font Helvetica-Bold
+<< /BaseFont /Helvetica-Bold
+ /Encoding /WinAnsiEncoding
+ /Name /F3
+ /Subtype /Type1
+ /Type /Font >>
+endobj
+% 'Page1': class PDFPage
+5 0 obj
+% Page dictionary
+<< /Contents 12 0 R
+ /MediaBox [ 0
+ 0
+ 595.2756
+ 841.8898 ]
+ /Parent 11 0 R
+ /Resources << /Font 1 0 R
+ /ProcSet [ /PDF
+ /Text
+ /ImageB
+ /ImageC
+ /ImageI ] >>
+ /Rotate 0
+ /Trans << >>
+ /Type /Page >>
+endobj
+% 'Annot.NUMBER1': class PDFDictionary
+6 0 obj
+<< /A << /S /URI
+ /Type /Action
+ /URI (http://google.com) >>
+ /Border [ 0
+ 0
+ 0 ]
+ /Rect [ 72
+ 741.6535
+ 297.5
+ 770 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Annot.NUMBER2': class LinkAnnotation
+7 0 obj
+<< /Border [ 0
+ 0
+ 0 ]
+ /Contents ()
+ /Dest [ 5 0 R
+ /Fit ]
+ /Rect [ 297.5
+ 741.6535
+ 523
+ 770 ]
+ /Subtype /Link
+ /Type /Annot >>
+endobj
+% 'Page2': class PDFPage
+8 0 obj
+% Page dictionary
+<< /Annots [ 6 0 R
+ 7 0 R ]
+ /Contents 13 0 R
+ /MediaBox [ 0
+ 0
+ 595.2756
+ 841.8898 ]
+ /Parent 11 0 R
+ /Resources << /Font 1 0 R
+ /ProcSet [ /PDF
+ /Text
+ /ImageB
+ /ImageC
+ /ImageI ] >>
+ /Rotate 0
+ /Trans << >>
+ /Type /Page >>
+endobj
+% 'R9': class PDFCatalog
+9 0 obj
+% Document Root
+<< /Outlines 14 0 R
+ /PageMode /UseNone
+ /Pages 11 0 R
+ /Type /Catalog >>
+endobj
+% 'R10': class PDFInfo
+10 0 obj
+<< /Author (\(anonymous\))
+ /CreationDate (D:20121220121136+05'00')
+ /Creator (\(unspecified\))
+ /Keywords ()
+ /Producer (ReportLab PDF Library - www.reportlab.com)
+ /Subject (\(unspecified\))
+ /Title (\(anonymous\)) >>
+endobj
+% 'R11': class PDFPages
+11 0 obj
+% page tree
+<< /Count 2
+ /Kids [ 5 0 R
+ 8 0 R ]
+ /Type /Pages >>
+endobj
+% 'R12': class PDFStream
+12 0 obj
+% page stream
+<< /Filter [ /ASCII85Decode
+ /FlateDecode ]
+ /Length 252 >>
+stream
+Gar?,b79+X&4Q==r52g7M*MF\(<2&*<btIl#667s0-;J9q3DWBBVoK"dlZ$"/)]\(]Oq\X+ZPU7OJ!hODu61E4#2eRBo#V*8-FC?j]p=Vi]T]Q)_=?\KK>e/U`B6%84$DM7$lr&_ck;M-Wk*=AJHM*X^:fAHodBKG$(!ifW(gd^$H-FAR!tm6?=]l?5a[T]REEuPQ"p6mUTb#qCs3"1]/1Ers!hT(`$D8^//LnUW5C:Ps$jM3+*Y#G-=SJ~>endstream
+endobj
+% 'R13': class PDFStream
+13 0 obj
+% page stream
+<< /Filter [ /ASCII85Decode
+ /FlateDecode ]
+ /Length 159 >>
+stream
+Gar'"_$YfK&4Gspq[[bT4f$buke3Wq$>j5OTN"2kdJlEJJcUuSjtOFQ/$SOhokt&+MFT0.#ON\kGj#Np19F5jYdHjc`DiN>d:'=phZfrogLRq_`]:XG!d$oZ/^#jHDpT)B^I#(;'+RjrT/.5>pniRU#NV="Vu~>endstream
+endobj
+% 'R14': class PDFOutlines
+14 0 obj
+<< /Count 0
+ /Type /Outlines >>
+endobj
+xref
+0 15
+0000000000 65535 f
+0000000113 00000 n
+0000000233 00000 n
+0000000398 00000 n
+0000000569 00000 n
+0000000742 00000 n
+0000001035 00000 n
+0000001257 00000 n
+0000001443 00000 n
+0000001750 00000 n
+0000001887 00000 n
+0000002158 00000 n
+0000002273 00000 n
+0000002667 00000 n
+0000002970 00000 n
+trailer
+<< /ID
+ % ReportLab generated PDF document -- digest (http://www.reportlab.com)
+ [(-<j\(\341V\)\016\302\364v\265?8\321\365) (-<j\(\341V\)\016\302\364v\265?8\321\365)]
+
+ /Info 10 0 R
+ /Root 9 0 R
+ /Size 15 >>
+startxref
+3022
+%%EOF
Added: z3c.rml/trunk/src/z3c/rml/tests/input/tag-blockTable-10.rml
===================================================================
--- z3c.rml/trunk/src/z3c/rml/tests/input/tag-blockTable-10.rml (rev 0)
+++ z3c.rml/trunk/src/z3c/rml/tests/input/tag-blockTable-10.rml 2012-12-20 17:16:29 UTC (rev 128807)
@@ -0,0 +1,34 @@
+<!DOCTYPE document SYSTEM "rml.dtd">
+<document
+ filename="tag-blockTable-10.pdf"
+ xmlns:doc="http://namespaces.zope.org/rml/doc">
+
+ <template>
+ <pageTemplate id="main">
+ <frame id="first" x1="72" y1="72" width="451" height="698"/>
+ </pageTemplate>
+ </template>
+
+ <story>
+
+ <title>
+ <font face="Courier"><blockTable></font> Tag Demo with Links
+ </title>
+
+ <bookmarkPage
+ name="top" fitType="fitv" zoom="2"
+ left="2cm" right="10cm" top="20cm"
+ />
+ <para>Table on the next page.</para>
+
+ <nextPage />
+
+ <blockTable colWidths="50% 50%" rowHeights="1cm">
+ <tr>
+ <td href="http://google.com">Google</td>
+ <td destination="top">TOP</td>
+ </tr>
+ </blockTable>
+
+ </story>
+</document>
More information about the checkins
mailing list