New feature: Embedded PDFs

Due to a certain observed need :persecutioncomplex: and some spare time, I implemented the feature of embedding PDFs in your forum post.

There are certain undisclosed rules to mitigate the possibility of random people embedding malicious PDFs. The default PDF reader of the browser is used. In the case that there is no default PDF reader associated with the browser, which is often the case on phones and tablets, a download of the file is initiated. I’ll work no this later, to prevent such ‘unexpected’ downloads on potentially bandwidth limited devices.

The PDF is (crudely) validated, cached and served from the JGO server, to ensure the content is not replaced with malicious bits and bytes after the one time validation has occured.

[quote=""]
The UBB syntax for embedding a PDF file is as follows:
[icode][pdf ]http://java-gaming.org/pdf-sample.pdf[/pdf][/icode]

The content box is 95% of the available width in the post and 950px long.
[pdf]http://java-gaming.org/pdf-sample.pdf[/pdf]

In other news: support for embedded applets has been terminated.

thank you! ;D

my game… :’(

Does this work for multi-page PDF’s as well… How big can the PDF’s be? (It might be good to just make articles in PDF format so they actually look good.) Not that I’m writing one… ::slight_smile:

Your PDF can have any number of pages. As for existing articles, converting them to PDFs would be a ton of work.

And… what about your game? :clue: Are you refering to the termination of the applet tag? Maybe it’s a relief to know hardly anybody could execute the applet anyway :emo:

[quote=“Riven,post:1,topic:50149”]
If you want people to be able to use nicely formatted formulae, you could install MathJax. Or point people at http://mathurl.com/

[quote=“Riven,post:1,topic:50149”]
It would also be useful to not display it other than in the main thread view page. I had to cancel a second download when I opened up this reply page.

SMF doesn’t provide that information, so I’m tempted to implement it as click-to-view.

I think instead of initiating downloads automatically, you can just keep a link to download the file. Just a small suggestion.

This feature spams my download folder on Android with a new file each time i’m reloading the page. Not very nice…

Should be solved now. :point:

Update: some mobile browsers download content when it is styled “display:none” - give me a few more minutes

Update 2: click-to-view should work properly now

Sadly this feature don’t work on Opera - even though it is using the same engine as Chrome. After clicking “click this page to load the PDF” download is initalized, but nothing appears.

May you implement a small Link right above the Box to open the PDF in a new Window?
I dont like to read in small Fonts and if i zoom in i have to scroll horizontally and this sucks :-\

I’m using Opera 12.17 (64-bit) and it works fine for me :slight_smile:
Don’t know if there’s a different engine with other versions.

You are using very old version, newest one is 22.0.1471.70. :slight_smile: You need to download it manually as Opera don’t have auto update feature (at least in old versions, I am not sure if new versions have it or not).

That’s not really true. Opera 12.17 and 12.18 are the last presto operas, meaning real operas. Everything after that is just chrome anyway (opera next)

Thanks for your feedback - I added a link (in the lower half of the page) to open the document in a new tab.

Great feature! ;D

One notice:

"Failed to load resource: net::ERR_CONNECTION_RESET http://www.prensa-latina.cu/images/stories/LibrosGratis/pdf-icon.png"

The pdf icon isn’t displaying.

Whoops, accidently hot linked the icon :persecutioncomplex: Fixed :point:

Riven, I found something that maybe of interest to you. There is a pure JS PDF renderer by mozilla called PDF.JS. And it uses WebGL to render that PDF in the browser.

Example