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: