Open a PDF file in a JME3 game

Hello monkeys,

I’m just looking for someone to point me in the right direction,

I need to open up a PDF file in the JME game but it seems impossible using Nifty’s libraries,

I am thinking about making the PDF file appearing like a texture on a JME box, but I have no idea on how to

do it. Please let me know if any have a suitable idea on how to do that.

Thanks,

Why? what i sthe usecase why is pdf necessary? This is really untypical for games.

I would look for a library that renders a PDF to an image and then use that image in jME. But it is rather strange to show a PDF in a game engine…

1 Like
@kwando said: I would look for a library that renders a PDF to an image and then use that image in jME. But it is rather strange to show a PDF in a game engine...

I need to allow user sharing and viewing documents int the game chat corner, I will look for transforming the PDF file to an image,
but I hope that will not be a long process. :facepalm:

I will let you know what solution I adopted.

Thank you

Why not let the user convert the document to an image?

1 Like

Well i convert it to BufferedImage and then you can apply it as a texture or show it on a nifty window

:slight_smile:

it’s not complicated,
[java]
BufferedImage image=ConvertPDFToImage(“C:\classes.pdf”);
AWTLoader loader = new AWTLoader();
com.jme3.texture.Image load = loader.load(image, true); [/java]