Extension talk:EmbedPDF

= Docs from localhost = Hy there! I don't really have experience with this kind of extensions and I was wondering if you could help me. I am using your code and unfortunatelly it does not work when I want to embed docs which are on the local host. Do u have any idea why :(

Answer
Sorry--I just can't get you exactly...

What is the wiki code you're using? Is it something like " http://localhost/my/path/to.pdf "? Does any error occur? Is your Web server okay with PDFs (what does it show if you open "http://localhost/my/path/to.pdf" in a Web browser)?

--Dmitry Shurupov 16:20, 21 February 2009 (UTC)

= URI error (semantic forms extension) = Thanx for this extension, it works great here. However I got one issue that maybe easily can be solved. I like to use this extension together with the semantic form extension. In a form the user can upload a pdf-file which will be printed on the outputpage. I like to embed the pdf and not only the filename. I got it working with images but can't get it to work with EmbedPDF. The variable is called so  should have to do the trick. But I got the 'Error: bad URI in !' message after saving the page. I guess it means it doesn't recognize the '{'. Is there a way I can make an exception in the extension that it does read the whole text between and as a filename?

-Jos, 19-2-2009

Answer
Allowing "" in is rather simple--you just have to add few lines into the "embedPDFHandler" function. It will look like this:

However, it will make a trick if the "" string will be transformed to the URI by semantic forms extension. I don't know how it works--so, I'm not sure if it is okay.

If the problem still exists, please, let me know--I'll give the semantic form extension a try...

--Dmitry Shurupov 16:19, 21 February 2009 (UTC)

Still same error
Thanx for the answer. I added the lines though I still got the same error. I'm not quite an expert in php so forgive me if there might an 'easy' solution to my problem.

I guess I got images working because images in wiki got a special syntax: instead of the -tag. Perhaps there is a way to hack the code so that something like Pdf: can be made instead of ... ? --Jos, 26 February 2009

= Installed, no errors, just not displaying the PDF in Firefox =

I've installed EmbedPDF.php in the extensions directory. I added the requireonce line.

I created a new page, with one line:

http://www.mydomain.org/wiki/images/e/e0/Hr1.pdf (I've removed the domain name)

and the page is there, but the pdf isn't embeded in Firefox 3.06. It's Embeded in I.E. 7.x just fine.

Answer
Please, read the "Usage" section.

You have to add the lines like this for URLs:

And lines like this for PDFs uploaded to your MediaWiki:

= Suggestion = Thanks for this extension. It's only in Internet Explorer (tested on v. 8) I'm having difficulties viewing the embedded pdfs. But I still wanted to use this extension, since there aren't any other ones dealing with this problem. I've added a link to the object, so browsers that won't show the embedded pdf, come up with a link instead. Now Opera, Firefox and Chrome show the embedded pdfs properly, while Internet Explorer shows a link. This is an acceptable solution for me, and maybe this idea would work for others as well?

Add the following around line 25-27 in EmbedPDF.php:

It seems that the new feature compability view in Internet Explorer might have something to do with this problem. Any ideas, Dmitry? -- Marius, July 2009