Deepak
Deepak

Reputation: 21

Can anyone tell how to disable caching in pdf.js?

I using pdf.js for displaying pdf in browser.I noticed if i scroll down a pdf (assume current page is 8)having more than one page(lets see 20).then when i refresh the page then pdf automatically open from page 8.Can we remove this thing in pdf.js so that it will open up from page 1 only.

Upvotes: 2

Views: 5861

Answers (2)

Rich
Rich

Reputation: 4248

You can achieve this by setting the showPreviousViewOnLoad to false with this line of code. PDFViewerApplication.viewerPrefs.showPreviousViewOnLoad = false

Upvotes: 3

async5
async5

Reputation: 2691

Per https://github.com/mozilla/pdf.js/blob/master/web/default_preferences.js#L24 , make the showPreviousViewOnLoad == false

Upvotes: 2

Related Questions