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

Issue 2495333002: Add --pages option in pdfium_test so it renders only some of the pages. (Closed)

Created:
4 years, 1 month ago by npm
Modified:
4 years, 1 month ago
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Add --pages option in pdfium_test so it renders only some of the pages. The --pages option is set up to be 0-indexed. --pages=<number> will render the specific page. --pages=<number>-<number> will render the range of pages given. Committed: https://pdfium.googlesource.com/pdfium/+/e3c731526c0464822758a2a8b3a9ca9527ce9272

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use else #

Total comments: 2

Patch Set 3 : Rename firstP, lastP #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -2 lines) Patch
M samples/pdfium_test.cc View 1 2 4 chunks +28 lines, -2 lines 4 comments Download

Messages

Total messages: 19 (9 generated)
npm
PTAL I've been needing this option for a while now :) Hopefully some of you ...
4 years, 1 month ago (2016-11-14 16:07:55 UTC) #5
dsinclair
https://codereview.chromium.org/2495333002/diff/1/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/1/samples/pdfium_test.cc#newcode80 samples/pdfium_test.cc:80: int firstP; size_t? https://codereview.chromium.org/2495333002/diff/1/samples/pdfium_test.cc#newcode486 samples/pdfium_test.cc:486: } Doesn't this need ...
4 years, 1 month ago (2016-11-14 16:35:27 UTC) #8
npm
https://codereview.chromium.org/2495333002/diff/1/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/1/samples/pdfium_test.cc#newcode80 samples/pdfium_test.cc:80: int firstP; On 2016/11/14 16:35:27, dsinclair wrote: > size_t? ...
4 years, 1 month ago (2016-11-14 16:40:14 UTC) #9
dsinclair
lgtm w/ nit. https://codereview.chromium.org/2495333002/diff/20001/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/20001/samples/pdfium_test.cc#newcode81 samples/pdfium_test.cc:81: int lastP; Can we make these ...
4 years, 1 month ago (2016-11-14 16:45:38 UTC) #10
npm
https://codereview.chromium.org/2495333002/diff/20001/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/20001/samples/pdfium_test.cc#newcode81 samples/pdfium_test.cc:81: int lastP; On 2016/11/14 16:45:38, dsinclair wrote: > Can ...
4 years, 1 month ago (2016-11-14 16:53:32 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2495333002/40001
4 years, 1 month ago (2016-11-14 16:53:41 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://pdfium.googlesource.com/pdfium/+/e3c731526c0464822758a2a8b3a9ca9527ce9272
4 years, 1 month ago (2016-11-14 17:14:55 UTC) #16
Lei Zhang
https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc#newcode80 samples/pdfium_test.cc:80: int firstPage; first_page, last_page https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc#newcode803 samples/pdfium_test.cc:803: int firstPage = ...
4 years, 1 month ago (2016-11-14 19:09:24 UTC) #17
npm
https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc File samples/pdfium_test.cc (right): https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc#newcode80 samples/pdfium_test.cc:80: int firstPage; On 2016/11/14 19:09:23, Lei Zhang (not reviewing ...
4 years, 1 month ago (2016-11-14 20:14:15 UTC) #18
Lei Zhang
4 years, 1 month ago (2016-11-14 20:17:01 UTC) #19
Message was sent while issue was closed.
On 2016/11/14 20:14:15, npm wrote:
>
https://codereview.chromium.org/2495333002/diff/40001/samples/pdfium_test.cc#...
> samples/pdfium_test.cc:803: int firstPage = options.pages ? options.firstPage
:
> 0;
> On 2016/11/14 19:09:23, Lei Zhang (not reviewing code) wrote:
> > If the user passes in --pages=1-2, they actually get pages 2-3. Intentional?
> 
> This is because it is 0-indexed. This is consistent with the naming
> of the png files you get when you use "--png". Maybe we should make
> all of it be 1-indexed since this is more natural considering how pdf
> viewers usually number the pages?

Let's not rename all the expectation files in the entire corpus. Instead just
make kUsageString print out "page numbers are 0-based" and add the same comment
for |first_page| / |last_page|.

Powered by Google App Engine
This is Rietveld 408576698