Compile to PDF issue

Whenever I try to compile to PDF, it never completes. My bar fills up with blue and then changes to the barbershop pole animation, but stays there forever. I am running on a Mountain Lion version 10.8.2 and Scrivener version 2.3.1. There is some information in the log, and I have included it below. Thanks for you help!

2012-12-04 20:29:02.397 Scrivener[910:c07] *** -[__NSArrayM objectAtIndex:]: index 152 beyond bounds [0 … 151]
2012-12-04 20:29:02.401 Scrivener[910:c07] (
0 CoreFoundation 0x96ff912b __raiseError + 219
1 libobjc.A.dylib 0x9603b52e objc_exception_throw + 230
2 CoreFoundation 0x96eefc3b -[__NSArrayM objectAtIndex:] + 251
3 Scrivener 0x0019e935 Scrivener + 1694005
4 Scrivener 0x0019dec8 Scrivener + 1691336
5 Scrivener 0x0018b794 Scrivener + 1615764
6 Scrivener 0x0018b695 Scrivener + 1615509
7 Scrivener 0x00189a4c Scrivener + 1608268
8 Scrivener 0x00189370 Scrivener + 1606512
9 libobjc.A.dylib 0x960485d3 -[NSObject performSelector:withObject:] + 70
10 AppKit 0x9878bbd2 -[NSApplication sendAction:to:from:] + 436
11 AppKit 0x9878b9e0 -[NSControl sendAction:to:] + 102
12 AppKit 0x9878b8ef -[NSCell _sendActionFrom:] + 159
13 AppKit 0x98789e60 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 1895
14 AppKit 0x9878969f -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 511
15 AppKit 0x98788db9 -[NSControl mouseDown:] + 867
16 AppKit 0x98780a21 -[NSWindow sendEvent:] + 6968
17 AppKit 0x9877ba0f -[NSApplication sendEvent:] + 4278
18 Scrivener 0x0004b833 Scrivener + 305203
19 AppKit 0x9869572c -[NSApplication run] + 951
20 AppKit 0x986386f6 NSApplicationMain + 1053
21 Scrivener 0x00031c28 Scrivener + 199720
22 Scrivener 0x00002f55 Scrivener + 8021
23 ??? 0x00000002 0x0 + 2
)
2012-12-04 20:29:02.427 Scrivener[910:c07] PSsetwindowlevel, error setting window level (1000)
2012-12-04 20:29:02.427 Scrivener[910:c07] CGSSetIgnoresCycle: error 1000 setting or clearing window tags

I’m guessing you have already tried this, but do any other formats work other than PDF? RTF would make for a good test.

I was just able to make the PDF compile work, but I had to eliminate some of the chapters. I think the bug is related to how many pages I’m trying to compile. But it’s not a huge number, only about 160 - 175 or so.

Thanks.

That’s a perfectly acceptable document length, you shouldn’t be having a problem with that. Was it a few sections in particular that resolved the problem, or just any arbitrary documents so long as the length was reduced? Sometimes a corrupted embedded graphic in one of the RTF files can halt the compiler, which is why I ask. If a section has a bad image, and you moved it out, that would clear up the problem.

The chapters I removed were just “place holders”. I have them as an outline, so they really don’t have any text or graphics in them at all, they just have a chapter number and a chapter title. They aren’t new to my project either, they have been in place for weeks. As I write, I add text to the chapters, and this issue just sort of popped up after finishing my last chapter.

I just added the outlines at the end back, and removed my first two chapters and it compiled successfully.

Any thoughts?

Thanks!

Well we did fix one bug that could trigger on PDF compilation. The fix is currently in the public beta, so it might be worth trying that out. You can try that out by extracting it from the downloaded zip and renaming it, then dropping it into Applications. That way you can test it without overwriting 2.3.1. Or you could just switch to it, it is in fact more stable than the stable version at this point.

Ok, I just put everything back into my project, and it compiles PDF just fine… It is now creating a 156 page PDF with no issues.

All I did was remove and add back various chapters and it started working again. I guess I will stay with the 2.3.1 unless I get this hiccup again. But I’ll save the link you sent just in case.

Thank you so much for your help!

Okay, just so you know the bug was caused under very specific conditions, when an empty line separator would have been inserted at a spot occupying the very bottom of the page, and is slated to be removed. So pagination would cause this trigger or go away. If you were indeed running into this particular bug, it would explain why shifting content in and out could cause it to go away, as that would likely change where the separator fell on the page.

Ah, okay. So if I added a few lines to my manuscript, that is what made the bug go away. I understand.

I have downloaded the beta and will start trying it out.

Thanks again!

I’ve been having two Compile to PDF issues that sound similar to this, and have solved one, with the aid of Astrid The Help, if this is any help to anyone: I noticed that in the Page Settings part of the Compile to PDF compile dialogues, the greyed-out file size on the right under the Page Setup button is tiny - 1.42cm x 1.98cm. Once I clicked into the button and chose Other>Manage Custom Sizes, the real size appeared (142.4mm x 198.4mm), and when I clicked OK and got back to the Compile/Page Settings pane, that little greyed-out number had changed to 14.2cm x 19.8cm.

So I can solve the problem by changing this (and sometimes the settings in the Formatting pane of that Compile dialogue) every single solitary time I invoke the accursed thing.

But Scrivener refuses to save these settings.

Normally, when you use a bunch of settings for any Compile user-defined set that you’ve made, the compile dialogue will automatically offer that set, and those settings when you next invoke Compile. But this isn’t happening, and it’s shedding the settings every time.

Edit: the beta download doesn’t solve this problem.

For what it’s worth, I had this same problem while compiling to PDF. I was getting this error in the Console:

Scrivener[450]: *** -[__NSArrayM objectAtIndex:]: index 93 beyond bounds [0 … 92]

When I removed a chapter it would compile just fine. When I put it back in, it hangs again.

For Maelduin,

Silly questions, but not intended to be patronising at all: have you looked at “Page Setup” under the “File” menu to see what the size there is?

The thing is, and I think I’m right, compiling to PDF sends the text through the ordinary print engine, but saves the output as a file rather than sending it directly to the printer in the same way as when you call up “Print” in a wordprocessor and choose “Save PDF” from the drop-down from the button on the left bottom of the Print dialog — when printing a document normally, a Mac creates a PDF file and sends that to the printer.

So every time you try to compile to PDF, it’s going to call up the Page Setup settings by default, so if by any chance, those have changed — look to see that the paper size is right, and also by clicking on the double triangle at the top, where it says “Page Attributes” and select “Scrivener” from the drop-down to check that you haven’t somehow got bizarre margin settings that are reducing the printable area to the small amount you see — and set them all right to what they should be if they’ve changed. For instance, my paper size is A4 and my margins are 2.54 cms on all sides.

HTH and sincere apologies if you’ve already done all that.

Mark