msfs2020-toolbar-window-template icon indicating copy to clipboard operation
msfs2020-toolbar-window-template copied to clipboard

PDF / TXT

Open spit40 opened this issue 3 years ago • 13 comments

Hi, I'm going to try and hack a way to pull in a simple PDF or TXT file so I can access a few notes while I fly in VR. I have no experience with the SDK so will try and rework your example. If you get a chance to make a simple kneeboard type thing that would allow someone to cycle through some PDF/TXT/JPG files sat in a defined folder that would be great :-)

spit40 avatar Jan 17 '21 11:01 spit40

Hi, in my eyes the hard pard is to show PDF files (seems impossible right now) and maybe directly accessing them on the file system. One possible solution could be a small local webserver that supplies the txt/jpg/html files from the file system. And maybe even this server can convert pdf to jpg on the fly to show them in the sim.

In the meantime I built some toolbars (not public yet) based on this template as shown in the screen (the map is from flightsim.to). The FIS system gives me airport information in pure text form (using a large font size here) and some charts as jpg images. All that lives on a spare raspberry pi with apache/php web server. So I may try that live pdf/image conversion one time.

20210110103212_1

The other aspect in terms of viewing PDFs and images is the resolution available in VR. So one would need at least some basic functions for scrolling and zooming to get readable text in images/pdf. So when viewing a map in my FIS system (which has no zooming) I always need to get very very close to read stuff like taxiway names.

bergziege avatar Jan 20 '21 13:01 bergziege

nice but its complicate for me

rug4ever avatar Jan 20 '21 13:01 rug4ever

I am currently developing the idea of a code generator to get preconfigured/currectly named toolbars. You than "only" have to fill in the content via html/css/js. Later it may includes compilation/recompilation via msfs sdk.

I maybe release the scratchpad in "some days" on flightsim.to. But its mainly a textbox with some buttons. The content of the scratchpad will not be saved across sessions.

If the live conversion from pdf to jpg mentioned above works I may write a server komponent which you can run localy to view a folder structure containing charts and notes.

First we should get that covid numbers to zero so that daycare reopens so that one gets a little spare time to develop such things ;-)

bergziege avatar Jan 20 '21 13:01 bergziege

I'm almost there guys. Yes, I am running a tiny web server and using ghostscript to convert PDF to JPG. I've written the HTML/JS to scroll through files and zoom/drag/scroll. I just need a little tweaking on the UI and I'm there.

I don't have any experience with the SDK though - I don't suppose someone could make me a version of the CUSTOM PANEL generic that is called "EBAG" for Electronic Flight Bag? That's what I'll call this thing.

spit40 avatar Jan 20 '21 14:01 spit40

@bymaximus Is there a way to create a textbox or notepad for notes while in vatsim (VR). Currently I changed the source url to a website for online notepad but sometimes the website will reset and I will lose my notes.

booms-sys avatar Jan 23 '21 20:01 booms-sys

Hi @booms-sys, yes there is a way as you can see in the screen above. I use this for VR VFR flying. The scraptchpad has absolutely no persistence but thats not an issue imho as its for short living content only. The only thing that stands between me and releasing is that I am too dump to create a svg icon to be shown in the simulator. No matter what I do, it simply does not show up in the sim.

bergziege avatar Jan 24 '21 18:01 bergziege

I had the same problem making SVGs. In the end I made one, edited it and hacked it about to match the 60px dimensions of the demo. @bergziege - I'll help you make an SVG if you compile me a version of this called EBAG? :-)

spit40 avatar Jan 24 '21 20:01 spit40

@spit40 I just threw all my stuff into a repository over at https://github.com/bergziege/msfs_debgz_scratchpad. Would be nice if you could look after the icon and create a PR. We should continue the icon discussion in ticket 1 (https://github.com/bergziege/msfs_debgz_scratchpad/issues/1) or use the discussion function over in the new repo. If you setup a repository I can give you a PR for an "EBAG" labeled template.

@bymaximus ... sry for hijacking this ticket ;-)

bergziege avatar Jan 25 '21 21:01 bergziege

@spit40 I just threw all my stuff into a repository over at https://github.com/bergziege/msfs_debgz_scratchpad. Would be nice if you could look after the icon and create a PR. We should continue the icon discussion in ticket 1 (https://github.com/bergziege/msfs_debgz_scratchpad/issues/1) or use the discussion function over in the new repo. If you setup a repository I can give you a PR for an "EBAG" labeled template.

@bymaximus ... sry for hijacking this ticket ;-)

hello

Pls send me your discord Name. we can talk in German because i have Problems with this addon and i want to fly in vr

rug4ever avatar Jan 25 '21 21:01 rug4ever

hello

Pls send me your discord Name. we can talk in German because i have Problems with this addon and i want to fly in vr

debgz#0449

bergziege avatar Jan 26 '21 18:01 bergziege

Bitte Akzeptiere Discord Friend Rug4ever

rug4ever avatar Jan 27 '21 07:01 rug4ever

PDF could be rendered as SVG or in canvas element inside HTML. However, I had issues with both on some sample PDFs I have used. Ended up writing python server that converts PDF to PNG on the fly and serve information over to the frontend.

Lasperi avatar Feb 21 '22 18:02 Lasperi

I also had bad time to show PDF documents directly in the simulator UI panels (converting from PDF to SVG or PDF to image in real time), it takes some time to convert the PDF in real time and doing this every time it is going to display a PDF page is unusable. I ended up converting the PDF pages to images in background with a C# app and serving those images as wasm graphics textures loaded in background cockpit panels which enables good performance, good images quality, images zoom and pan without performance hit.

bymaximus avatar Feb 23 '22 18:02 bymaximus