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); |