Skip to content

Commit 8139e5c

Browse files
asbjornstartemp
authored andcommitted
printing: Update documentation and test
Now that printing isn't loaded automatically it must be loaded explicitly. Fixes: 4f7f090 An attempt to solve printing import error Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]>
1 parent ebce780 commit 8139e5c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

mapnik/printing/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class PDFPrinter(object):
6565
Main class for creating PDF print outs. Basic usage is along the lines of
6666
6767
import mapnik
68+
import mapnik.printing
6869
6970
page = mapnik.printing.PDFPrinter()
7071
m = mapnik.Map(100,100)

test/python_tests/pdf_printing_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def make_pdf(m, output_pdf, esri_wkt):
3131
page.add_geospatial_pdf_header(m, output_pdf, wkt=esri_wkt)
3232

3333
if mapnik.has_pycairo():
34+
import mapnik.printing
35+
3436
def test_pdf_printing():
3537
source_xml = '../data/good_maps/marker-text-line.xml'.encode('utf-8')
3638
m = make_map_from_xml(source_xml)

0 commit comments

Comments
 (0)