| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> | 5 #include <limits.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 int cur_arg = 1; | 191 int cur_arg = 1; |
| 192 if (cur_arg < argc) { | 192 if (cur_arg < argc) { |
| 193 if (strcmp(argv[cur_arg], "--ppm") == 0) | 193 if (strcmp(argv[cur_arg], "--ppm") == 0) |
| 194 *output_format = OUTPUT_PPM; | 194 *output_format = OUTPUT_PPM; |
| 195 #ifdef _WIN32 | 195 #ifdef _WIN32 |
| 196 if (strcmp(argv[cur_arg], "--emf") == 0) | 196 if (strcmp(argv[cur_arg], "--emf") == 0) |
| 197 *output_format = OUTPUT_EMF; | 197 *output_format = OUTPUT_EMF; |
| 198 if (strcmp(argv[cur_arg], "--bmp") == 0) | 198 if (strcmp(argv[cur_arg], "--bmp") == 0) |
| 199 *output_format = OUTPUT_BMP; | 199 *output_format = OUTPUT_BMP; |
| 200 #endif | 200 #endif |
| 201 cur_arg++; | 201 if (*output_format != OUTPUT_NONE) |
| 202 cur_arg++; |
| 202 } | 203 } |
| 203 | 204 |
| 204 if (cur_arg >= argc) | 205 if (cur_arg >= argc) |
| 205 return false; | 206 return false; |
| 206 | 207 |
| 207 for (int i = cur_arg; i < argc; i++) | 208 for (int i = cur_arg; i < argc; i++) |
| 208 files->push_back(argv[i]); | 209 files->push_back(argv[i]); |
| 209 | 210 |
| 210 return true; | 211 return true; |
| 211 } | 212 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } else { | 393 } else { |
| 393 RenderPdf(filename, pBuf, len, format); | 394 RenderPdf(filename, pBuf, len, format); |
| 394 } | 395 } |
| 395 free(pBuf); | 396 free(pBuf); |
| 396 } | 397 } |
| 397 | 398 |
| 398 FPDF_DestroyLibrary(); | 399 FPDF_DestroyLibrary(); |
| 399 | 400 |
| 400 return 0; | 401 return 0; |
| 401 } | 402 } |
| OLD | NEW |