diff options
Diffstat (limited to 'libmat2/pdf.py')
| -rw-r--r-- | libmat2/pdf.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmat2/pdf.py b/libmat2/pdf.py index 053a768..d3c4698 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py | |||
| @@ -47,7 +47,7 @@ class PDFParser(abstract.AbstractParser): | |||
| 47 | pages_count = document.get_n_pages() | 47 | pages_count = document.get_n_pages() |
| 48 | 48 | ||
| 49 | tmp_path = tempfile.mkstemp()[1] | 49 | tmp_path = tempfile.mkstemp()[1] |
| 50 | pdf_surface = cairo.PDFSurface(tmp_path, 10, 10) | 50 | pdf_surface = cairo.PDFSurface(tmp_path, 10, 10) # resized later anyway |
| 51 | pdf_context = cairo.Context(pdf_surface) # context draws on the surface | 51 | pdf_context = cairo.Context(pdf_surface) # context draws on the surface |
| 52 | 52 | ||
| 53 | for pagenum in range(pages_count): | 53 | for pagenum in range(pages_count): |
| @@ -101,7 +101,7 @@ class PDFParser(abstract.AbstractParser): | |||
| 101 | pdf_surface.set_size(page_width*self.__scale, page_height*self.__scale) | 101 | pdf_surface.set_size(page_width*self.__scale, page_height*self.__scale) |
| 102 | pdf_context.set_source_surface(img, 0, 0) | 102 | pdf_context.set_source_surface(img, 0, 0) |
| 103 | pdf_context.paint() | 103 | pdf_context.paint() |
| 104 | pdf_context.show_page() | 104 | pdf_context.show_page() # draw pdf_context on pdf_surface |
| 105 | 105 | ||
| 106 | pdf_surface.finish() | 106 | pdf_surface.finish() |
| 107 | 107 | ||
