The problem with your design is when you will have a change in the html file.
But, you can store the html file and the folder (full of images ) beside it somewhere (in AppData) and load it at htmlviewer open time.
This allows you to modify the html and/or the images without the need to compile another application.
They need to be relative to the HTML file, and referred to properly within.
many web design tools ask for the name of your website and create links that a relative to that.
Look at your HTML
if your page is index.html and it lives in a folder that contains a folder called files,
an image can be referred to like this
<img src="file/myimage.gif" alt="words go here" >
if the image is in the same folder as the HTML file:
<img src="myimage.gif" alt="words go here" >
but if you have used some tool, you may find your Html code says:
<img src="C:/documents/myfiles/helppages/myimage.gif" alt="words go here" >
You can use Chrome to store a complete webpage as one single file, images included. This ccan easily be viewed within htmlviewer. I use this for aboutscreen and helpscreens within a desktop app.
@Oliver Janz Folders are organized differently when you run a project in Debug mode or in a built application. It is very important that you use the right method to get the FolderItem you want.
Do you have a hint for me how to store the html-file and the image-folder in AppData? Can I do that with a build-step? I’ve tried to do it, but it didn’t work.
Or do I have to drag all into my project and copy it on runtime into AppData?
I think I undestand the way you proposed. I guess I also know how to read files out of the SpecialFolder AppData. But I can’t figure out how to copy it into this folder.
In the App.Open Event, check for the presence of your folder in AppData (name of the application used as folder name). If present, check for .Exists in the html and folder images items. If do not exists, copy then from beside your project to there.
At each run, the application will check in AppData if the files are there and eventually copy them.
Create a global property to that folder (and html file).
Then, in Window_HTMLViewer.Open, use the above Property to load the html (and the associated files).
Why ? You can do the job without using any third party plugins.
Btw I don’t have an issue without the well known MBS plugins at all, but if I don’t need them for the job … and without using plugins it’s easier to share code with fellow developers who might not have a license for the plugins.
Yes. And when I need an image, I do not have to search around, then go back to internet to get it a second time.
Also, most of the attached items in Safari I have to send the mail into another mail address I can access from Firefox: I nearly am never able to download the items from Safari (I do not know why, but I do not wasted my time there).
[quote=475626:@Oliver Janz]I asume that I need to include the html-file and the images folder somehow into the project. For example by copying both to the resources folder by using a buid-step.
Is that correct?[/quote]
No. I meant put a new folder in the xojo project folder (near the project) and work from there. So you will not have to search where you put these files.
Sorry.
(I think I forgot something, but it is late in the afternoon and I have to move).
Doh ! I get it: you have to pack these file near the application in some way, so the Copy will work.