← Back to team overview

qpdfview team mailing list archive

Re: [Question #252130]: Feature request: Visual page numbers

 

Question #252130 on qpdfview changed:
https://answers.launchpad.net/qpdfview/+question/252130

Adam Reichold proposed the following answer:
Hello again,

Am 30.08.2014 um 14:03 schrieb S. Razi Alavizadeh:
> Question #252130 on qpdfview changed: 
> https://answers.launchpad.net/qpdfview/+question/252130
> 
> Status: Answered => Open
> 
> S. Razi Alavizadeh is still having a problem: Hello Adam
>> I'd say this is a case of patches welcome then.
> I implemented it in two commits (commits are based on revision
> 1644): First commit: Support using labels of pages (PDF) [1] It
> detects if document pages have labels (using info of first page)
> and use them on spinBox  automatically. For test you can use this
> PDF [2].

Another point is that it should be possible to disable the usage of
page labels since documents may contain useless ones or the user just
prefers plain numbers.

I am also not really happy with heuristic encoded in
DocumentView::hasLabelledPages. I would prefer a solution where we
always have a valid page label (even if it was provided by
DocumentView if the backend return an empty string) and maybe only
adjust the spin box suffix if the label is not just the numeric index.
(Which could go into a helper method in MainWindow which is called
from both the numberOfPagesChanged and currentPageChanged handlers.)
(Performance impacts from looking up page labels could be locked
behind the above setting.)

Minor stuff would be that I'd prefer helper methods that are only used
once to the put in the anonymous namespace in the source file. (It can
always be made visible to other modules later on.) And it seems
inconsistent that the "Jump to page..." would not work using page
labels when the spin box does.

Best regards, Adam.

> Second commit (completes the first commit): Added navigating by
> visual page numbers. I added GUI option to context-menu of spinBox,
> after setting up the visual first page, user can use Roman (i, ii,
> iii, iv, ...) numerals for access to preamble pages (pages before
> first visual page) also negative numbers are available (-1, -2,
> ...) to use instead Roman ones. (e.g.: -1 instead of i, -11 instead
> of xi)
> 
> But I didn't implement storing this new setting per file! I need
> your help on this, Per file settings are saved into
> perfilesettings_v2, does we need to create a new version
> (perfilesettings_v3)?
> 
> [1] http://pastebin.ubuntu.com/8187070/ [2]
> http://s5.picofile.com/file/8137923700/1001_vocabulary_spelling_2ed.pdf.html
>
> 
[3] http://pastebin.ubuntu.com/8187081/
> 
> Best Regards, Razi.
>

-- 
You received this question notification because you are a member of
qpdfview, which is an answer contact for qpdfview.