Text readability within the “game”… this is especially a question in regards to using VR HMD’s.
The next thing would be to create a file “directory” which would bring up a “Choose folder location”, and then set a “Document reader” type of thing to list all files within that directory. When the user selects the file, then the book opens up or something to allow the person to read the book while in VR. Seems like an interesting project at least.
I might be able to do this using the Web Browser widget. It occured to me after posting, although I’ll need to test it. Hopefully it has the ability to read PDF’s which all web browsers should be able to
Edit: After testing, the web browser widget does in fact show the directory, however, when the URL is pointed to the .pdf, nada, just a blank “screen”… or would that be a blank widget? Confusing, I know.
One other thing was that text readability in the web browser, at “book sizes” in VR makes the text almost unreadable. The DPI of the Rift just isn’t high enough :\
This is a really interesting idea, but I agree that the standard book font size may be too small to read and the rendering fidelity on text in general is only so-so in a VR headset.
Maybe a command line tool that converts the PDF into images would be an easier approach? With the number of open source PDF rendering engines out there, surely something like that exists.
Any movement on this idea? It would appear there’s a few people looking to do just this.
Also Higher Res VR headsets are getting released now so this may have a lot more real world application these days
Create a folder in “www” with a name which you desire (mine is PDF_Viewer)
copy “ViewerJS” folder and its contents from zip to created folder in www
Create another folder in PDF_Viewer (or what you call your first created folder) (mine is PDFs)
start wamp
Point UE4 Web Browser Widget to “localhost/PDF_Viewer/ViewerJS/#…/PDFs/file.pdf”
NOTE:
With this JS, you can show “.pdf / .odt / .ods / .odp” files
ODT = Open source version of .docx. Word can export
ODS = Open source version of .xlsx. Excel can export
ODP = Open source version of .pptx. Power Point can export.
I created a plugin to import pdf files at runtime. it has these features.
pdf to texture2d with sampling support
get all texts as string
get all web links as string
get texts at selected area
It has a sample function about blueprints about zoom and highlight
android support
pdf to base64
but there is a limitation with android.
I am using pdfium. Latest versions for Android using LibPNG 1.6.2 and it has very strict rules about iccp chunk. If Android founds a problem with that chunk, it gives crash. So, I am using a pdfium from 2018. So, if you use a PDF version newer than ones from 2018 and if they don’t have backwards compability, it won’t works.
Windows platform doesn’t have this limitation. It uses latest PDFium.
Also I wrote a pdf to base64 string and base64 string to texture2d function for it. So, If you save these strings to your save file and share it, you can import them at the runtime with every platform.
Right now I am looking to base64url encoding and decoding.
You can download it from here. When I finished base64url thing, I will update it.
While displaying a PDF in UMG directly isn’t straightforward, utilizing plugins, converting to images, or leveraging web browser capabilities are practical workarounds. If you’re looking for specific plugins or libraries, checking the Unreal Engine Marketplace or forums can yield useful resources.