Build Failed: Unbalanced Save/Restore State Operators

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
vaikanen
Propeller Head
Posts: 11
Joined: Tue Sep 26, 2017 8:41 am

Build Failed: Unbalanced Save/Restore State Operators

Post by vaikanen »

Just started getting this error message doing a PDF build. (It doesn't occur outputting to HTML5).

Bizarre thing is that it just "started happening". I had literally built the PDF about 5-6 times.

Anyone know the source of this? Even searching the Interwebs didn't turn up much, although it does appear to be a Github error specific to outputting to PDF. It might be tied to a piece of CSS somewhere, but like I said -- it had been working fine for the last 5-6 builds (let's say an hour) before this just started happening.

Any ideas?
vaikanen
Propeller Head
Posts: 11
Joined: Tue Sep 26, 2017 8:41 am

SOLVED -- Build Failed: Unbalanced Save/Restore State Operators

Post by vaikanen »

OK, so after some troubleshooting I managed to figure this out. Sharing for anyone that runs into this problem. It was puzzling.

Original Problem: Building PDF Target failed with this error: Build Failed: Unbalanced Save/Restore State Operators

My only initial clue (from searching the web) was an error reported trying to build a PDF from a Git Repo using Open PDF. It was caused by a specific piece of CSS code that, while valid, didn't work with Open PDF for some reason.

Similarly, it turns out this problem in Flare was caused by a combination of 2 very specific things (both valid XML/CSS/HTML) that (for some reason) break Flare 2024's PDF Output:

A DIV (a note/tip style) that was changed from Display: Block to Display: Inline-Block.
Placing the offending DIV inside of <li></li> tags.

Note that there's absolutely nothing wrong with this. The CSS/HTML/XML is all valid.

But once I nailed the problem down, all I had to do was change the DIV back to Display: Block and Flare could successfully output the PDFs for the targets again.

How I diagnosed/tested (if you're curious):
I created a new TOC
Added book-by-book/topic-by-topic from the old TOC into the new TOC, then built the project.
Eventually was able to pin the problem down to a single topic/file.
Then I copied blocks of code section by section from the "bad" file to a"new file", rebuilding after each block until the error re-surfaced.
Then remembered that the night before I had changed the DIV property to test something. Changed it back and problem solved. :)

Unrelated: Why are Flare Forums running on what feels like 1996 editing/forum platform. It's like a frikkin' Compuserve flashback.
Post Reply