I am trying to compile a document to ODT format. The process hangs near the end, at the point of converting the file.
I can successfully compile the whole document to PDF, and parts of the document to ODT, but when compiling the whole document it so far always hangs at the file conversion stage. The only difference I can observe between compiling parts and the whole document is that I can see the Java file converter launching for parts, but don’t see it launch for the whole doc.
I have quit and restarted Scrivener and my Mac but that has not helped.
I’m using MacOs 11.6, Scrivener 3.23. Any help very much appreciated.
When you say it works fine for parts of the Draft folder, does that mean you have tried to compile all parts of it, separately, or that you have only spot checked a few folders? If there is something that is breaking the Java conversion engine, it may be in a spot you haven’t tested compiling, is what I’m getting at.
In the meanwhile, I would compile to RTF which LibreOffice does a good job of reading. It may even arguably be better to let it do the conversion to ODT than a third-party converter, but if not, you’d at least not be stuck unable to proceed, while troubleshooting the problem.
Thanks for the tips. I tried compiling the whole thing to RTF, but once again it hung towards the end of the process. As a workaround I’ve compiled every section to RTF and combined them into a new document, then saved to ODT.
There was no problem compiling each section individually to RTF, and every section has compiled to ODT before without any problem. Is there any way, for example a log file, that might help me understand what is preventing the whole document compiling at once?
And I’ve just checked and each section compiles individually to ODT without problems. So it just seems to be compiling the whole document that’s the issue.
Okay! That helps to narrow things down a bit, though the problem itself remains a bit mysterious. That explains why you weren’t seeing the Java converter icon come up, if it’s hanging before it can finish the RTF, it never finishes it to pass it along to the Java tool for ODT conversion.
Logging or checking for errors is indeed the next step. This post outlines two useful tools for that. I’d ignore the first paragraph, I don’t think your issue is related to system clutter.
Some sanity checks as well: do you have a lot of figures in the text, and how large would you say the RTF file should be, if compiled successfully?
I switched on the logging tools as you suggested and tried to compile the whole document to ODT. That produced an error message at the point where I see it hanging. The message within Scrivener and on the console seem to be the same:
Exception Name: NSRangeException
Exception Reason: *** -[__NSCFString rangeOfString:options:range:locale:]: Range {9223372036854775807, 9223372036854778212} out of bounds; string length 556571
There a lot of images. Based on compiling the individual chapters separately, the end result would be about 32MB. Is the file too large to compile in one go?
32MB is a bit on the large side of things, but in theory it should be fine, I’ve seen larger RTF files from even the older 32-bit version that worked. So I don’t think it’s a memory problem, though you could maybe test that by doing a reboot and compiling in a relatively clean environment without any other heavy-duty tools running.
Something else I would try, if you can, is swapping out the images. If they are all embedded that won’t be something you can easily do, but if they are linked to the disk then you could duplicate the folder they are in, and then try reducing their size to thumbnail quality. If you have Photoshop or Graphic Converter you could do that in one easy batch. If that works, then you can go back to the original files and work toward optimisation, starting with the largest of them.
Unfortunately I’m still trying to solve this problem. Here’s what I’ve tried so far:
reducing the size of all the images in the document, as suggested. That roughly halved the size, but doesn’t prevent crashes when compiling the whole document
rebooting has had no effect
I’m now trying to compile less and less of the document to see if I can identify where the problem might be. Even when trying to compile a single chapter as a part of the whole manuscript, it crashes on compile. That chapter is just text, and compiled on its own is less than 30Kb. This makes me think that the images may not be the problem.
I’ve pasted the most recent crash report below – can you suggest anything else to try?
Exception Name: NSRangeException
Exception Reason: *** -[__NSCFString rangeOfString:options:range:locale:]: Range {9223372036854775807, 9223372036854777899} out of bounds; string length 43980
Create a new test project from the “Blank” starter and open it alongside your main project.
Drag one of the chapters that you know causes a crash into the blank project’s Draft folder.
Compile that using the same settings (if it is a custom compile format, you can drag and drop between Format sidebars with both compile overview windows open).
If this crashes, could you send the test project to technical support, so that we can take a look at it?