Tinderbox Forum

Exporting Selected Note with Images in html

Hi

When I attempt to export a note with an image within the text pane, it exports only with a placeholder image and not the image. I have used the standard html template in the export tab. The placeholder text is confirmed in the html preview tab as well. Obviously, I am missing some code (I think) in the export template…but not sure how to proceed?

Thanks.

Here is a simple example using File > Built-in Templates > HTML, a note with an image, and File > Export > HMTL. I’ve included the Tinderbox file and the resulting export. I used just the features included with Tinderbox. I wasn’t able to fail.

Could you explain a bit more on how you are setting up your file? Or perhaps post a file that’s not succeeding for you?

HTML Export With Images.zip (273.1 KB)

1 Like

Thanks Paul. Unfortunately this is a work file so I cannot send the whole file, however I did copy and paste your image into a new note and reproduced the same issue. The way I created in the export template was simply using the File menu: File/Built-in Templates/HTML then used that template using the HTML inspector. Here are some some shots with what I am seeing.

Thanks for your assistance
Tom

Text Pane:

!

Preview Pane which matches the export

Could you post a screenshot of the Preview tab’s contents? There’s nothing wrong with the templates (see my text file), so there must be a configuration issue.

E.g., the Template assigned to the note is the wrong one. The exported note should use for its template /Templates/HTML page, and if that note has children then HTML Page will include the children using HTML item.

(Not being able to see your file or a sample means we’re just guessing. Did you try to make this work with a new file?)

Hi Paul

I was looking at the file you sent and what is interesting is that it too will not export images. The export selected note option only prints text (no image) and the preview tab only has a placeholder

Preview tab:

Text tab:

I’m sorry, I meant to ask for the HTML tab’s contents.

No, sorry, not correct. The file I sent does export text + images. The folder I included in the file is the HTML and the image. The entire contents of that folder was created by Tinderbox, exactly the way Tinderbox exported it. I didn’t change a thing.

(Images are not embedded in the exported HTML. They are linked to in an HTML statement. The statement created by Tinderbox is <img src="The_Note.jpg" alt="" > Tinderbox places the image for the note into the export folder and names it The_Note.jpg .)

Sorry this doesn’t work for you. But there’s something you’re configuring wrong and since we cannot see your work, we’re only guessing. Maybe someone else has a better way of explaining – I’ve run out of suggestions. Good luck with your work.

Thanks Paul. I think I found the issue. I got it working with the html tab

Thanks again for all your help and direction.

Tom

Note, external images, linked CSS and other web resource (scripts, etc.) generally don’t function fully in the preview pane unless all such assets have been exported from Tinderbox or placed in the appropriate (export) folder if not app generated.

Thus, ages from notes with images embedded in $Text won’t show the image in preview until the page (and possibly whole site - i.e. all exporting pages) have been exported once.

1 Like

Hi all, I tried the examples given here to export a larger document including some images as html to import it into word. Final document has to be a word file requested by the customer.

In the generated html, the images are referenced like

<img src="doc_name/chapter1/subchapter1_1/name_of-Image.jpg" alt="" >

but the image itself is not imported neither the directory structure is created.

I have assigned the top level note the HTMLExportTemplate mentioned by @PaulWalters in this conversation (many thanks !!!) and as long as I am exporting a note directly including the image everything works.

I am using Tinderbox Version 8.7.1 and OS X Catalina latest version.

Do you have any idea ?

Thanks for your support.
Ralph

Look at the exported HTML in preview. Do you see the images?

Look at the exported HTML: is it correct?

Start with your exported folder, what name does it have? Does that equate to the name of the top level export folder. ‘HTML export’ essentially exports the entire doc, except those parts you set not to export. So for a note with 2 images in it you expect an HTML file and two JPGs.

Or, are you exporting a single page. either way, you should get an HTML file and—if the image is being exported from $Text—a JPG for each embedded image. So a note with 2 embedded images should output to the same location

IIRC, exporting a single page (i.e. File → Export selected note) for a document that has not yet been fully exported may result in the single HTML file (& images) being exported to some default location, like the desktop. If that happens and you want to view the HTML with the co-located images, just edit the HTML from your example above to:

<img src="name_of-Image.jpg" alt="" >

This will cause the browser to look in the same fold (locally or online) for the images to use.

Without anything to look at it’s a bid hard to delve deeper

Thanks for your immediate response. I relooked at the preview pane and the images were not shown there. The HTML code looks ok for me but I am not an expert. But I reduced the original file to an example enclosed with same structure and templates used. Unfortunately I was not able to enclose images because of sizing. But result is the same as with the original larger file.

HTML_export_images.tbx (123.1 KB)

1 Like

Oh: Export Selected Note assumes that you’ve previously done a full HTML export; it replaces the selected note in the export folder.

Do you need HTML Export, or will the text export direct to docX suffice?

I tried export to docx before, but I need to format the headlines to get the outline view in MS word. This was not given in the generated docx. For this I followed Paul’s suggestion using CSS elements.

Hi all, in the meantime I was successful in doing the export!
First I have exported whole document as html again and afterwards I have imported whole document including folder hierarchy created by the former export into word.

The only issue left was resolution of the images. Some images were not fitting in the word document regarding size and position.

In the tbx file itself, there were some inconsistencies regarding export template usage. Looks like this was the main reason for my export issues.

So, thanks everyone for support !

1 Like

Thanks for taking the time to report back. I think this sort of thing is useful, especially to others who may be part-way through a similar process.