Downloadpdfmeta 1233

Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

ReportLab: PDF Processing with

Python 1st Edition Michael Driscoll


Visit to download the full and correct content document:
https://ebookmeta.com/product/reportlab-pdf-processing-with-python-1st-edition-mich
ael-driscoll/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Image Processing Masterclass with Python 50 Solutions


and Techniques 1st Edition Dey

https://ebookmeta.com/product/image-processing-masterclass-with-
python-50-solutions-and-techniques-1st-edition-dey/

Primary Mathematics 3A Hoerst

https://ebookmeta.com/product/primary-mathematics-3a-hoerst/

Introduction to Digital Music with Python Programming:


Learning Music with Code 1st Edition Michael Horn

https://ebookmeta.com/product/introduction-to-digital-music-with-
python-programming-learning-music-with-code-1st-edition-michael-
horn/

Productive and Efficient Data Science with Python: With


Modularizing, Memory profiles, and Parallel/GPU
Processing 1st Edition Tirthajyoti Sarkar

https://ebookmeta.com/product/productive-and-efficient-data-
science-with-python-with-modularizing-memory-profiles-and-
parallel-gpu-processing-1st-edition-tirthajyoti-sarkar/
Natural Language Processing in Action Understanding
analyzing and generating text with Python 1st Edition
Hobson Lane

https://ebookmeta.com/product/natural-language-processing-in-
action-understanding-analyzing-and-generating-text-with-
python-1st-edition-hobson-lane/

Practical Natural Language Processing with Python: With


Case Studies from Industries Using Text Data at Scale
1st Edition Mathangi Sri

https://ebookmeta.com/product/practical-natural-language-
processing-with-python-with-case-studies-from-industries-using-
text-data-at-scale-1st-edition-mathangi-sri-2/

Practical Natural Language Processing with Python: With


Case Studies from Industries Using Text Data at Scale
1st Edition Mathangi Sri

https://ebookmeta.com/product/practical-natural-language-
processing-with-python-with-case-studies-from-industries-using-
text-data-at-scale-1st-edition-mathangi-sri/

Mastering Python Forensics master the art of digital


forensics and analysis with Python 1st Edition Michael
Spreitzenbarth Johann Uhrmann

https://ebookmeta.com/product/mastering-python-forensics-master-
the-art-of-digital-forensics-and-analysis-with-python-1st-
edition-michael-spreitzenbarth-johann-uhrmann/

Practical Channel-Aware Resource Allocation: With


MATLAB and Python Code Michael Ghorbanzadeh

https://ebookmeta.com/product/practical-channel-aware-resource-
allocation-with-matlab-and-python-code-michael-ghorbanzadeh/
ReportLab - PDF Processing with Python

Michael Driscoll

This book is for sale at http://leanpub.com/reportlab

This version was published on 2018-06-05

*****

This is a Leanpub book. Leanpub empowers authors and publishers with the
Lean Publishing process. Lean Publishing is the act of publishing an in-progress
ebook using lightweight tools and many iterations to get reader feedback, pivot
until you have the right book and build traction once you do.

*****

© 2017 - 2018 Michael Driscoll


Table of Contents
Introduction
About the Author
Conventions
Setting up & Activating a Virtual Environment
Dependencies
Installation
Configuration
Reader Feedback
Errata
Code Examples
Part I - The ReportLab Toolkit
Chapter 1 - Getting Started with Reportlab
The Canvas Object
Canvas Methods
Using Colors in ReportLab
Adding a Photo
The textobject
Create a Page Break
Canvas Orientation (Portrait vs. Landscape)
Other methods
A Simple Sample Application
Wrapping Up
Chapter 2 - ReportLab and Fonts
Unicode / UTF8 is the Default
The Standard Fonts
Other Type-1 Fonts
TrueType Fonts
Asian Fonts
Switching Between Fonts
Wrapping Up
Chapter 3 - Intro to Page Layout
The Basics of PLATYPUS
Changing Fixed Elements Across Pages
Flowable Methods
Frame Basics
Templates
Flowable Orientation (Portrait vs. Landscape)
Wrapping Up
Chapter 4 - Paragraphs
Paragraph Styles
Paragraph Markup Tags
The Outermost Markup Tags
Using Intra-Paragraph Markup
Working with Fonts
Superscripts & Subscripts
Inserting Inline Images
Numbering Paragraphs / Sections
Bullets
Wrapping Up
Chapter 5 - Tables
The Table’s Methods
Applying Style to Your Table
Cell Formatting
Changing Fonts in Tables
Line Commands
Cell Alignment
Alternating Background Colors
Putting Paragraphs in Your Cells
Adding Images to Cells
Spanning
Wrapping Up
Chapter 6 - Other Flowables
Preformatted
XPreformatted
The Image Flowable
The Spacer Flowable
PageBreak
CondPageBreak
KeepTogether
How to Add a Table of Contents
SimpleIndex
ListFlowable / ListItem
Wrapping Up
Chapter 7 - Creating Your Own Flowables
Creating a Line Flowable
Creating a Bordered Textbox + Line Flowable
Modifying a Pre-Existing Flowable
Wrapping Up
Chapter 8 - Intro to Graphics and Charts
What is a Drawing?
ReportLab’s Renderers
The Coordinate System
A Simple Drawing
Supported Outputs
Verifying Attributes
Naming Shapes
Charts and Graphs
Labels
Axes
Bar Charts
Line Charts
Line Plots
Pie Charts
Adding Titles and Legends
Odds and Ends
Wrapping Up
Chapter 9 - Other Graphics
Shapes
Widgets
Bar Codes
Wrapping Up
Chapter 10 - Creating Special Features in Your PDF
File Annotations
Bookmarks
Page Transitions
Encryption
Interactive Forms
Wrapping Up
Part II - Tutorials and How-Tos
Chapter 11 - Turning Data into PDFs
Getting Started
Creating the Base Template Class
Refactoring the EOB Class
Creating a Multipage Document
Using Real Data
Consuming XML
Wrapping Up
Chapter 12 - Custom Headers and Footers
A Naive Header
Putting the Header on Every Page
Adding a Logo
Configurable Logos
Adding Page Numbers
Adding a Page Number of Total
Headers + Footers
Wrapping Up
Chapter 13 - Creating a PDF Library
Accepting Different Data Formats
Multipage Data Files
Custom Stylesheets
Configuring Your Application
Adding a Graphical User Interface
Finishing the User Interface
Wrapping Up
Chapter 14 - The PyPDF2 Package
Installation
Extracting Metadata from PDFs
Extracting Text from PDFs
Splitting PDFs
Merging Multiple PDFs Together
Rotating Pages
Overlaying / Watermarking Pages
PDF Encryption
Wrapping Up
Chapter 15 - The pdfrw Package
Extracting Information from PDF
Splitting
Merging / Concatenating
Rotating
Overlaying / Watermarking Pages
Scaling
Combining pdfrw and ReportLab
Wrapping Up
Chapter 16 - Extracting and Exporting Data from PDFs
Extracting Text with PDFMiner
Exporting Text via pdf2txt.py
Extracting Text with Slate
Exporting Your Data
Exporting to XML
Exporting to JSON
Exporting to CSV
Extracting Images
Wrapping Up
Chapter 17 - Filling in PDF Forms
Creating a Simple Form
Merging Overlays
Other Ways to Fill Forms
Using the pdfforms Package
Wrapping Up
Chapter 18 - Converting Markup to PDF
rst2pdf
WeasyPrint
Pandoc
LaTeX
Wrapping Up
Chapter 19 - The PyFPDF Package
Installation
Basic Usage
Working with Fonts
Drawing
Adding Images
Multipage Documents
Headers and Footers
Tables
Transform HTML to PDF
Web2Py
Templates
Wrapping Up
Appendix A - Adding SVG Files in ReportLab
Dependencies
Installation
Usage
Drawing on the Canvas
Adding an SVG to a Flowable
Scaling SVGs in ReportLab
Using SVG Plots from matplotlib in ReportLab
Using svg2pdf
Wrapping Up
Appendix B - Getting System Fonts
The fontTools Package
Getting the System’s Fonts
Wrapping Up
Appendix C - Creating a Color Demo
Getting the Colors
Wrapping Up
Afterword and Thanks
Introduction
The Reportlab PDF Toolkit started life in the year 2000 by a company called
“Reportlab Inc.”. Reportlab is now owned by “ReportLab Europe Ltd”. They
produce the open source version of Reportlab. The Reportlab toolkit is actually
the foundation of their commercial product, Report Markup Language which
is available in their Reportlab PLUS package. This book is focused on the open
source version of Reportlab. The Reportlab PDF Toolkit allows you to create in
Adobe’s Portable Document Format (PDF) quickly and efficiently in the Python
programming language. Reportlab is the defacto method of generating PDFs in
Python. You can also use Reportlab to create charts and graphics in bimap and
vector formats in addition to PDF. Reportlab is known for its ability to generate a
PDF fast. In fact, Wikipedia chose Reportlab as their tool of choice for
generating PDFs of their content. Anytime you click the “Download as PDF”
link on the left side of a Wikipedia page, it uses Python and Reportlab to create
the PDF!

In this book, you will learn how to use Reportlab to create PDFs too. This book
will be split into three sections. We will be covering the following topics in the
first section:

The canvas
Drawing
Working with fonts
PLATYPUS
Paragraphs
Tables
Other Flowables
Graphics
and More!

In the second section, we will learn about data processing. The idea here is to
take in several different data formats and turn them into PDFs. For example, it is
quite common to receive data in XML or JSON. But learning how to take that
information and turn it into a report is something that isn’t covered very often.
You will learn how to do that here. In the process we will discover how to make
multipage documents with paragraphs and tables that flow across the pages
correctly.

The last section of the book will cover some of the other libraries you might
need when working with PDFs with Python. In this section we will learn about
the following:

PyPDF2
pdfminer
PyFPDF

About the Author


You may be wondering about who I am and why I might be knowledgeable
enough about Python to write about it, so I thought I’d give you a little
information about myself. I started programming in Python in the Spring of 2006
for a job. My first assignment was to port Windows login scripts from Kixtart to
Python. My second project was to port VBA code (basically a GUI on top of
Microsoft Office products) to Python, which is how I first got started in
wxPython. I’ve been using Python ever since, doing a variation of backend
programming and desktop front end user interfaces as well as automated tests.

I realized that one way for me to remember how to do certain things in Python
was to write about them and that’s how my Python blog came about:
http://www.blog.pythonlibrary.org/. As I wrote, I would receive feedback from
my readers and I ended up expanding the blog to include tips, tutorials, Python
news, and Python book reviews. I work regularly with Packt Publishing as a
technical reviewer, which means that I get to try to check for errors in the books
before they’re published. I also have written for the Developer Zone (DZone)
and i-programmer websites as well as the Python Software Foundation. In
November 2013, DZone published The Essential Core Python Cheat Sheet
that I co-authored. I have also self-published the following books:

Python 101 - June 2014


Python 201: Intermediate Python - Sept. 2016
wxPython Cookbook - Dec. 2016
Conventions
As with most technical books, this one includes a few conventions that you need
to be aware of. New topics and terminology will be in bold. You will also see
some examples that look like the following:
>>> myString = "Welcome to Python!"

The >>> is a Python prompt symbol. You will see this in the Python interpreter
and in IDLE. Other code examples will be shown in a similar manner, but
without the >>>. Most of the book will be done creating examples in regular
Python files, so you won’t be seeing the Python prompt symbol all that often.

Setting up & Activating a Virtual Environment


If you don’t want to add ReportLab into your system’s Python installation, then
you can use a virtual environment. In Python 2.x - 3.2, you would need to install
a package called virtualenv to create a virtual environment for Python. The idea
is that it will create a folder with a copy of Python and pip. You activate the
virtual environment, run the virtual pip and install whatever you need to. Python
3.3 added a module to Python called venv that does the same thing as the
virtualenv package, for the most part.

Here are some links on how all that works:

https://docs.python.org/3/library/venv.html (Python 3 only)


https://pypi.python.org/pypi/virtualenv (Python 2 and 3)

When you are using a Python Virtual Environment, you will need to first activate
it. Activation of a virtual environment is like starting a virtual machine up in
VirtualBox or VMWare, except that in this case, it’s just a Python Virtual
Environment instead of an entire operating system.

Creating a virtual sandbox with the virtualenv package is quite easy. On Mac and
Linux, all you need to do is the following in your terminal or command prompt:
virtualenv FOLDER_NAME

To activate a virtual environment on Linux or Mac, you just need to change


directories to your newly created folder. Inside that folder should be another
folder called bin along with a few other folders and a file or two. Now you can
run the following command:
source bin/activate

On Windows, things are slightly different. To create a virtual environment, you


will probably need to use the full path to virtualenv:
c:\Python27\Scripts\virtualenv.exe

You should still change directories into your new folder, but instead of bin, there
will be a Scripts folder that can run activate out of:
Scripts\activate

Once activated, you can install any other 3rd party Python package.

Note: It is recommended that you install all 3rd party packages, such as
ReportLab or Pillow, in a Python Virtual Environment or a user folder. This
prevents you from installing a lot of cruft in your system Python installation.

I would also like to mention that pip supports a –user flag that tells it to install
the package just for the current user if the platform supports it. There is also an –
update flag (or just -U) that you an use to update a package. You can use this
flag as follows:
python -m pip install PACKAGE_NAME --upgrade

While you can also use pip install PACKAGE_NAME, it is now becoming a
recommended practice to use the python -m approach. What this does differently
is that it uses whatever Python is on your path and installs to that Python version.
The -m flag tells Python to load or run a module which in this case is pip. This
can be important when you have multiple versions of Python installed and you
don’t know which version of Python pip itself will install to. Thus, by using the
python -m pip approach, you know that it will install to the Python that is
mapped to your “python” command.

Now let’s learn what we need to install to get ReportLab working!

Dependencies
You will need the Python language installed on your maching to use ReportLab.
Python is pre-installed on Mac OS and most Linux distribututions. Reportlab 3
works with both Python 2.7 and Python 3.3+. You can get Python at
https://www.python.org/. They have detailed instructions for installing and
configuring Python as well as building Python should you need to do so.

ReportLab depends on the Python Imaging Library for adding images to PDFs.
The Python Imaging Library itself hasn’t been maintained in years, but you can
use the Pillow (https://pillow.readthedocs.io/en/latest/) package instead. Pillow
is a fork of the Python Imaging Library that supports Python 2 and Python 3 and
has lots of new enhancements that the original package didn’t have. You can
install it with pip as well:
python -m pip install pillow

You may need to run pip as root or Administer depending on where your Python
is installed or if you are installing to a virtualenv. You may find that you enjoy
Pillow so much that you want to install it in your system Python in addition to
your virtual environment.

We are ready to move on and learn how to install ReportLab!

Installation
Reportlab 3 works with both Python 2.7 and Python 3.3+. This book will be
focusing on using Python 3 and ReportLab 3.x, but you can install ReportLab 3
the same way in both versions of Python using pip:
python -m pip install reportlab

If you are using an older version of Python such as Python 2.6 or less, then you
will need to use ReportLab 2.x. These older versions of ReportLab have *.exe
installers for Windows or a tarball for other operating systems. If you happen to
run a ReportLab exe installer, it will install to Python’s system environment and
not your virtual environment.

If you run into issues installing ReportLab, please go to their website and read
the documentation on the subject at https://www.reportlab.com/

Now you should be ready to use ReportLab!


Configuration
ReportLab supports a few options that you can configure globally on your
machine or server. This configuration file can be found in the following file:
reportlab/rl_settings.py (ex. C:\PythonXX\Lib\site-packages\reportlab). There
are a few dozen options that are commented in the source. Here’s a sampling:

verbose - A range of integer values that can be used to control


diagnostic output
shapeChecking - Defaults to 1. Set to 0 to turn off most error
checking in ReportLab’s graphics modules
defaultEncoding - WinAnsiEncoding (default) or
MacRomanEncoding
defaultPageSize - A4 is the default, but you can change it to
something else, such as letter or legal
pageCompression - What compression level to use. The
documentation doesn’t say what values can be used though
showBoundary - Defaults to 0, but can be set to 1 to get boundary
lines drawn
T1SearchPath - A Python list of strings that are paths to T1Font fonts
TTFSearchPath - A Python list of strings that are paths to TrueType
fonts

As I said, there are a lot of other settings that you can modify in that Python
script. I highly recommend opening it up and reading through the various
options to see if there’s anything that you will need to modify for your
environment. In fact, you can do so in your Python interpreter by doing the
following:
>>> from reportlab import rl_settings
>>> rl_settings.verbose
0
>>> rl_settings.shapeChecking
1

You can now easily check out each of the settings in an interactive manner.

Reader Feedback
I welcome your feedback. If you’d like to let me know what you thought of this
book, you can send comments to the following email address:
comments@pythonlibrary.org

Errata
I try my best not to publish errors in my writings, but it happens from time to
time. If you happen to see an error in this book, feel free to let me know by
emailing me at the following:

errata@pythonlibrary.org

Code Examples
Code from the book can be downloaded from Github at the following address:

https://github.com/driscollis/reportlabbookcode

Here’s an alternate shortlink to the above as well:

http://bit.ly/2nc7sbP

Now, let’s get started!


Part I - The ReportLab Toolkit
Welcome to Part I! In this section you will learn all the major aspects of the
ReportLab toolkit. Here is a listing of the chapters contained in this part of the
book:

Chapter 1 - The Canvas


Chapter 2 - All about Fonts
Chapter 3 - Page Layout and Typography Using Scripts (PLATYPUS)
Chapter 4 - Paragraphs
Chapter 5 - Tables
Chapter 6 - Other Flowables
Chapter 7 - Custom Flowables
Chapter 8 - Charts / Graphics
Chapter 9 - Other Graphics
Chapter 10 - PDF Special Features

In this section of the book, you will learn how to create PDFs using ReportLab’s
low level canvas API. You will then move on to learn how to create PDFs using
ReportLab’s Flowable via their PLATYPUS sub-module. Then we will wrap up
Part I by learning about ReportLab’s graphics capabilities and the special
features you can apply to a PDF such as page transitions and encryption.

Let’s get started!


Chapter 1 - Getting Started with Reportlab
ReportLab is a very powerful library. With a little effort, you can make

pretty much any layout that you can think of. I have used it to

replicate many complex page layouts over the years. In this chapter we

will be learning how to use ReportLab’s pdfgen package. You will

discover how to do the following:

Draw text
Learn about fonts and text colors
Creating a text object
Draw lines
Draw various shapes

The pdfgen package is very low level. You will be drawing or “painting”

on a canvas to create your PDF. The canvas gets imported from the pdfgen

package. When you go to paint on your canvas, you will need to specify

X/Y coordinates that tell ReportLab where to start painting. The default

is (0,0) whose origin is at the lowest left corner of the page. Many

desktop user interface kits, such as wxPython, Tkinter, etc, also have

this concept. You can place buttons absolutely in many of these kits

using X/Y coordinates as well. This allows for very precise placement of
the elements that you are adding to the page.

The other item that I need to make mention of is that when you are

positioning an item in a PDF, you are positioning by the number of

points you are from the origin. It’s points, not pixels or

millimeters or inches. Points! Let’s take a look at how many points are

on a letter sized page:

>>> from reportlab.lib.pagesizes import letter


>>> letter
(612.0, 792.0)

Here we learn that a letter is 612 points wide and 792 points high.

Let’s find out how many points are in an inch and a millimeter,

respectively:

>>> from reportlab.lib.units import inch


>>> inch
72.0
>>> from reportlab.lib.units import mm
>>> mm
2.834645669291339

This information will help us position our drawings on our painting. At

this point, we’re ready to create a PDF!

The Canvas Object


The canvas object lives in the pdfgen package. Let’s import it and paint
some text:

# hello_reportlab.py

from reportlab.pdfgen import canvas

c = canvas.Canvas("hello.pdf")
c.drawString(100, 100, "Welcome to Reportlab!")
c.showPage()
c.save()

In this example, we import the canvas object and then instantiate a

Canvas object. You will note that the only requirement argument is a

filename or path. Next we call drawString() on our canvas object and

tell it to start drawing the string 100 points to the right of the

origin and 100 points up. After that we call showPage() method. The

showPage() method will save the current page of the canvas. It’s

actually not required, but it is recommended. The showPage() method

also ends the current page. If you draw another string or some other

element after calling showPage(), that object will be drawn to a new

page. Finally we call the canvas object’s save() method, which save

the document to disk. Now we can open it up and see what our PDF looks

like:
Fig. 1-1: Welcome to ReportLab

What you might notice is that our text is near the bottom of the

document. The reason for this is that the origin, (0,0), is the bottom

left corner of the document. So when we told ReportLab to paint our

text, we were telling it to start painting 100 points from the left-hand

side and 100 points from the bottom. This is in contrast to creating a

user interface in Tkinter or wxPython where to origin is the top left.

Also note that since we didn’t specify a page size, it defaults to

whatever is in the ReportLab config, which is usually A4. There are some

common page sizes that can be found in reportlab.lib.pagesizes.

Let’s look at the Canvas’s constructor to see what it takes for

arguments:
def __init__(self,filename,

pagesize=None,

bottomup = 1,

pageCompression=None,

invariant = None,

verbosity=0,

encrypt=None,

cropMarks=None,

pdfVersion=None,

enforceColorSpace=None,

):

Here we can see that we can pass in the pagesize as an argument. The

pagesize is actually a tuple of width and height in points. If you

want to change the origin from the default of bottom left, then you can

set the bottomup argument to 0, which will change the origin to

the top left.

The pageCompression argument is defaulted to zero or off. Basically


it will tell ReportLab whether or not to compress each page. When

compression is enabled, the file generation process is slowed. If your

work needs your PDFs to be generated as quickly as possible, then you’ll

want to keep the default of zero. However if speed isn’t a concern and

you’d like to use less disk space, then you can turn on page

compression. Note that images in PDFs will always be compressed, so the

primary use case for turning on page compression is when you have a huge

amount of text or lots of vector graphics per page.

ReportLab’s User Guide makes no mention of what the invariant argument is


used for, so I took a look at the source code. According to

the source, it produces repeatable, identical PDFs with same timestamp

info (for regression testing). I have never seen anyone use this

argument in their code and since the source says it is for regression

testing, I think we can safely ignore it.

The next argument is verbosity, which is used for logging levels. At

zero (0), ReportLab will allow other applications to capture the PDF

from standard output. If you set it to one (1), a confirmation message

will be printed out every time a PDF is created. There may be additional

levels added, but at the time of writing, these were the only two

documented.

The encrypt argument is used to determine if the PDF should be


encrypted as well as how it is encrypted. The default is obviously

None, which means no encryption at all. If you pass a string to

encrypt, that string will be the password for the PDF. If you want

to encrypt the PDF, then you will need to create an instance of

reportlab.lib.pdfencrypt.StandardEncryption and pass that to the

encrypt argument.

The cropMarks argument can be set to True, False or to an object.

Crop marks are used by printing houses to know where to crop a page.

When you set cropMarks to True in ReportLab, the page will become 3 mm

larger than what you set the page size to and add some crop marks to the

corners. The object that you can pass to cropMarks contains the

following parameters: borderWidth, markColor, markWidth and markLength.

The object allows you to customize the crop marks.

The pdfVersion argument is used for ensuring that the PDF version is

greater than or equal to what was passed in. Currently ReportLab

supports versions 1-4.

Finally, the enforceColorSpace argument is used to enforce

appropriate color settings within the PDF. You can set it to one of the

following:

cmyk
rgb
sep
sep_black
sep_cmyk

When one of these is set, a standard _PDFColorSetter callable will

be used to do the color enforcement. You can also pass in a callable for

color enforcement.

Let’s go back to our original example and update it just a bit. Now as I

mentioned earlier, in ReportLab you can position your elements (text,

images, etc) using points. But thinking in points is kind of hard when

we are used to using millimeters or inches. So I found a clever function

we can use to help us on StackOverflow

(http://stackoverflow.com/questions/4726011/wrap-text-in-a-table-reportlab):

def coord(x, y, height, unit=1):

x, y = x * unit, height - y * unit

return x, y

This function requires your x and y coordinates as well as the height of

the page. You can also pass in a unit size. This will allow you to do

the following:
# canvas_coords.py

from reportlab.pdfgen import canvas


from reportlab.lib.pagesizes import letter
from reportlab.lib.units import mm

def coord(x, y, height, unit=1):


x, y = x * unit, height - y * unit
return x, y

c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter

c.drawString(*coord(15, 20, height, mm), text="Welcome to Reportlab!")


c.showPage()
c.save()

In this example we pass the coord function the x and y coordinates,

but we tell it to use millimeters as our unit. So instead of thinking in

points, we are telling ReportLab that we want the text to start 15 mm

from the left and 20 mm from the top of the page. Yes, you read that

right. When we use the coord function, it uses the height to swap

the origin’s y from the bottom to the top. If you had set your Canvas’s

bottomUp parameter to zero, then this function wouldn’t work as

expected. In fact, we could simplify the coord function to just the

following:

def coord(x, y, unit=1):


x, y = x * unit, y * unit

return x, y

Now we can update the previous example like this:

# canvas_coords2.py

from reportlab.pdfgen import canvas

from reportlab.lib.units import mm

def coord(x, y, unit=1):


x, y = x * unit, y * unit
return x, y

c = canvas.Canvas("hello.pdf", bottomup=0)

c.drawString(*coord(15, 20, mm), text="Welcome to Reportlab!")


c.showPage()
c.save()

That seems pretty straight-forward. You should take a minute or two and

play around with both examples. Try changing the x and y coordinates

that you pass in. Then try changing the text too and see what happens!

Canvas Methods
The canvas object has many methods. Let’s learn how we can use some

of them to make our PDF documents more interesting. One of the easiest
methods to use setFont, which will let you use a PostScript font

name to specify what font you want to use. Here is a simple example:

# font_demo.py

from reportlab.lib.pagesizes import letter


from reportlab.pdfgen import canvas

def font_demo(my_canvas, fonts):


pos_y = 750
for font in fonts:
my_canvas.setFont(font, 12)
my_canvas.drawString(30, pos_y, font)
pos_y -= 10

if __name__ == '__main__':
my_canvas = canvas.Canvas("fonts.pdf",
pagesize=letter)
fonts = my_canvas.getAvailableFonts()
font_demo(my_canvas, fonts)
my_canvas.save()

To make things a bit more interesting, we will use the

getAvailableFonts canvas method to grab all the available fonts that

we can use on the system that the code is ran on. Then we will pass the

canvas object and the list of font names to our font_demo function.

Here we loop over the font names, set the font and call the

drawString method to draw each font’s name to the page. You will

also note that we have set a variable for the starting Y position that

we then decrement by 10 each time we loop through. This is to make each

text string draw on a separate line. If we didn’t do this, the strings


would write on top of each other and you would end up with a mess.

Here is the result when you run the font demo:

Fig. 1-2: Available fonts in ReportLab

If you want to change the font color using a canvas method, then you

would want to look at setFillColor or one of its related methods. As

long as you call that before you draw the string, the color of the text

will change as well.

Another fun thing you can is use the canvas’s rotate method to draw

text at different angles. We will also learn how to use the

translate method. Let’s take a look at an example:


Another random document with
no related content on Scribd:
organ; f, foot-gland; g, ganglion; gn, generative organs; o, orifice
of vestibule; oe, oesophagus; s, stomach; t, retracted tentacles.

In Pedicellina the plane of the lophophore is at right angles to the


stalk, which is separated from its calyx by a marked constriction. In
Loxosoma the lophophore is set obliquely,[542] and there is no
constriction at the base of the calyx. In Urnatella we find an
intermediate condition, the lophophore resembling that of Loxosoma,
while the constriction at the base of the calyx is similar to that of
Pedicellina. Since the latter is known to pass in its development[543]
through a stage with an oblique lophophore, it may be presumed that
Loxosoma is a more archaic form than Pedicellina. In other respects,
the structure of the Entoprocta is very constant, whatever the genus.

A pair of ciliated excretory tubes open into the vestibule. These are
similar in structure to the "head-kidneys" of the larvae of Polychaet
worms, or to the excretory organs of adult Rotifers. Flame-cells have
been described by Davenport in the stalk of Urnatella, but it is not
known whether they are connected with the excretory tubes of the
calyx. The animals are either hermaphrodite or have separate sexes,
and the generative organs open by ducts of their own into the
vestibule. The nervous system consists of a ganglion placed
between the mouth and the anus, giving off a set of nerves, many of
which end in delicate tactile hairs placed on the tentacles or other
parts of the body.[544]

CHAPTER XVIII

POLYZOA (continued)

FRESH-WATER POLYZOA—PHYLACTOLAEMATA—OCCURRENCE—
STRUCTURE OF CRISTATELLA—DIVISION OF COLONY—MOVEMENTS OF
COLONY—RETRACTION AND PROTRUSION OF POLYPIDES IN POLYZOA—
STATOBLASTS—TABLE FOR DETERMINATION OF GENERA OF FRESH-
WATER POLYZOA—REPRODUCTIVE PROCESSES OF POLYZOA—
DEVELOPMENT—AFFINITIES—METAMORPHOSIS—BUDDING.

Fresh-water Polyzoa.—Although the Gymnolaemata are ordinarily


marine animals, fresh-water examples from this Order are not
altogether wanting. The Ctenostomata among the typically marine
groups show the most tendency to stray into fresh-water.

Alcyonidium and Bowerbankia (Fig. 238) flourish in estuaries, while


Victorella and Paludicella (Fig. 250) are only known as fresh or
brackish water forms. Victorella was named after the Victoria Docks
in London, where it was first found; more recently it has also been
discovered in other parts of England and on the Continent.[545]

The systematic position of the genera Hislopia and Norodonia,[546]


which have been described from fresh water of India and China
respectively, is at present uncertain. The undoubted Cheilostome
Membranipora has, however, a British representative (M.
monostachys), which occurs in brackish water, in ditches on the
coast of East Anglia. It is there known to form "friable, irregularly-
shaped, sponge-like masses," which grow on water-plants.[547]

The Entoprocta, as we have seen, are represented in fresh water by


the genus Urnatella.

The Phylactolaemata are an exclusively fresh-water group, and


they are believed by Kraepelin[548] to have been derived from the
Ctenostomata. Many of their special peculiarities can, with great
probability, be regarded as adaptations to a fresh-water existence.
This is particularly clear in the all but universal habit of dying down in
the winter, and in the occurrence of the so-called statoblasts (Fig.
251), which are hard-shelled reproductive bodies, absolutely
restricted to the Phylactolaemata, and capable of resisting the
winter's cold and even a certain amount of drying up.
Phylactolaemata have indeed been recorded from the tropics; but it
is not yet sufficiently clear how they there behave in these respects.
F. Müller[549] has found these animals in Brazil, where they are said
to be more common at certain periods of the year than at others.
Stuhlmann has found them in Tropical Africa (Victoria Nyanza, etc.);
[550] and Meissner[551] has discovered the sessile statoblasts of
Plumatella on the shells preserved in the Berlin Museum, of species
of the Mollusc Aetheria from various localities in Africa. Fresh-water
representatives of a considerable number of other groups of animals
agree with the Phylactolaemata in the possession of reproductive
bodies which are protected by hard coats. Such, for instance, are the
ephippian ova of Daphnia—bodies which have an extraordinary
external similarity to statoblasts—the gemmules of Spongillidae, the
winter-eggs of Rhabdocoels and Rotifers, and the cysts of Protozoa.
The evolution of these bodies in so many widely different cases may
have been due to the selection of variations calculated to minimise
the dangers attendant on the drying up of the water in summer, or on
its freezing in winter.

The Phylactolaemata are by no means uncommon, although they


can seldom be found without a careful search. Their presence may
often be detected by taking advantage of the property of the free
statoblasts of rising to the top of the water, where they can be
discovered by skimming the surface with a fine hand-net.

The colonies themselves are usually found attached to water-plants,


roots of trees or stones. Most of them flourish best in a zone not
more than two feet below the surface. Certain species show a
preference for floating leaves, such as those of water-lilies, where
they are not liable to be dried up by alterations in the level of the
water. Some forms (e.g. Plumatella, Fig. 246) are, however, able to
withstand being dried for some time. Most species prefer shady
places, and accordingly settle on the lower sides of leaves and
sticks. Others (e.g. Cristatella, Fig. 247) have no objection to the
direct rays of the sun. Most forms prefer still water, but one or two
are found in running water.

Fredericella is a common constituent of the deep-water fauna of


Swiss Lakes (down to over forty fathoms); and reaches there a size
considerably larger than the shallow-water form of the same species.
Paludicella is common at thirteen fathoms. These two genera, with
Plumatella, have been found in absolute darkness, under a pressure
of 2½-5½ atmospheres, in the Hamburg aqueduct. The Polyzoa and
other organisms growing in the water-supply of Hamburg were
accused of being concerned in the spreading of cholera, during the
recent epidemic, by choking up the water-pipes, and creating
obstructions which formed a favourable nidus for the development of
cholera-germs.

The colony may take the form of a series of delicate, branching


tubes (Plumatella, Fredericella), of more massive aggregations of
parallel tubes (as in the Alcyonelloid forms of Plumatella), or of
gelatinous masses of varying size (Lophopus, Cristatella).

Fig. 246.—A, Plumatella (Alcyonella) fungosa Pall., Naples (fresh


water), small part of a mass, natural size; B, Plumatella repens L.,
R. Yare, on the leaf of a water-lily, natural size.

Cristatella mucedo (Fig. 247) is remarkable for its power of moving


from place to place; it consists of an elongated mass of greenish,
gelatinous substance, which, in its fully developed state, may reach
a length of eight inches or more, with a transverse diameter of three-
eighths of an inch. It has a flattened sole on which it crawls, while the
graceful plumes of its numerous polypides protrude as a delicate
fringe from its upper side.

The tentacles are about eighty to ninety in number, and they are, as
in other Phylactolaemata, united at their bases by a delicate web.
The lophophore is horse-shoe-shaped (Fig. 236, 3) throughout the
group, with the exception of Fredericella, in which genus it is circular.

In some Phylactolaemata the polypide has been observed to


interlace its tentacles, so that the plume becomes a kind of cage, in
which the more active Infusoria are imprisoned until their struggles
have so far weakened them that they are swept into the mouth by
the action of the cilia of the tentacles.[552]

Fig. 247.—Cristatella mucedo Cuv. (a small colony), R. Yare, above


Norwich, × 24.

Around the edge of the Cristatella is found a zone of budding tissue,


which gives rise continuously to new individuals. Now, whereas in
Gymnolaemata the growing edge gives rise to zooecia, whose
cavities become completely cut off from that of the older ones; in
Phylactolaemata the partitions between the zooecia are never
completed. The body-cavity of Cristatella is thus a continuous space,
interrupted at the margin only by vertical septa (see Fig. 247), which
represent the partitions between the zooecia of other forms.

The body-wall consists of two epithelial layers of ectoderm and


mesoderm, between which is a layer of muscular fibres. Parts of the
epithelium lining the body-cavity are ciliated. Into the common body-
cavity hang the polypide-buds at the edge of the colony, and the
mature polypides in the more central regions. There are usually
three rows of polypides on either side of the middle line, in the
neighbourhood of which is an area devoid of polypides, but
containing "brown bodies" and statoblasts. The polypides nearest to
the middle line pass in succession into the condition of "brown
bodies," while young buds near the margin grow up coincidently to
form new polypides.

The movement of the colony is in the direction of the long axis,


although either end may go first. Sir John Dalyell records an
observation[553] on a specimen (about one inch long) which was
artificially divided into two halves. The two halves "receded from
each other as if by common consent," and were nearly an inch apart
in twenty hours.

An observation made at Cambridge on a small colony of about 7


mm. in greatest length gave the following results. The colony moved
13 mm. (nearly twice its own length) in 8¼ hours: in the next 40
hours it moved 20 mm. ( ⅘ inch); while in the following 24 hours it
moved only 6 mm. Large colonies change their place only with
reluctance.

The locomotive power possessed by Cristatella is not unique among


Phylactolaemata. Lophopus, the first fresh-water Polyzoon of which
any description was published, was originally described by Trembley
in 1744 under the name of the "Polype à pannache." Trembley
observed the spontaneous division of the colony, followed by the
gradual separation from one another of the daughter-colonies.[554]
The power of dividing spontaneously is also possessed by colonies
of Cristatella and of Pectinatella.

The colonies of Lophopus are surrounded by an excessively hyaline


ectocyst, and are usually triangular, as shown by Fig. 248. When
division is about to occur, the base of the triangle becomes indented,
and the indentation travels towards the apex in such a way as to
bisect the triangle. The two halves diverge from one another during
the process, so that before division is complete, they are looking, in
some cases, in opposite directions. After a time the narrow
connection breaks, and two new colonies are formed.

Fig. 248 shows a colony shortly after division has taken place. The
colony had moved forwards, in a direction away from its apex, for
three days in a nearly straight line, the distances moved in each day
being respectively 6, 8½, 8½ mm. These observations, for which I
am indebted to Mr. Lister, show a considerably higher speed than in
those recorded by Trembley, who observed no colony which moved
more than half an inch (12.5 mm.) in eight days.

The genus Pectinatella also has some power of locomotion. This


magnificent Polyzoon occurs in masses several feet in length (as
much as six feet in P. gelatinosa from Japan[555]), and four to eight
inches in thickness. The greater part of P. magnifica[556] consists of
a thick, opaline, and gelatinous ectocyst, the upper surface of which
is covered by hundreds of rosette-like colonies, which increase in
number by division. The masses are thus aggregations of colonies,
which secrete a common basal ectocyst. The latter decays in the
autumn; and the separate rosettes, or groups of them, may thus be
set free, being found as floating masses, which may again attach
themselves to a solid object till the time of their death. Pectinatella
has not yet been recorded in England, although, considering the
ease with which statoblasts are transported, it is by no means
improbable that it will eventually be recorded as a British genus. It is
at present known to inhabit America, Japan, and Hamburg.
Fig. 248.—Lophopus crystallinus Pall., Cambridge, showing the rate of
movement. The colony and the distances moved are × 2.

It is by no means certain what is the mechanism by which movement


takes place in the above cases. The ectocyst of Cristatella is
confined to the base of the colony, and there forms a thin slimy film,
which lubricates the surface over which the animal moves. It has
been stated[557] that progression is produced in the following way.
The polypides are withdrawn by means of retractor muscles, which
originate from the septa and inner surface of the sole. Thus at each
retraction of any polypide, the muscle pulls on a portion of the sole.
Should the expanded polypides place themselves in a suitable
position, the movement will be in the direction of the resultant of the
forces due to the separate retractor muscles; while it is probable that
their cilia assist in the onward movement. It should be noted that it is
definitely stated that a colony in which all the polypides are retracted
can alter its position,[558] although even then the retractor muscles
might still contract to some extent.

The movement probably depends on several causes. It must


probably be conceded that the sole itself has some effect on this
process. Its outer cells are contractile, and have the power of raising
themselves from the underlying ectocyst. They may then again
attach themselves, and this new attachment does not always take
place in exactly the same place as the former one. Any movement of
the muscles of the sole, or of the retractor muscles, will thus shift the
skin to a new place.[559]
Protrusion of the Polypide.—While it is perfectly clear that
retraction is principally performed by the great retractor muscles
acting directly on the polypide, it is less easy to explain the converse
movement. There can, however, be little doubt that protrusion is
effected by the pressure of the fluid of the body-cavity, caused in
large part by contractions of the common body-wall.

Now since, in Cristatella, the body-cavity is a continuous space, any


pressure on the fluid must act uniformly on all its contents. The
cause which determines the protrusion of a polypide is thus to a
large extent the relaxation of the sphincter-muscle which surrounds
its orifice, aided by special muscles which dilate the orifice. Any
polypide which is retracted while the pressure of the fluid in the
body-cavity is sufficient to keep other polypides protruded, must
therefore keep either its retractor-muscles or its sphincter in a state
of contraction in order to remain in that position. And as a matter of
fact, Cristatella and Lophopus differ from most other Polyzoa in the
readiness with which they expand their tentacles, after they have
been induced to retract themselves by mechanical irritation.

Plumatella and other forms have a chitinous ectocyst, which,


however, is sticky when it is first formed. By virtue of this property,
the branches become attached to the leaf on which the colony is
growing, and may have their natural transparency obscured by
taking up foreign bodies. The stiffness of the ectocyst naturally
involves some modification of the process by which the polypides
are protruded. In some cases, this is effected by the separation of
the endocyst from the ectocyst in the lower parts of the tube. The
muscles of the body-wall can thus press on the fluid of the body-
cavity without being restrained by the inflexible ectocyst. In other
cases, the tube of ectocyst is rendered flexible by the presence of a
thin line along one side where the chitin is deficient.
Fig. 249.—Plumatella repens L., R. Yare, × 30. a, Anus; b, polypide-
bud; c, caecum of stomach; d, duplicature; e, epistome (see p.
476); f, funiculus; g, ganglion; m, retractor muscle; p, parieto-
vaginal muscles; ph, pharynx; s, statoblasts attached to f.

The upper end of the retracted tentacle-sheath is connected with the


body-wall by bands known as the parieto-vaginal muscles (Fig. 249,
p). These serve not only to dilate the orifice when protrusion is
commencing, but also to prevent the polypide from being forced out
too far. They are arranged in such a way that a circular fold, the
duplicature (d), is never turned inside out, even in the state of
complete protrusion of the polypide.

The mechanism of the protrusion of the polypide in the


Gymnolaemata is in many cases obscure. The body-wall is not
muscular in this group, in some forms of which, however, short
strands known as the parietal muscles (Fig. 234, p) pass across the
body-cavity from one point to another of the zooecium. As doubts
have been thrown on the function of these muscles in causing
protrusion, it will be worth while to refer to the detailed and
convincing statements of Farre,[560] relating to this point.
Farre's observations were made on certain transparent Ctenostomes
(Bowerbankia and Farrella). He states that the parietal muscles
"were distinctly seen to contract whenever the protrusion of the
animal took place, and to become relaxed again upon its retiring into
its cell." Their contraction may indent the outline of the ectocyst, or
may cause the separation of the endocyst from the ectocyst. The
endocyst is then drawn into longitudinal lines at the origin and
insertion of these fibres. It is further suggested that some part is
played in the process by the muscular walls of the alimentary canal,
which is a good deal bent in the retracted condition. The effort to
straighten itself is believed to have some share in forcing out the
polypide. The flexible, membranous character of the "aperture" (see
p. 524) in Membranipora (Fig. 256, A) is said by Nitsche[561] to be an
arrangement for the protrusion of the polypides; the parietal muscles
passing from the lateral walls of the zooecium to the upper
membranous wall, which is accordingly depressed by their
contraction.

Although it is hardly possible to doubt the accuracy of Farre's


observations, which have, moreover, been confirmed by Hincks, it is
by no means certain that this is the whole explanation in all cases.
Oka,[562] for instance, states that protrusion of the polypide in
Phylactolaemata can be effected in a branch whose body-wall has
been cut open. Pergens[563] believes that the diaphragm (Fig. 234,
d) acts as a pump, introducing water from the tentacle-sheath into
the body-cavity, into which it is said by him to open, and so forcing
out the polypide. It is probable that many of the forms which have a
stiff, unyielding ectocyst possess special arrangements for
introducing water in some way into the space bounded by the
ectocyst,[564] and so forcing out the polypide. Such, for instance,
may be the median pore which occurs beneath the orifice in
Microporella (Fig. 241, A, mp), and in certain other cases.

Reproduction of Phylactolaemata.—Sexual reproduction takes


place in Cristatella from June to August. The spermatozoa are
ordinarily produced on the funiculus. The ovaries usually occur on
the inner side of the common wall of the colony, not far below the
orifice of a polypide. Each ovary matures a single egg, which
develops in situ, the free larva leaving the colony by the orifice of
one of the degenerated polypides.

A second method of reproduction takes place by means of the


statoblasts, which are developed on the funiculus (Fig. 249).
According to Verworn,[565] each statoblast arises from a single cell of
the funiculus; and on this view, the statoblast is, as supposed by the
earlier observers, a special kind of winter-egg. According to more
recent researches,[566] the funiculus consists of a central axis,
formed from the ectoderm, and of an outer sheath of mesoderm-
cells; the statoblast is developed from the two kinds of cells of which
the funiculus is composed, and is consequently comparable in its
mode of origin to an ordinary bud. Its special peculiarities are: its
origin as an internal bud, its possession of a chitinous shell, and the
fact that it is destined to leave the parent colony, and to develop,
after a period of rest, into a new colony. Germination takes place by
the formation of a polypide-bud inside the statoblast, which finally
splits along its equator into two halves. The contents emerge as a
young colony which possesses at least one fully-formed polypide.

Remarkable structures known as "hibernacula" occur in the fresh-


water Ctenostomes, Paludicella and Victorella. These bodies are in
the former (Fig. 250, B) specially modified external buds, which
persist through the winter when the rest of the colony dies down. At
the close of winter the shell splits into two halves, exactly as takes
place in the statoblasts, and a young colony emerges. It is possible
that the statoblasts may have been evolved from a hibernaculum,
which was at first produced externally, but has become modified in
such a way as to acquire an internal mode of origin.[567]

The simplest known statoblast is that of Fredericella (Fig. 251, A),


which differs from that of other Phylactolaemata in having no ring of
air-cells. In Plumatella, the statoblast (Fig. 251, B) has a broad
equatorial ring of air-cells, which enable it to float at the surface of
the water on the decay of the parent tubes. In some species, certain
statoblasts which are produced in the adherent parts of the colony
remain attached to the substratum. These "sessile statoblasts" may
have no trace of the ring of air-cells; but the fact that many sessile
statoblasts have rudiments of this structure suggests that they are a
secondary modification of the floating statoblast. In Lophopus (Fig.
251, C) the ring of air-cells is very broad, and is pointed at each end;
while in Cristatella (Fig. 251, D) and in Pectinatella the statoblast is
circular, and possesses an armature of hooked spines. That of
Cristatella, measures about .75 mm. in its greatest length.
Fig. 250.—Paludicella ehrenbergi van Beneden, × about 3. A, Part of a
colony with expanded polypides; B, remains of part of a colony
which has produced hibernacula or winter-buds (h); z, zooecium.
(From Kraepelin.)

Kraepelin has suggested that the above order of increasing


complexity of the statoblasts corresponds with the order in which the
genera to which they respectively belong would be placed, on the
assumption that the Phylactolaemata have been derived from the
Ctenostomata. Thus, in Fredericella, the form of the lophophore is
circular, as in the Gymnolaemata. The number of the tentacles is
comparatively small (20-24). The arborescent form of the colony
resembles that of many Ctenostomes, and the zooecia are more or
less cut off from one another by incomplete septa.

In Plumatella, the lophophore has become horse-shoe-shaped, and


the tentacles are more numerous (38-60). In general form and in the
arrangement of the septa this genus resembles Fredericella, with
which it may easily be confused.

In Cristatella we have the most highly modified of all the


Phylactolaemata. The individuality of the zooecium is here
subordinated to that of the colony as a whole. The branched
arrangement of the zooecia is greatly obscured. The body-cavities
have become completely confluent, although rudiments of the septa
still exist. The ectocyst has been lost, with the exception of the basal
layer of the colony. The tentacles are more numerous (80-90); and in
accordance with the increase in the elaboration of the genus, its
statoblasts belong to the most complicated type known.
Fig. 251.—Statoblasts of Phylactolaemata. A, Fredericella sultana
Blum., × 38; B, Plumatella repens L., × 38; C, Lophopus
crystallinus Pall., × 28; D, Cristatella mucedo Cuv., × 28. (A, from
Allman; B-D, from Kraepelin.)

The production of floating statoblasts may seem a strange


adaptation to the conditions of fresh-water life, since it might be
assumed, a priori, that these structures would be specially liable to
be frozen during the winter. The following experiments made by
Braem[568] show, however, that the germinating power of the
statoblasts is improved by a certain amount of frost. A number of
statoblasts were taken; half of these were placed in water, which was
then frozen; and these were found to germinate readily when
afterwards exposed to suitable conditions. The other half were not
subjected to the action of frost; and these could not be made to
germinate, even although the water had been cooled to a point
slightly above the freezing point. It thus appears that the buoyancy,
so far from being a risk, is a means of exposing the statoblast to the
conditions which are most favourable to its later development.

Braem supposes that the beneficial action of frost is due to a


lowering of the vital energy of the statoblast. As in the case of
reproductive bodies known in many other fresh-water organisms, the
statoblast germinates only after a period of rest. Although this period
is often shortened by a lowering of the temperature, it can also be
induced by the exclusion of air, as in an experiment during which the
statoblasts were enclosed in airtight tubes. The respiratory
processes were thereby lessened, and the germinating power was
materially improved.
Since the development of the statoblasts depends largely on the
temperature, the first warm weather in early spring will probably
induce the germination of those which are floating; and the young
colony, leaving the protection of the statoblast, will become
susceptible to frost. But even if the first-formed colonies are killed off
by a subsequent frost, other statoblasts which have remained in the
mud during the winter are disentangled from time to time, and
germinate on reaching the surface.

Distribution.—The protective value of the shell is also shown by the


fact that the statoblast may be kept for some months in a dry
condition without losing its power of germination. There can be little
doubt that the capability of withstanding desiccation enables the
species to enlarge its area of distribution. It is asserted that fresh-
water Polyzoa decrease in abundance in proportion to the distance
from the mouth of the river in which they are found. The current will
naturally tend to bring together the statoblasts from the Polyzoa
growing in the upper waters.

Nothing is more surprising than the wide geographical distribution of


the Phylactolaemata. The European genera are all recorded from
North America. Fredericella, Plumatella, and Lophopus are further
recorded from Australia; while Plumatella is known to occur also in
Malacca, the Philippine Islands, India, Japan, Africa, and South
America, It is even stated that some of the Australian species are
identical with those found in Europe.

Some of the fresh-water Polyzoa are extremely variable, and


observers are by no means agreed in deciding whether certain well-
known forms are to be regarded as varieties or as species. While
certain genera, such as Cristatella and Lophopus, are comparatively
constant in their form, Plumatella is excessively variable. Plumatella
has a number of species greater than that of any other form, and the
genus has a wider distribution than any other. This greater variation
of species of the dominant genus is in complete accordance with the
general law enunciated by Darwin that "wide-ranging, much diffused,
and common species vary most."

While the ordinary forms of Plumatella consist of branching colonies,


which are either completely adherent to their substratum, or grow in
a more or less erect manner, another habit which is assumed by this
genus is so different from the first that it has been considered to
mark a distinct genus, Alcyonella. The Alcyonelloid form (Fig. 246, A)
consists of closely packed tubes which stand more or less at right
angles to their substratum, which they may cover with a dense mass
an inch thick, and with a superficial area of several square inches.
But in spite of this difference, it is possible that A. fungosa is only a
variety of an ordinary Plumatella form. Whether this is so or not, a
typical Plumatella may in places take on an Alcyonelloid habit; and
parts of an Alcyonella may become so lax in growth as to resemble a
Plumatella.

The British genera of fresh-water Polyzoa may be distinguished from


one another by means of the following table:—

1. Zooecia perfectly distinct from one another. Lophophore


circular. Statoblasts absent
2
Colony formed of branching tubes composed of confluent
zooecia
3
Colony gelatinous, not obviously formed of branching tubes.
Lophophore horse-shoe shaped
4

2. Colony consisting of a stolon from which new zooecia


originate. These may give rise to new stolons, or directly to
new zooecia
Victorella
Branches composed entirely of club-shaped zooecia, each of
which may give off two zooecia near its upper end
Paludicella (Fig. 250)

3. Tubes hyaline or opaque, usually containing numerous oval


statoblasts (Fig. 251, B), most of which have a ring of air-
cells. Lophophore horse-shoe shaped.
(a) Tubes divergent Plumatella (Fig. 246, B)
(b) Tubes parallel with one another
Alcyonella form of Plumatella (Fig. 246, A)
Tubes cylindrical, usually dark brown. Statoblasts
(Fig. 251, A) few, without air-cells. Lophophore circular
Fredericella

4. Colony hyaline, usually divided into three or four short lobes.


Ectocyst thick. Statoblasts (Fig. 251, C) pointed at each end,
with a broad ring of air-cells
Lophopus (Fig. 248)
Colony slug-shaped, crawling on a flattened sole. Ectocyst
rudimentary. Statoblasts (Fig. 251, D) circular, with marginal
hooks
Cristatella (Fig. 247)
Colonies consisting of small rosettes, many of which are
attached to a thick basal layer of hyaline ectocyst.
Statoblasts circular, with marginal hooks. (Not recorded as
British)
Pectinatella

Reproductive Processes of Polyzoa in general.

In studying the reproductive processes of Polyzoa, we have to deal


with two very distinct phenomena; firstly, with the development of
eggs; and secondly, with the formation of buds.

The process of budding usually does no more than increase the


number of individuals in a colony which already exists, and is seldom
responsible for the commencement of a new colony. In Loxosoma,
however, the buds break off and lead an independent existence; and
in the Phylactolaemata a large proportion of the colonies have their
origin in the statoblasts. In certain cases, again, new colonies may
be formed by the detachment of parts of an old one, as by the fission
of Cristatella and Lophopus, or by the breaking up of a richly-
branched species into several colonies by the decay of the proximal
parts.

We may then in the majority of cases look to an embryo for the


foundation of a new colony. The embryo develops into a larva,
which, after a period in which it swims freely, settles down, and is
metamorphosed into the first zooecium. This primary individual forms
the starting-point of a colony, and often differs to a considerable
extent from the other zooecia which arise from it. In Cyclostomata,
for instance, the proximal end of the primary zooecium permanently
retains the disc-like shape assumed by the young larva when it first
fixed itself. The primary zooecium may be recognised with equal
ease in many Cheilostomata, and may differ from its successors by
possessing a richer development of marginal spines, or in other
respects.

Reproductive Organs.—Eggs and spermatozoa are commonly


found in the same colony, either in different individuals, or else in the
same zooecium (see Fig. 234, p. 469). In some cases, the zooecium
first develops spermatozoa, and later eggs. The Entoprocta have a
more marked separation of the sexes than obtains in other Polyzoa.
The genus Loxosoma is perhaps always dioecious (i.e. with separate
sexes). Pedicellina is sometimes found with ovaries and testes in the
same individual, sometimes with these organs in different
individuals; and it is not clear whether a given species always
behaves alike in these respects.

The reproductive organs of the Entoprocta open by ducts of their


own into the vestibule. In the Ectoprocta they are developed in the
body-cavity, and they have no ducts.
The fate of the ripe egg differs widely in different cases. In the
Entoprocta it develops in a kind of brood-pouch formed from part of
the vestibule. The fact that in Pedicellina (Fig. 243) the embryos
grow largely during their development, shows that nutritive material
must be supplied to them from the parent. There is reason to believe
that the epithelium of the brood-pouch is responsible for this
process. The eggs are also known to develop at the expense of
nutritive substances prepared by the parent in the ovicells of the
Cyclostomata. In other cases, as in some species of Alcyonidium,
the egg is large, and its copious yolk doubtless supplies a large part
of the material required for development.

In the Ectoprocta, development takes place in a variety of places. In


most Cheilostomata a single egg passes into the globular ovicell,
which is formed above the orifice of many of the zooecia. In certain
Ctenostomata,[569] Phylactolaemata,[570] and Cyclostomata,[571] the
ripe egg is taken up by a rudimentary polypide-bud, which is
specially formed for the purpose. In the Ctenostomata and in the
fresh-water Polyzoa these buds, if present, are found in ordinary
zooecia which do not become modified externally in any special way.
In the Cyclostomata (Crisia), on the contrary, the formation of the
polypide-bud is intimately bound up with the development of the
ovicell. The number of the zooecia which produce eggs that are
capable of development is greatly restricted in this group. The
ovicell, which contains numerous embryos, is not merely a portion of
a zooecium, as in the Cheilostomata; but it is probably to be
regarded as a modification of the entire fertile zooecium or zooecia.
These take on an appearance widely differing from that of the
ordinary zooecia, and in course of time give rise to the ovicells (see
Fig. 237).

In all these cases the egg develops inside the parent, and it was
hardly known, before the publication of the interesting researches of
M. Prouho,[572] that some of the Polyzoa lay eggs which develop
externally. In these cases a considerable number of eggs are
produced simultaneously by a single zooecium. M. Prouho further

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy