Proper way to display local html files in Desktop app


I have a bunch of html files I need to display and I’m a little lost on how to do this.

  1. Where do I store the files? Do I drag the html folder into the app.

  2. How do I load the html viewer, It requires a FolderItem and am not sure how to do that or what the oath would be?

Any help would be appreciated.



you can pass a STRING containing the HTML code, followed by a temp folder (just a dummy placeholder actually)

its the example in the middle of the LangRef Page…

I am doing that for html string variable that I create. WHat I’m talking about is I have an html file that needs to be on the local machine that I need to display.

Like using file:///finename.html but I don’t know where to store the file so I don’t know what the path is.

If you drag the file into the project, just use the file NAME as the “string”

myHTMLViewer.LoadPage(myfilename,gettemporraryfolderitem) // no quotes, no extension, just as it appears in the IDE panel

If I drag it in where will it exist in the final build, both mac and windows. In the application folder?

I tried this:

Dim f As FolderItem = GetTemporaryFolderItem
 HTMLViewer1.LoadPage("html/AboutASPE", f)

What showed in the html viewer was: html/AboutASPE

The html is a folder that I dragged into the project.

you do NOT give it a foldername, nor a folderitem…
you give it the “string name” assigned by the IDE when you dragged it in… look in the left panel… and use what it says there… .and ONLY what it says… no path information, no extenstions… and it must be for a FILE you dragged in, not a folder
no quotes, since it is really a VARIABLE name that contains the contents of your file.

so at best it might be

 HTMLViewer1.LoadPage(AboutASPE, f)

@Dave S

I dragged the html file into the app, right next to the app object and used this code:

  Dim f As FolderItem = GetTemporaryFolderItem
  HTMLViewer1.LoadPage(AboutASPE, f)

Nothing showed.

show me a screen shot from your IDE… you are doing something wrong

whats the best way to display an image?

I use

[image removed]

Does the html file need to be in the applications folder?

No… it can be dragged from anywhere

It was dragged from my html folder in my project folder.

Why can’t I figure out images???

[quote=403105:@Eduardo Gutierrez de Oliveira]I may have missed this, but have you thought about copying them over to your bundle in a build step? You can add a whole folder and it’ll include its contents at compile time. Depending on where you tell it to save them, you can later retrieve them and load them up.

If it’s a lot of files this may be easier to load the whole folder into your application bundle.[/quote]
This will work, but then you have to load them from a “file” into a string, if I’m not mistaken

But for a simple page, I’m at a loss as to how to explain it any simpler … I mean I even drew a picture

[quote=403106:@Dave S]This will work, but then you have to load them from a “file” into a string, if I’m not mistaken

But for a simple page, I’m at a loss as to how to explain it any simpler … I mean I even drew a picture[/quote]

You can load folderitems straight into the htmlviewer. Is this not what he wants?

HTMLViewer.LoadPage(File as FolderItem)

At this point… I give up, because I’m no longer sure, since at one point he is talking files, then folders, and then images…

@Dave S

I have the same set up as you. Tell me how to post a pix then I can show you.

@Eduardo Gutierrez de Oliveira

That is what I want. But I also want to know where to store the files and how to use a folder item to point to the file?