diff options
author | Albert Astals Cid <aacid@kde.org> | 2009-12-18 20:23:48 +0000 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2009-12-18 20:23:48 +0000 |
commit | df0ccddb7f784b4a8564beda51b3047cb9e3611a (patch) | |
tree | 1da6735e0cbca12a5b521b5c4877aaabea773ddc /utils | |
parent | ab88a02f7efefc950a316d7a5edf88dad8f3e4d0 (diff) |
move the retrieval of the bitmap after rendering the page as it can change on render time
Diffstat (limited to 'utils')
-rw-r--r-- | utils/pdftoppm.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc index e27aa441..2c4e8693 100644 --- a/utils/pdftoppm.cc +++ b/utils/pdftoppm.cc @@ -18,6 +18,7 @@ // Copyright (C) 2009 Michael K. Johnson <a1237@danlj.org> // Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com> // Copyright (C) 2009 Stefan Thomas <thomas@eload24.com> +// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -146,8 +147,6 @@ static void savePageSlice(PDFDoc *doc, int pg, int x, int y, int w, int h, double pg_w, double pg_h, char *ppmFile) { - SplashBitmap *bitmap = splashOut->getBitmap(); - if (w == 0) w = (int)ceil(pg_w); if (h == 0) h = (int)ceil(pg_h); w = (x+w > pg_w ? (int)ceil(pg_w-x) : w); @@ -158,6 +157,9 @@ static void savePageSlice(PDFDoc *doc, !useCropBox, gFalse, gFalse, x, y, w, h ); + + SplashBitmap *bitmap = splashOut->getBitmap(); + if (ppmFile != NULL) { if (png) { bitmap->writeImgFile(splashFormatPng, ppmFile); |