kindlepdfviewer icon indicating copy to clipboard operation
kindlepdfviewer copied to clipboard

page number offset

Open aliabbasjp opened this issue 12 years ago • 14 comments

mostly the pdf books begin numbering after some 20 pages of introduction, toc etc. What is needed is a correct alignment between the physical page number and the true page number. An offset value shoud be stored in the filename.lua file that would be added every time a page goto function is evaluated.

eg :pdf file xx.pdf starts page numbering from page 12 as reflected in its TOC hence offset stored=11 when user enters a goto page number say "1" then offset+1 page is fetched.

aliabbasjp avatar May 29 '12 07:05 aliabbasjp

Acrobat have a function called logic page number does this. You can "Numbering pages" with acrobat, and acrobat will recognize these page numbers.

kpdf just need to recognize this logic page number, but I'm not sure if it is supported in the pdf library.

dracodoc avatar Jun 01 '12 19:06 dracodoc

Hm, I think those "logical numbers" are text based. Plus, they are allowed to repeat, I think. Well, I will have to check that.

Maybe a hotkey to mark "page 1" and store this with the document settings would be a good way to implement our own approach? Will need to think about this a bit.

hwhw avatar Jun 02 '12 22:06 hwhw

Maybe it's simpler to implement with a marker in book.lua file than recognize logic page number. However there are more points other than just marking page 1. For example, user may want to jump to table of contents to know which page he need to go, so there must be at least 2 set of page numbers because the page of table contents always appear before the page 1 of content. Sometimes the logic page number assign A,B,C as page numbers before the real contents(A, B, C for pages before real content, 1,2,3 for real content).

I suggest this arrangement:

once page n is marked as page 1, all the page from 1 ~ (n-1) will be marked as b1 ~ b(n-1) (b can also be any other letter other than the first row letter which represent numbers). And user should be able to input b and number in input box directly (no need to use alt since the prefix b will not conflict with the number keys.)

dracodoc avatar Jun 03 '12 00:06 dracodoc

Hi, folks ,any work going on this must have feature??

aliabbasjp avatar Nov 24 '12 10:11 aliabbasjp

I wouldn't call it "must have", not even "very nice to have". It is just a "nice to have, maybe" type of feature. And certainly not for the November release because even IF it is ever implemented it has to be done very carefully to not impact the existing plain physical page numbers as for many books it is the only one anyway and everyone relies on being able to quickly jump to the physical page number without thinking too much about it.

tigran123 avatar Nov 24 '12 19:11 tigran123

If anyone's interested, this feature is present in Librerator.

kai771 avatar Jan 16 '13 12:01 kai771

The way it is implemented in Librerator is not a feature but a bug. The proper way to implement it is how it is done by Adobe Acrobat Reader for PDF or in djview4 for DjVu files, but that is not trivial. In fact, for DjVu files it is a complete nightmare, whereas for PDF files it can be done, but too much coding to make it worth it...

tigran123 avatar Jan 16 '13 12:01 tigran123

And why is it a bug?

kai771 avatar Jan 16 '13 12:01 kai771

Because it is not a support for logical page numbers as I just explained in the previous message. Try Adobe Acrobat Reader (with the pdf files containing logical page numbers) and see how it should work.

tigran123 avatar Jan 16 '13 12:01 tigran123

I will, but it still doesn't mean that this implementation is a bug just because there are better ones. I still think that existing working solution is better than non existing perfect solution. The goal was to allow the user to just use Go to 58 when she sees "see page 58" in the text she reads, without needing to calculate it every time.

kai771 avatar Jan 16 '13 12:01 kai771

Perhaps it can be a separate shortcut to jump to a logical page number so that the physical page number functionality is not affected? It looks like iText has logical page number support if that would be helpful as a guide.

This would be extremely helpful for me in using kindlepdfviewer for academic readings, since these are usually journal articles that start on page 1083 or some other nonstandard number.

iamscott avatar Feb 04 '13 22:02 iamscott

In the absence of full logical page #s support, would it be possible to copy over the page offset functionality from librerator?

iamscott avatar Feb 25 '13 20:02 iamscott

Well, I can implement this feature if you can wait till March 11th. I will have a 1 week holiday at that time.

houqp avatar Feb 26 '13 04:02 houqp

Yes, that sounds great. Let me know if I can help with speccing it out when you're ready to start.

iamscott avatar Mar 01 '13 18:03 iamscott