Java-Gaming.org Hi !
 Featured games (91) games approved by the League of Dukes Games in Showcase (757) Games in Android Showcase (229) games submitted by our members Games in WIP (844) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Home Help Search Login Register
Pages: [1]
 ignore  |  Print
 New feature: Embedded PDFs  (Read 6551 times) 0 Members and 1 Guest are viewing this topic.
Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Posted 2014-07-17 20:02:09 »

Due to a certain observed need 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 from: Legal Department
By embedding a PDF file in a post, you acknowledge that duplication and redistribution occurs and grant JGO full rights to serve the content to any third party. It is forbidden to embed content that has a license which does not grant these rights to JGO.

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

The content box is 95% of the available width in the post and 950px long.

(click this page to load the PDF)

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

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
basil_

« JGO Bitwise Duke »

Medals: 418
Exp: 13 years

 « Reply #1 - Posted 2014-07-17 20:04:52 »

thank you!
ctomni231

JGO Wizard

Medals: 99
Projects: 1
Exp: 7 years

Not a glitch. Just have a lil' pixelexia...

 « Reply #2 - Posted 2014-07-18 05:35:13 »

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...

 Games published by our own members! Check 'em out!
Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Reply #3 - Posted 2014-07-18 06:44:24 »

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? Are you refering to the termination of the applet tag? Maybe it's a relief to know hardly anybody could execute the applet anyway

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
pjt33

« JGO Spiffy Duke »

Medals: 40
Projects: 4
Exp: 7 years

 « Reply #4 - Posted 2014-07-18 08:36:13 »

Due to a certain observed need
If you want people to be able to use nicely formatted formulae, you could install MathJax. Or point people at http://mathurl.com/

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.
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.
Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Reply #5 - Posted 2014-07-18 18:42:03 »

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

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
SHC
 « Reply #6 - Posted 2014-07-19 12:22:05 »

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

EgonOlsen
 « Reply #7 - Posted 2014-07-19 13:24:08 »

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

Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Reply #8 - Posted 2014-07-19 14:02:58 »

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.

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

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Mac70
 « Reply #9 - Posted 2014-07-19 16:37:11 »

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.
 Games published by our own members! Check 'em out!
tkausl

Junior Devvie

Medals: 3
Exp: 5 years

 « Reply #10 - Posted 2014-07-19 16:42:23 »

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

My English isnt that great. Correct me, if you want, im still learning this Language
SilverTiger

JGO Coder

Medals: 40
Exp: 3 years

がんばってください！

 « Reply #11 - Posted 2014-07-19 16:48:02 »

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.
I'm using Opera 12.17 (64-bit) and it works fine for me
Don't know if there's a different engine with other versions.

Mac70
 « Reply #12 - Posted 2014-07-19 16:53:35 »

You are using very old version, newest one is 22.0.1471.70. 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).
Cero
 « Reply #13 - Posted 2014-07-19 18:41:33 »

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)

Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Reply #14 - Posted 2014-07-21 19:11:46 »

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
Thanks for your feedback - I added a link (in the lower half of the page) to open the document in a new tab.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Kefwar
 « Reply #15 - Posted 2014-07-21 19:40:12 »

Great feature!

One notice:
 1 "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.

Riven
Administrator

« JGO Overlord »

Medals: 1341
Projects: 4
Exp: 16 years

Hand over your head.

 « Reply #16 - Posted 2014-07-21 19:42:49 »

Whoops, accidently hot linked the icon Fixed

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
SHC
 « Reply #17 - Posted 2014-07-22 12:50:42 »

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

Pages: [1]
 ignore  |  Print

 EgonOlsen (78 views) 2018-06-10 19:43:48 EgonOlsen (58 views) 2018-06-10 19:43:44 EgonOlsen (78 views) 2018-06-10 19:43:20 DesertCoockie (260 views) 2018-05-13 18:23:11 nelsongames (158 views) 2018-04-24 18:15:36 nelsongames (157 views) 2018-04-24 18:14:32 ivj94 (898 views) 2018-03-24 14:47:39 ivj94 (162 views) 2018-03-24 14:46:31 ivj94 (811 views) 2018-03-24 14:43:53 Solater (175 views) 2018-03-17 05:04:08
 Java Gaming Resourcesby philfrei2017-12-05 19:38:37Java Gaming Resourcesby philfrei2017-12-05 19:37:39Java Gaming Resourcesby philfrei2017-12-05 19:36:10Java Gaming Resourcesby philfrei2017-12-05 19:33:10List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org