14

Is there any API for interacting with Google Chrome PDF Viewer, pdfium? Like reading page number of current page or setting current page (like Adobe #page=10) or a supporting library like PDFObject for doing these?

Ebrahim Byagowi
  • 10,338
  • 4
  • 70
  • 81

2 Answers2

11

Chrome PDF Reader supports #page=X as a postfix to the URL in order to jump to a specific page in a PDF document

Say you are reading a page at https://www.example.com/examplePDF#page=4 it opens page 4 directly.

Sudarshan
  • 18,140
  • 7
  • 53
  • 61
  • Thanks. But how about reading current page number? Is it possible? – Ebrahim Byagowi Jan 08 '13 at 08:29
  • @EbrahimByagowi: Current Page number is only available in print preview screen, it is not exposed to standard reader till date, look at [this](https://code.google.com/p/chromium/issues/detail?id=61173) issue – Sudarshan Jan 08 '13 at 09:08
  • @EbrahimByagowi: I am sorry i could not understand, can you elaborate. – Sudarshan Jan 08 '13 at 11:47
  • Adding `#page=x` doesn't work anymore in chrome as of Nov 2016. – coding_idiot Nov 30 '16 at 03:34
  • 2
    Actually it still supports `page=x`. It also seems to support a limited set of other PDF open parameters like `scale=x`, `toolbar=1|0` and `view=Fit`. You can try out other parameters found [here](http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf) – samnau Mar 29 '17 at 17:13
7

If your goal is client side pdf viewing using js, you might want to take a look at PDF.js It is even open source.

codeape
  • 97,830
  • 24
  • 159
  • 188
scartag
  • 17,548
  • 3
  • 48
  • 52
  • 1
    Hey, I was thinking on using the same for tracking the current page of the pdf embed. But the api docs are absent. Can you help? :/ – Samuel Bushi Jun 11 '15 at 11:14