1
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
2
<!DOCTYPE presentation SYSTEM "../pythonpoint.dtd">
3
<presentation filename="pythonpoint.pdf" pageDuration="3">
4
<stylesheet module="standard" function="getParagraphStyles"/>
5
<title>PythonPoint Demonstration</title>
6
<author>Andy Robinson</author>
7
<subject>Reportlab Sample Applications</subject>
9
<!-- any graphics in the section go on all its pages as a backdrop -->
10
<rectangle height="555" fill="ReportLabBlue" x="20" width="96" y="20"/>
11
<!--fixedimage height="64" filename="leftlogo.gif" x="20" width="96" y="510"/-->
12
<customshape module="customshapes" class="Logo" initargs="(20,510,96,64)"/>
13
<!--infostring size="14" align="right" x="800" y="36">
14
»%(title)s, page %(page)s«
16
<!-- Now for the slides -->
17
<slide title="Introduction" id="Slide001" effectname="Wipe">
18
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
19
<para style="Heading1">
20
Welcome to PythonPoint
22
<para style="BodyText">
23
...a library for creating presentation slides.
25
<para style="BodyText">
29
lets you create attractive and consistent presentation slides
30
on any platform. It is a demo app built on top of the PDFgen PDF library
31
and the PLATYPUS Page Layout library. Essentially, it converts slides
32
in an XML format to PDF.
34
<para style="BodyText">
35
It can be used right now to create slide shows, but will
36
undoubtedly change and evolve. Read on for a tutorial...
41
Smile and look them in the eye!
45
<slide title="Part 1" id="Part1" effectname="Blinds" effectdirection="0">
46
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
50
<para style="Heading1">
51
Part 1 – Feature Overview
55
<slide title="XML Notation" id="Slide002" effectname="Blinds" effectdirection="0" outlinelevel="1">
56
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
57
<para style="Heading1">
60
<para style="BodyText">
61
You create slides in a text editor with a basic
62
XML syntax looking like this:
64
<prefmt style="Code"><![CDATA[
65
<frame x="160" y="72" width="600" height="468"
66
leftmargin="36" rightmargin="36">
67
<para style='Heading1'>
68
Welcome to PythonPoint
70
<para style='BodyText'>
71
...a library for creating presentation slides.
74
<para style="BodyText">
75
Pythonpoint then converts these into slides. Just enter
76
"pythonpoint.py myfile.xml" to create a PDF document
77
(usually called "myfile.pdf", but you specify that in the XML).
81
<slide title="Page Layout" id="Slide003" effectname="Box" outlinelevel="1">
82
<frame height="468" border="true" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
83
<para style="Heading1">
86
<para style="BodyText">
87
The Page Layout model comes from PLATYPUS (Page Layout and Typography Using Scripts),
88
a key component of the toolkit. This covers concepts such as:
91
Reusable 'Drawable Objects'
94
Frames into which objects flow (like this one, around which we have drawn a border)
97
Style Sheets for text, table cells, line styles etc.
100
Wrapping, page breaking an document management logic
102
<para style="BodyText">
103
Everything is open and extensible. I hope a library of
104
reusable objects such as charts and diagrams will grow up.
108
<slide title="Reuse" id="Slide004" effectname="Wipe" outlinelevel="1">
109
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
110
<para style="Heading1">
111
Reuse and Consistency – Sections
113
<para style="BodyText">
114
You can create a 'section' spanning some or all tags in the presentation
115
and place graphics on this. The blue border and title come from the
116
section. Here's how we did the border:
118
<prefmt style="Code"><![CDATA[
119
<presentation filename='pythonpoint.pdf'>
120
<section name = 'Main'>
121
<!-- any graphics in the section go on all its pages as a backdrop -->
122
<rectangle x="20" y="510" width="800" height="65" fill="(0,0,1)"/>
123
<rectangle x="20" y="20" width="65" height="555" fill="(0,0,1)"/>
124
...all slides go here...
128
<para style="BodyText">
129
Thus you can re-brand an entire presentation for
130
a new audience in seconds.
134
<slide title="Styles" id="Slide005" effectname="Dissolve" outlinelevel="1">
135
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
136
<para style="Heading1">
139
<para style="BodyText">
140
Paragraph styles are defined externally. You may specify a filename
141
from which to load a stylesheet with the stylesheet tag.
143
<para style="BodyText">
144
Thus you can have different sizes and formats by switching
145
stylesheets, or colour and black-and-white options.
147
<para style="BodyText">
148
When they are added, tables will be driven by line and cell
149
styles in a similar way.
153
<slide title="Special Effects" id="Slide006" effectname="Dissolve" outlinelevel="1">
154
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
155
<para style="Heading1">
158
<para style="BodyText">
159
Acrobat Reader supports tags to define page transition effects.
160
If you are reading this on screen, you should have seen a selection
163
<para style="Bullet">
166
<para style="Bullet">
169
<para style="Bullet">
172
<para style="Bullet">
175
<para style="Bullet">
178
<para style="Bullet">
181
<para style="BodyText">
182
Each has a range of options to fine-tune.
184
<para style="BodyText">
185
When they are added, tables will be driven by line and cell
186
styles in a similar way.
190
<slide title="Outlines and Hyperlinks" id="Slide007" effectname="Wipe" outlinelevel="1">
191
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
192
<para style="Heading1">
193
Outlines and Hyperlinks
195
<para style="BodyText">
196
By default, we generate an outline view in the left pane to
197
help you navigate. Hyperlinks within documents are also
200
<para style="BodyText">
201
As far as we know, this is the first PDF library to expose
206
<slide title="Basic Shapes" id="Slide008" effectname="Wipe" outlinelevel="1">
207
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
208
<para style="Heading1">
212
Here are some of the basic shapes available for decorating pages...
215
<rectangle height="50" fill="(0,1,1)" x="200" width="100" y="300"/>
216
<roundrect height="50" x="350" y="300" radius="15" fill="(0,1,1)" width="100"/>
217
<line y1="300" y2="350" x1="500" x2="600"/>
218
<ellipse fill="(0,1,1)" y1="300" y2="350" x1="650" x2="750"/>
219
<polygon points="(200,200),(300,200),(350,180),(250,150)" fill="(0,1,1)"/>
220
<string size="14" color="(1,0,0)" align="center" x="500" y="200">
221
This is a\nmulti-line string\nplaced directly on the page.\n\nIt can be left-aligned,\ncentred,\nor right-aligned.
223
<customshape module="customshapes" class="Jigsaw" initargs="(700,200,1)"/>
225
<slide title="Tables" id="Slide008a" effectname="Glitter" outlinelevel="1">
226
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
227
<para style="Heading1">
231
The Table tag lets you paste in bulk data and format it attractively:
233
<spacer height="24"/>
234
<table heights="(28,28,28,28,28)" style="table1" widths="(144,72,72,72,108)">
235
Division,Jan,Feb,Mar,Q1 Total
236
North,100,115,120,335
237
South,215,145,180,540
243
<slide title="Future Features" id="Slide009" effectname="Glitter" outlinelevel="1">
244
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
245
<para style="Heading1">
248
<para style="BodyText">
249
This is the first version that runs. A lot can now be added fairly easily:
251
<para style="Bullet">
252
Preprocessor to let you enter paragraphs and
253
bullets as one block of text, with less tag typing!
255
<para style="Bullet">
258
<para style="Bullet">
259
PINGO drawings – 'Object Graphics' tags with grouping and coordinate transformations
261
<para style="Bullet">
262
Speaker notes and a mode to print them
264
<para style="Bullet">
265
Tools to archive slides in a database and build presentations to order
267
<para style="Italic">
268
...what else can YOU think of?
272
<slide title="Part 2" id="Part2" effectname="Blinds" effectdirection="0" outlinelevel="0">
273
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
277
<para style="Heading1">
278
Part 2 – Reference
281
<para style="Centered">
282
This section covers all command line options
283
and tags currently in use.
287
<slide title="Command Line Options" id="Slide200" effectname="Blinds" effectdirection="0" outlinelevel="1">
288
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
289
<para style="Heading2">
293
Usage (NT, or executable Unix script):
297
pythonpoint.py [/notes] myslides.xml
301
or (Win9x or non-executable script)
305
python pythonpoint.py [/notes] myslides.xml
308
<para style="BodyText">
311
<para style="Bullet">
312
The resulting PDF file has the same
313
name as the input file.
315
<para style="Bullet">
316
The Speaker Notes mode prints a shrunken canvas with
317
room for notes around the edge. To create notes, make
318
an extra frame off the page. See the source of
319
Pythonpoint.xml slide 001 for an example.
323
<slide title="Tag: Presentation" id="Slide201" effectname="Blinds" effectdirection="0" outlinelevel="1">
324
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
325
<para style="Heading2">
328
<para style="BodyText">
329
This is the outermost tag in an XML file and is always required.
331
<para style="Italic">
334
<para style="Indent">
337
<para style="Italic">
340
<para style="Indent">
341
section, stylesheet, slides
344
<para style="Italic">
347
<para style="Indent">
348
Support for page sizes, opening modes
352
<slide title="Tag: Stylesheet" id="Slide202" effectname="Blinds" effectdirection="0" outlinelevel="1">
353
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
354
<para style="Heading2">
357
<para style="BodyText">
358
This defines an external style sheet full of paragraph styles.
359
For now, these are Python modules conforming to a common interface,
360
and examples are given. If not declared, a default style sheet is
361
used. You are strongly advised to define your own style sheet,
362
as the built-in one will change a few more times.
364
<para style="Italic">
367
<para style="Indent">
368
path, module, function
370
<para style="Italic">
373
<para style="Indent">
374
Presentation, Section
376
<para style="Italic">
379
<para style="Indent">
382
<para style="Italic">
385
<prefmt style="Code"><![CDATA[
386
<stylesheet module="modern" function="getParagraphStyles"/>
390
<slide title="Tag: Section" id="Slide203" effectname="Blinds" effectdirection="0" outlinelevel="1">
391
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
392
<para style="Heading2">
395
<para style="BodyText">
396
A Section spans across a number of slides and can apply an
397
overall background to them. Place graphics directly within
398
the section tag, either before or after slides. This lets
399
you re-brand a presentation very quickly. Documents
400
may contain multiple sections; nesting of sections is
403
<para style="Italic">
406
<para style="Indent">
407
name (required, but not used yet)
409
<para style="Italic">
412
<para style="Indent">
415
<para style="Italic">
418
<para style="Indent">
419
all graphic shapes; slides
423
<slide title="Tag: Slide" id="Slide204" effectname="Blinds" effectdirection="0" outlinelevel="1">
424
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
425
<para style="Heading2">
428
<para style="BodyText">
429
Defines a single slide. The presentation effects are defined
430
in the PDF reference; best to just try the combinations.
432
<para style="Italic">
433
Attributes (with defaults):
435
<para style="Indent">
438
<para style="Indent">
441
<para style="Indent">
442
effectname: one of Split, Blinds, Box, Wipe, Dissolve, Glitter
444
<para style="Indent">
445
effectdirection: '0','90','180' or '270'
447
<para style="Indent">
448
effectdimension: 'H' or 'V' (Horiz./Vert.)
450
<para style="Indent">
451
effectmotion: 'I' for inwards or 'O' for outwards
453
<para style="Indent">
454
effectduration: time in seconds
456
<para style="Italic">
459
<para style="Indent">
462
<para style="Italic">
465
<para style="Indent">
466
all graphic shapes; frames
470
<slide title="Tag: Frame" id="Slide205" effectname="Blinds" effectdirection="0" outlinelevel="1">
471
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
472
<para style="Heading2">
475
<para style="BodyText">
476
Defines a frame on the page which can hold content. You may have
477
as many frames as you like, to allow multi-column text or flow
480
<para style="Italic">
483
<para style="Indent">
484
x, y, width, height (all required): in points
486
<para style="Indent">
487
leftmargin, rightmargin, topmargin, bottommargin
488
(optional, default to zero) – define the 'inner rectangle' within
491
<para style="Indent">
492
border (defaults to 'false'): whether to show
493
a frame border – useful when designing pages.
495
<para style="Italic">
498
<para style="Indent">
501
<para style="Italic">
504
<para style="Indent">
505
all 'flowable objects' – paragraphs, images
509
<slide title="Flowable Objects" id="Slide206" effectname="Blinds" effectdirection="0" outlinelevel="1">
510
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
511
<para style="Heading2">
512
Tag family – "Flowable Objects"
514
<para style="BodyText">
515
Flowable Objects currently include Paragraphs, Preformatted text
516
(used for code printing, where the line breaks and spaces matter)
517
and inline Images. More will be added in future.
518
They negotiate with their containing frame about height and
519
width; paragraphs do what you would expect, while images are centred.
521
<para style="Italic">
524
<para style="Indent">
527
<para style="Italic">
530
<para style="Indent">
531
The three instances so far contain nothing.
535
<slide title="Tag: para" id="Slide207" effectname="Blinds" effectdirection="0" outlinelevel="2">
536
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
537
<para style="Heading2">
538
Tag "para" – Paragraphs
540
<para style="BodyText">
541
Paragraphs are used for wrapping text. They are very simple
542
– they have a style attribute,
543
and the stylesheet defines most attributes externally.
544
Currently we use a hack to handle 'bullets', which may be in
545
a different font (such as 'ZapfDingbats, specified in style)
546
and offset to the left. These are used
547
for bullets, numbering and definition lists
548
This will vanish as soon as one can
549
switch fonts in mid-paragraph (due mid April).
551
<para style="Italic">
554
<para style="Indent">
555
style (defaults to 'Normal') –
556
reference to stylesheet
558
<para style="Indent">
560
text for the optional 'bullet' section. To be deprecated.
562
<para style="Italic">
565
<para style="Indent">
568
<para style="Italic">
571
<para style="Indent">
576
<slide title="Tag: prefmt" id="Slide207" effectname="Blinds" effectdirection="0" outlinelevel="2">
577
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
578
<para style="Heading2">
581
<para style="BodyText">
582
This is used for printing code, or other text which contains
585
<para style="Italic">
588
<para style="Indent">
589
style (defaults to 'Normal') –
590
reference to stylesheet
592
<para style="Italic">
595
<para style="Indent">
598
<para style="Italic">
601
<para style="Indent">
602
The text to be displayed
606
<slide title="Tag: image" id="Slide208" effectname="Blinds" effectdirection="0" outlinelevel="2">
607
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
608
<para style="Heading2">
609
Tag "image" – flowing images
611
<para style="BodyText">
612
This is used for an image to be displayed inline within
613
the frame. It will be drawn at a scale of 1 pixel to
614
1 point, and centred in the frame.
616
<para style="Italic">
619
<para style="Indent">
622
<para style="Italic">
625
<para style="Indent">
628
<para style="Italic">
631
<para style="Indent">
634
<para style="Italic">
637
<para style="Indent">
638
Rename it 'flowing image'? Control
639
over alignment and size if needed. Image caching.
643
<slide title="Tag: table" id="Slide208a" effectname="Blinds" effectdirection="0" outlinelevel="2">
644
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
645
<para style="Heading2">
646
Tag "table" – tables
648
<para style="BodyText">
649
This lets you draw tables with a wide variety of formatting
652
<para style="Italic">
655
<para style="Indent">
659
(optional) in points (auto-sizes if not given)
661
<para style="Indent">
665
(optional) in points (auto-sizes if not given)
667
<para style="Indent">
671
(optional) – name of a ReportLab
672
tablestyle defined in the stylesheet.
674
<para style="Indent">
678
(optional) – the column
679
delimiter string for bulk data; defaults to a comma.
681
<para style="Indent">
685
(optional) – the line
686
delimiter string for bulk data; defaults to a carriage
689
<para style="Italic">
692
<para style="Indent">
695
<para style="Italic">
698
<para style="Indent">
699
Bulk data, with the row and column delimiters
704
<slide title="Drawable Objects" id="Slide209" effectname="Blinds" effectdirection="0" outlinelevel="1">
705
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
706
<para style="Heading2">
707
Tag family – "Drawable Objects"
709
<para style="BodyText">
710
These are objects which know how to draw themselves directly on
711
the page (or section template). Use them for designing the backdrop,
712
and for custom graphics.
714
<para style="Italic">
717
<para style="Indent">
720
<para style="Italic">
723
<para style="Indent">
726
<para style="Italic">
729
<para style="Indent">
730
Will include the full PINGO object
731
model – a subset of SVG – allowing any vector graphics
736
<slide title="Tag: FixedImage" id="Slide210" effectname="Blinds" effectdirection="0" outlinelevel="2">
737
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
738
<para style="Heading2">
741
<para style="BodyText">
742
This is an image draw directly at a fixed position –
743
for example, the logo at top left of the page.
745
<para style="Italic">
748
<para style="Indent">
751
<para style="Indent">
754
<para style="Indent">
755
width, height: optional, stretches image
756
to fit box if present.
758
<para style="Italic">
761
<para style="Indent">
764
<para style="Italic">
767
<para style="Indent">
772
<slide title="Tag: Rectangle" id="Slide211" effectname="Blinds" effectdirection="0" outlinelevel="2">
773
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
774
<para style="Heading2">
777
<para style="Italic">
780
<para style="Indent">
781
x, y, width, height: required
783
<para style="Indent">
784
fill, stroke: either 'None', or an
787
<para style="Indent">
788
linewidth: defaults to 0 (hairline)
790
<para style="Italic">
793
<para style="Indent">
796
<para style="Italic">
799
<para style="Indent">
804
<slide title="Tag: RoundRect" id="Slide212" effectname="Blinds" effectdirection="0" outlinelevel="2">
805
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
806
<para style="Heading2">
809
<para style="BodyText">
810
This is exactly like Rectangle,
811
but with an extra 'radius' attribute defining the corner
812
radius in points – default is 6 points.
816
<slide title="Tag: Ellipse" id="Slide213" effectname="Blinds" effectdirection="0" outlinelevel="2">
817
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
818
<para style="Heading2">
821
<para style="BodyText">
822
Draws an ellipse, defined by its
823
bounding box. Note that it can
824
create circles if height and width are equal.
826
<para style="Italic">
829
<para style="Indent">
830
x1, y1, x2, y2: required
832
<para style="Indent">
833
fill, stroke: either 'None', or an
836
<para style="Indent">
837
linewidth: defaults to 0 (hairline)
839
<para style="Italic">
842
<para style="Indent">
845
<para style="Italic">
848
<para style="Indent">
853
<slide title="Tag: Polygon" id="Slide214" effectname="Blinds" effectdirection="0" outlinelevel="2">
854
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
855
<para style="Heading2">
858
<para style="BodyText">
859
Draws a polygon from a list
860
of points you provide.
862
<para style="Italic">
865
<para style="Indent">
866
points: list such as "(0,0),(50,0),(25,25)"
868
<para style="Indent">
869
fill, stroke: either 'None', or an
872
<para style="Indent">
873
linewidth: defaults to 0 (hairline)
875
<para style="Italic">
878
<para style="Indent">
881
<para style="Italic">
884
<para style="Indent">
889
<slide title="Tag: Line" id="Slide215" effectname="Blinds" effectdirection="0" outlinelevel="2">
890
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
891
<para style="Heading2">
894
<para style="BodyText">
897
<para style="Italic">
900
<para style="Indent">
903
<para style="Indent">
904
stroke: either 'None', or an
907
<para style="Indent">
908
width: defaults to 0 (hairline)
910
<para style="Italic">
913
<para style="Indent">
916
<para style="Italic">
919
<para style="Indent">
924
<slide title="Tag: String" id="Slide215" effectname="Blinds" effectdirection="0" outlinelevel="2">
925
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
926
<para style="Heading2">
929
<para style="BodyText">
930
This places strings directly on the page. They may have
931
embedded newlines (use a '\n' in the XML), in which
932
case multi-line strings are printed. Left, right
933
and centre alignment are allowed.
935
<para style="Italic">
938
<para style="Indent">
941
<para style="Indent">
942
color: RGB colour tuple such as '(0,1,0)'
944
<para style="Indent">
945
font: default is 'Times-Roman'
947
<para style="Indent">
950
<para style="Indent">
951
align: default 'left', allows
952
also 'right' or 'center'
954
<para style="Italic">
957
<para style="Indent">
960
<para style="Italic">
963
<para style="Indent">
964
The text of the string
968
<slide title="Tag: CustomShape" id="Slide216" effectname="Blinds" effectdirection="0" outlinelevel="2">
969
<frame height="510" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
970
<para style="Heading2">
973
<para style="BodyText">
974
This looks in a specified Python module for a
975
'drawable object' you write, and initialises
976
it with arguments you provide before drawing.
977
This must provide a 'self.drawOn(canvas)' method.
979
<para style="Italic">
982
<para style="Indent">
983
path: where to look; searches Python path
986
<para style="Indent">
989
<para style="Indent">
990
class: class name to create
992
<para style="Indent">
993
initargs: tuple of arguments with which
994
to initialize the class.
996
<para style="Indent">
997
align: default 'left', allows
998
also 'right' or 'center'
1000
<para style="Italic">
1003
<para style="Indent">
1006
<para style="Italic">
1009
<para style="Indent">
1014
<slide title="To Do" id="Part3" effectname="Blinds" effectdirection="0">
1015
<frame height="468" x="120" y="72" rightmargin="36" width="700" leftmargin="36">
1016
<para style="Heading1">
1019
<para style="Bullet">
1022
<para style="Bullet">
1023
Text preprocessor to let you input text, styles and images
1024
in something easier to type
1026
<para style="Bullet">
1027
Support for Pingo (http://pingo.sourceforge.net/) drawings using
1028
the Scalable Vector Graphics imaging model
1030
<para style="Bullet">
1031
Proper caching of flowing images
1033
<para style="Bullet">
1034
Basic Tables and Charts
1036
<para style="Bullet">
1037
Use new XML parsers as wel as xmllib
1039
<para style="Bullet">
1040
Slide indexing and database search tools
1042
<para style="Bullet">
1046
Naturally, help is extremely welcome :-)