Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: experimental/PdfViewer/pdf_viewer_main.cpp

Issue 18660009: pdfviewer: fix bug, page -1 means render page 0 with no page extension (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/pdf_viewer_main.cpp
===================================================================
--- experimental/PdfViewer/pdf_viewer_main.cpp (revision 9983)
+++ experimental/PdfViewer/pdf_viewer_main.cpp (working copy)
@@ -97,6 +97,7 @@
* @param outputDir Output dir.
* @param inputFilename The skp file that was read.
* @param renderer The object responsible to write the pdf file.
+ * @param page -1 means there is only one page (0), and render in a file without page extension
*/
static bool render_page(const SkString& outputDir,
@@ -130,7 +131,7 @@
gDumpBitmap = &bitmap;
gDumpCanvas = &canvas;
- renderer.renderPage(page, &canvas);
+ renderer.renderPage(page < 0 ? 0 : page, &canvas);
SkImageEncoder::EncodeFile(outputPath.c_str(), bitmap, SkImageEncoder::kPNG_Type, 100);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698