Skip to main content
New Participant
January 31, 2024
Answered

How to retain layer information while exporting to FXL HTML

  • January 31, 2024
  • 1 reply
  • 1255 views

Hi

I'm writing a script that uses the FXL HTML export.
I have this educational book (made in indesign)
I want to make an HTML version of this.

In the books are gaps where students need to fill in texts and drawings
For the teacher we have a version of the book, with the solutions ready made
In a special layer with the "solutions" those missing texts en boxes are present.
When we set the layer visible, we can make a pdf for the book from the teacher 

What I want to achieve, is to export the HTML pages (FXL) and be able to grab the HTML that was in the "solutions" layer, so I can automate the process of hiding and showing solutions.

The only thing remaining in the html (exept for inline styles) are classes originating from character- paragraph- and alinea styles. I've tried to use those for my purpose, but since only one style can be applied to a pageItem, I'm afraid I will mess up the original indesign.

Are there any other kind of annotations that I can script into the HTML export exept from styles?

This topic has been closed for replies.
Correct answer James Gifford—NitroPress

Okay. It sounds as if you have a good technical handle on what you're attempting. The very short answer is that you're (back) into a realm where things like web pages and EPUB books are 'built by hand,' with each component file created to purpose and then assembled. While ID might be a tool to generate the page content, pretty much everything else is going to have to be done with other tools and techniques to assemble a result that serves your needs.

 

If the end result is "just a web page" that someone — student, child, reader — loads with a browser, Bob's suggestion to look at In5 is a good one. I don't know what its limitations are when getting into this kind of outlying, specialized result, but I know it can do outstanding interactive HTML from InDesign. You may have to adapt some of your workflow to it, but it if works, it could be a one-step tool.

 

If In5 won't do it (or the nontrivial cost is too high for your working budget), I can't think of any single tool, setting, plugin or process that would get you results. InDesign is not a very flexible creator of HTML and EPUB; while it has a fair number of export settings and points at which CSS and JS can be inserted, there's not really a path from "ID component pieces" (like layers) to "HTML page pieces" — and that's what you seem to need. You may be in the very small group that can still use the tool-like EPUB editors and assemblers, and (barring a trial run with In5) that's the direction I'd look.

 

I'm curious what your overall vision and purpose is here, though.

1 reply

James Gifford—NitroPress
Braniac
January 31, 2024

HTML is one thing, FXL is a subformat of EPUB. Yes, EPUB uses XHTML/CSS, but they're very different in nearly every other way.

 

All HTML and EPUB exports are subject to the limitations of HTML, which are many, and no, things like layers and other composition assets can't be included. The only format that will truly preserve your pages as you see them in InDesign — and can include some interactive features and even preserve layers, under the right conditions, is PDF.

 

It is just barely possible that JavaScript could be used to create interactive elements that would allow this show/hide feature in an EPUB export, but in the end, so much would depend on the EPUB reader used that I wouldn't even want to attempt it except for the narrowest use, such as one class or school where use of a specific reader could be enforced. (EPUB readers vary widely, if not wildly, and it is nearly impossible to create a book of any complexity that will read the same on any few, much less most, and never all of them.)

 

And, I'll noted that fixed-page EPUB, FXL, is a problematic and difficult format that should be avoided for all but "picture page" books. It's difficult to work with and a very poor choice for books that are wholly or largely text. Reflowable EPUB is the right path for those.

 

Happy to help further but I don't think anything but advanced PDF export is going to get you the result you're looking for.

 

Although it's possible an actual HTML page, designed for reading in a browser, could be finished or touched up with post-export editing to achieve show/hide features (perhaps in popup boxes). That would require moderately advanced InDesign layout and export skills, CSS styling control of the export, and then fairly advanced web development skills to achieve. The limitation there is that HTML is nearly impossible to rights-protect and any slightly savvy user could just look at the code for the answers. But it's the only workable path I can see, without further refinement of your project.

 

Here's an introduction to InDesign export to EPUB that might be useful.

New Participant
February 1, 2024

Hi James

Thank you for your answer.
I think I've read all the documentation available by now.

My intention is not to export for ePub readers.
I just want to use the seperate FXL HTML pages from the ePub (when i unzip them).
Then I want to use those pages in my learning platform.

The books are for children and contain very much the picture pages you mean.
It is important that the layout is fixed so the pages have the same appearance as their physical books.

 

My solution is perfectly possible, i've tested it with a bit of manual tweaks.
The manual tweaks are the problem: we have thousands of pages to go and I want it to be automated and robust.

When I export the ID page to FXLHTML via a script it's nearly perfect.
An item in a layer from indesign corresponds to a DIV-container in HTML

The only thing that's missing is from which layer the DIV-containers originate
Anyone who has an idea there would be a tremendous help

 

BobLevine
Braniac
February 1, 2024

Have you considered in5? Sounds like it would be well worth the investment for you.