Corrupt Word Compile from V3 project

User avatar
nontroppo
Posts: 1208
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Tue Oct 30, 2018 12:41 am Post

On this thread:

viewtopic.php?p=257245#p257245

I had previously set up a test project to show how to get Heading 1-3 styles exported from Scrivener to Word, using Section Layouts with Styles "Heading X" assigned to the titles. It used to work. I just downloaded that project and tried to compile it in 3.09 to confirm it still works, but compilation gives me this when trying to load the docx file into Word V16.18:

Screenshot 2018-10-30 at 08.23.56_SMALL.png
Screenshot 2018-10-30 at 08.23.56_SMALL.png (19.42 KiB) Viewed 4158 times


If you try to load it anyway (click yes), headings are not styled any more. There must be something in this project that is triggering the compile issue for DOCX, it seems RTF export is OK. I tried creating a new project and the same problem occurs, so it doesn't only occur in older saved projects. My version of Word is also newer than when I wrote that post so I don't know whether Scrivener is doing something different or Word is.

Please find .scriv and resultant docx attached:

Heading Test.zip
(93.94 KiB) Downloaded 206 times
Last edited by nontroppo on Tue Oct 30, 2018 1:51 pm, edited 1 time in total.

User avatar
AmberV
Posts: 24211
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Oct 30, 2018 12:20 pm Post

Given the “unreadable content” part of the warning message, I’d quickly try “zap gremlins” on the whole draft to see if that’s the problem.

I don’t think that’s the problem though, because the odd thing is that when I compile your sample project I get what appears to be a cleaner .docx file. I’m not testing with Word, but with Pages, LibreOffice and NWP. The .docx in your zip does indeed lack stylesheets in all three programs. None of them had any troubles opening the file, but no styles. So I compiled, and my .docx has styles. I’m attaching it to see if you get an error in Word.

How are you set up in the Sharing: Conversion preference pane? One thing I can think of is that the conversion engine has been updated, and may not work right with older system Java installs.
Attachments
styles.zip
(13.04 KiB) Downloaded 204 times
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
nontroppo
Posts: 1208
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Tue Oct 30, 2018 1:48 pm Post

I see styles in your attached word file just fine (looks like an RTF saved as a docx)

Screenshot 2018-10-30 at 21.41.35_SML.png
Screenshot 2018-10-30 at 21.41.35_SML.png (33.85 KiB) Viewed 4113 times


No system Java being used, so I think it should be fine. I attach a brand new project created fresh (from blank, again using Modern compile format) in 3.09, gremlins zapped, and still no styles in Word (or LibreOffice).

Heading Test 2.zip
(28.21 KiB) Downloaded 204 times


This happens on both my iMac and Macbook, so if it is a setting then it is shared across machines.I wonder what else is triggering this?

User avatar
AmberV
Posts: 24211
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Oct 30, 2018 3:50 pm Post

Strange, when I unzip the .docx I attached it looks like a normal DOCX directory and file structure to me, not a renamed RTF.

Well that aside, I had a closer look at the .docx file you sent and it is definitely not generated by the Java converter. Rather this is what a .docx file looks like when the Cocoa exporter is involved—and that will be the natural fall-back to use if for some reason enhanced converter fails. So, that is a strong indication that the Java environment in Scrivener may not be working right with your machine(s).

I’d compile with Console open and look for any messages relating to Aspose.

This could be a good catch. The Java environment has been completely updated internally. We needed to do that anyway, but new certification standards required urgently switching to another distribution, so we’re using OpenJDK now.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
nontroppo
Posts: 1208
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Tue Oct 30, 2018 11:42 pm Post

Yes, there is an Aspose failure, though I can see no console messages for Java itself:

Code: Select all

fault   07:34:11.429435 +0800   Scrivener   RETURNING UnknownFS PLACEHOLDER: <private>
fault   07:34:11.441002 +0800   Scrivener   RETURNING UnknownFS PLACEHOLDER: <private>
fault   07:34:11.456801 +0800   Scrivener   RETURNING kUTTypeApplication PLACEHOLDER: <private>
default   07:34:12.441578 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:12.441669 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:18.404838 +0800   Scrivener   Connection to sharingd became invalid
error   07:34:18.537082 +0800   Scrivener   errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
default   07:34:18.537208 +0800   Scrivener   OSErr AERemoveEventHandler(AEEventClass, AEEventID, AEEventHandlerUPP, Boolean)(ficl,askM handler=0x7fff495f2c9e isSys=NO) err=0/noErr
default   07:34:18.645717 +0800   Scrivener   Adding presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 for URL: <private>
default   07:34:19.258917 +0800   Scrivener   *** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.
default   07:34:20.216755 +0800   Scrivener   Making presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 observe change
default   07:34:20.216846 +0800   Scrivener   Making presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 observe change
default   07:34:20.222206 +0800   Scrivener   Removing presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7
default   07:34:21.051089 +0800   Scrivener   27366555: RECEIVED OUT-OF-SEQUENCE NOTIFICATION: 0 vs 210, 513, <private>
default   07:34:21.426965 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:21.427052 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:21.427111 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:21.427164 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:21.427217 +0800   Scrivener   Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default   07:34:22.479724 +0800   Scrivener   LSExceptions shared instance invalidated for timeout.


There is a kernel related error for [java] that is triggered immediately before Scrivener logs its message, here are two repeated failures, both logged as code signing issues:

Code: Select all

default   07:34:19.246407 +0800   kernel   CODE SIGNING: 22437[java] vm_map_enter: curprot cannot be write+execute. failing
default   07:34:19.258917 +0800   Scrivener   *** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.


Code: Select all

default   07:33:05.360624 +0800   kernel   CODE SIGNING: 22093[java] vm_map_enter: curprot cannot be write+execute. failing
default   07:33:05.377506 +0800   Scrivener   *** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.



-----------------


EDIT: if I try to run java on the command line from the app bundle it fails (and I see the same kernel error message in console too):

Code: Select all

/Applications/Scrivener.app/Contents/Resources/jre/bin
❯ ./java
Error occurred during initialization of VM
Could not reserve enough space in CodeHeap 'non-nmethods' (2496K)


But not for V3.03 where there is no kernel error or command line error (and 3.03 exports styles just fine using my latest test project):

Code: Select all

~/Desktop/Scrivener303.app/Contents/Resources/jre/bin
❯ ./java
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

User avatar
KB
Site Admin
Posts: 20729
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed Oct 31, 2018 1:58 pm Post

Could you please confirm that this version of Scrivener works fine?

http://www.literatureandlatte.com/dlbet ... x-test.zip

It seems that the problem is Apple's new notarisation requirements, which necessitate forcing a hardened runtime on the Java files. This, in turn, seems to prevent them from working on many computers. The above version does not force a hardened runtime on the Java files (and thus will not pass Apple's notarisation requirements). It looks as though I may need to take this up with Apple.

EDIT: Could you please specify which version of macOS you are running?
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
nontroppo
Posts: 1208
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Thu Nov 01, 2018 5:31 am Post

Yes, that build seems to work. I'm using 10.14 build 18A391 on an iMac 16,2 and a Macbook Pro 11,5 — I will try the 10.14.1 update and see if it fixes anything...

Ro
RorydEon
Posts: 12
Joined: Wed Jul 20, 2016 2:21 pm
Platform: Mac + iOS

Tue Nov 06, 2018 4:47 pm Post

I'm getting that same issue.
Word will open the file once you recover it. I can then resave to a working .docx.
Should I try the test build or just wait?
Rory
Oh, Macbook (latest one), 10.14.1, up-to-date Word 365