-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got 2 more RML testsuite files working.
- Loading branch information
Showing
5 changed files
with
209 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> | ||
<!DOCTYPE document SYSTEM "rml_1_0.dtd"> | ||
<document filename="test_009_splitting.pdf"> | ||
|
||
|
||
<template pageSize="(595, 842)" leftMargin="72" showBoundary="1"> | ||
<pageTemplate id="main"> | ||
<pageGraphics> | ||
<setFont name="Helvetica-BoldOblique" size="18"/> | ||
<drawRightString x="523" y="800">RML2PDF Test Suite - Test #9</drawRightString> | ||
</pageGraphics> | ||
<frame id="first" x1="1in" y1="5.845in" width="6.27in" height="4in"/> | ||
<frame id="second" x1="1in" y1="1in" width="6.27in" height="4in"/> | ||
</pageTemplate> | ||
</template> | ||
|
||
<stylesheet> | ||
<initialize></initialize> | ||
|
||
<paraStyle name="h1" | ||
fontName="Courier-Bold" | ||
fontSize="12" | ||
spaceBefore = "0.5 cm" | ||
/> | ||
|
||
<paraStyle name="style1" | ||
fontName="Courier" | ||
fontSize="10" | ||
/> | ||
|
||
|
||
<paraStyle name="heading" | ||
fontName="Helvetica-Bold" | ||
fontSize="24" | ||
leading="28" | ||
spaceBefore = "24" | ||
/> | ||
|
||
<paraStyle name="head_keep" | ||
fontName="Helvetica-Bold" | ||
fontSize="24" | ||
leading="28" | ||
spaceBefore = "24" | ||
keepWithNext="1" | ||
/> | ||
|
||
<paraStyle name="head_nokeep" | ||
fontName="Helvetica-Bold" | ||
fontSize="24" | ||
leading="28" | ||
spaceBefore = "24" | ||
keepWithNext="0" | ||
/> | ||
|
||
<paraStyle name="body" | ||
fontName="Helvetica" | ||
fontSize="12" | ||
leading="14" | ||
spaceBefore = "3" | ||
/> | ||
|
||
|
||
<blockTableStyle id="myStyle"> | ||
<blockAlignment value="center"/> | ||
<blockFont name="Helvetica-Oblique"/> | ||
<lineStyle kind="GRID" colorName="black"/> | ||
</blockTableStyle> | ||
|
||
</stylesheet> | ||
|
||
|
||
<story> | ||
<spacer length="3.65in"/> | ||
<para style="style1">This page tests splitting - this PARAGRAPH in style 'style1' should | ||
split between the two frames on this page. This page tests splitting - | ||
this paragraph should split between the two frames on this page. This | ||
page tests splitting - this paragraph should split between the two | ||
frames on this page. This page tests splitting - this paragraph should | ||
split between the two frames on this page. This page tests splitting - | ||
this paragraph should split between the two frames on this page. | ||
</para> | ||
|
||
<nextFrame/> | ||
|
||
<spacer length="3.65in"/> | ||
<pre style="style1">This page tests splitting - this PRE in style | ||
'style1' should split between the two frames on this page. These | ||
frames should be ON PAGE TWO, otherwise this test has FAILED. This | ||
page tests splitting - this preformatted paragraph should split between the | ||
two -- (proves this is a pre) | ||
frames on this page. This page tests splitting - this pre should | ||
split between the two frames on this page. This page tests splitting - | ||
this pre should split between the two frames on this page. This | ||
page tests splitting - this pre should split between the two | ||
frames on this page. </pre> | ||
|
||
<nextFrame/> | ||
|
||
<spacer length="3.65in"/> | ||
|
||
<blockTable colWidths="3cm, 3cm,3cm" style="myStyle"> | ||
<tr> <td>This tests </td> <td>how a </td><td>simple table</td></tr> | ||
<tr> <td>splits</td> <td>across</td><td>frames</td></tr> | ||
<tr> <td>blah</td> <td>blah</td><td>blah</td></tr> | ||
</blockTable> | ||
|
||
<nextFrame/> | ||
|
||
<spacer length="3.65in"/> | ||
|
||
<plugInFlowable module="module" function="myPreformatted"/> | ||
|
||
|
||
|
||
</story> | ||
|
||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Andy Robinson (Reportlab Inc.) --> | ||
<!DOCTYPE document SYSTEM "rml_1_0.dtd"> | ||
<document filename="test_010_linkURL.pdf"> | ||
<template pageSize="(595, 842)" leftMargin="72" showBoundary="1"> | ||
<pageTemplate id="main"> | ||
<frame id="first" x1="1in" y1="1in" width="6.27in" height="9.69in"/> | ||
</pageTemplate> | ||
</template> | ||
<stylesheet> | ||
</stylesheet> | ||
<story> | ||
<para>These should have links.</para> | ||
<blockTable colWidths="5cm,5cm"> | ||
<blockTableStyle id="temp001"> | ||
<blockAlignment value="left"/> | ||
<blockFont name="Helvetica-Oblique"/> | ||
<lineStyle kind="GRID" colorName="black"/> | ||
<lineStyle kind="OUTLINE" colorName="black" thickness="2"/> | ||
<blockBackground colorName="pink" start="0,0" stop="-1,0"/> | ||
<blockBackground colorName="yellow" start="0,0" stop="-1,0"/> | ||
</blockTableStyle> | ||
<tr><td>Name</td><td>Email</td></tr> | ||
<tr> | ||
<td>Robin</td> | ||
<td><plugInFlowable module="mymodule" function="linkURL">("mailto:robin@reportlab.com",)</plugInFlowable></td> | ||
</tr> | ||
</blockTable> | ||
</story> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
############################################################################## | ||
# | ||
# Copyright (c) 2007 Zope Corporation and Contributors. | ||
# All Rights Reserved. | ||
# | ||
# This software is subject to the provisions of the Zope Public License, | ||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
# FOR A PARTLAR PURPOSE. | ||
# | ||
############################################################################## | ||
"""Testing all XML Locale functionality. | ||
$Id$ | ||
""" | ||
import reportlab.platypus | ||
import reportlab.lib.styles | ||
|
||
def myPreformatted(params): | ||
return reportlab.platypus.Preformatted(''' | ||
Hey, this is a long text from a plugin. Hey, this is a long text from | ||
a plugin. Hey, this is a long text from a plugin. Hey, this is a long | ||
text from a plugin. Hey, this is a long text from a plugin. Hey, this | ||
is a long text from a plugin. Hey, this is a long text from a | ||
plugin. Hey, this is a long text from a plugin. Hey, this is a long | ||
text from a plugin. Hey, this is a long text from a plugin. Hey, this | ||
is a long text from a plugin. Hey, this is a long text from a | ||
plugin. Hey, this is a long text from a plugin. Hey, this is a long | ||
text from a plugin. Hey, this is a long text from a plugin. Hey, this | ||
is a long text from a plugin.''', | ||
reportlab.lib.styles.getSampleStyleSheet()['Normal']) | ||
|
||
class LinkURL(reportlab.platypus.flowables.Flowable): | ||
def __init__(self, link): | ||
self.link = link | ||
|
||
def wrap(self, *args): | ||
return (0, 0) | ||
|
||
def draw(self): | ||
self.canv.linkURL(self.link, None) | ||
|
||
|
||
def linkURL(params): | ||
params = eval(params) | ||
return ( | ||
reportlab.platypus.Paragraph( | ||
params[0], reportlab.lib.styles.getSampleStyleSheet()['Normal']), | ||
LinkURL(*params)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters