Pauline Orr
Pauline Orr

Reputation: 123

#Zoom=75 PDF Won't Work For Safari

I am trying to make all linked pdf files that open in a new window to have #zoom=75 appended. I've accomplished this and it works nicely in Chrome but Safari doesn't seem to recognize any sort of parameters to the URL (such as zoom or page). Is there any way around this? Or is Safari unable to zoom or scale PDFs.

$("a[href*='.pdf']").each(function(){
    this.href = this.href + '#zoom=75';
});

Upvotes: 0

Views: 623

Answers (1)

joelgeraci
joelgeraci

Reputation: 4917

You won't be able to achieve any degree of consistency with the initial view. Two reasons, 1) very few PDF viewers respect the "open parameters" established by Adobe and 2) very few PDF viewers respect the "initial view" settings in a PDF, so even if you modified the PDF to set the default zoom to be 75%, you still wouldn't get any consistency.

The only reliable solution is to take control of how the PDF is rendered rather than rely on the browser or OS level viewer. Tools like PDF.js can do that for you but there are others.

Upvotes: 2

Related Questions