 <p>You might have have to set the temporary download path so that it writes it to disk while downloading the document. As is, it could be keeping the whole thing in memory and crashing when the memory footprint has become unacceptable to the system. The documentation isn't entirely clear on this.</p> <blockquote> <p>When downloading data to a file using downloadDestinationPath, data will be saved in a temporary file while the request is in progress. This file’s path is stored in temporaryFileDownloadPath.</p> </blockquote> <p>I can't seem to find out what happens if temporaryFileDownloadPath is nil.</p>