PDF Viewer error with s2member

Hi,

I am trying to load a PDF hosted on my Amazon S3/CloudFront into PDF Viewer plugin.

The page can be viewed here:
http://inform.zootanweb.com/pdf-test/

The error:
PDF.js v1.1.1 (build: a1e0859)
Message: Invalid PDF structure

The link on the page as suggested in the s2member knowledgebase:
[pdfviewer width=“600px” height=“849px”]http://inform.zootanweb.com/wp-content/plugins/s2member-files/s2member-file-storage-cf/s2member-file-inline-no/Test-PDF-File-Consultant.pdf[/pdfviewer]

The PDF works fine if I host it directly on the server so I know the PDF structure is okay.

Can anyone help - I am now getting desparate!

Thank you.

Why are you complicating things with a PDF plugin? Every modern browser comes with its own PDF viewer.

I need to be able to prevent printing and downloading. I know you can get round these things if you are savvy but it makes it difficult for an average business user.

Does s2Member’s serving of the PDF work OK if you don’t use that plugin?

Hi Tim,

This works:

PDF One

This does not:

[pdfviewer width=“600px” height=“849px”]http://inform.zootanweb.com/wp-content/plugins/s2member-files/s2member-file-storage-cf/s2member-file-inline-no/Test-PDF-File-Consultant.pdf[/pdfviewer http://inform.zootanweb.com/wp-content/plugins/s2member-files/s2member-file-storage-cf/s2member-file-inline-no/Test-PDF-File-Consultant.pdf[/pdfviewer ]

Could it be due to the mod_rewrite?

Thanks for your help.

Paul

Will the PDF viewer load the local file from your first link “PDF One” above?

Problem, I think, is that you try to use s2M and the viewer plugin together. URL to the viewer should not be the s2M URL, as s2M don’t runs “inside” the viewer. Instead, I would try to put URL to the Amazon bucket itself, and will use [s2M conditionals] to protect the viewer shortcode, like it is a content on a page. In this case each plugin will run at need time, and “the magic” should happen. Well, still needs tests…

You still haven’t said whether the PDF opens fine without the plugin.

The point is, as @krumch appreciates, that you are trying to combine things. That’s never a good way to test anything because there are too many variables and you don’t know what the issue is. So, I repeat, does the PDF work without the plugin?

Yes – as per the example below – the link works fine without the plugin.

I followed the s2Member advice regarding the use of PDF Viewer and used the suggested links for PDF Viewer, but I now suspect it has something to do with CORS and the PDF.js

Hi Krum,

Yes the first link loads the PDF. The link for PDF Viewer is based on the KB article on the s2Member website examples.

Can you give me an example of s2M conditional I would need to use?

Thanks for your help.

Paul, that KB article was written nearly two years ago – not long after the plugin was last updated. I suspect that things have moved on since then and the plugin is no longer reliable for this.

Have a look instead at the PDF Embedder plugin. When I last tried it, the free version worked with s2Member. You can try it out for yourself. There is a premium version which provides the protection you want.

Thanks Tim – good to know and thanks for the advice and your time taken to help me.

I will try PDF Embedder instead.

Thanks once again.