Error saving in linearized format

Hi all,

I am copying the pages of a 81284 page pdf file, and saving to a new file with linearization. However, the save call came back with an exception during execution:

Exception: An error occurred during linearization: Operation file seek failed

What possible causes are there for the save command to fail with this error? I’ve attached my python code below.

new_doc = PDFDoc()

doc = PDFDoc("./test.pdf")

doc.InitSecurityHandler()

copy_pages = VectorPage()

itr = doc.GetPageIterator()

while itr.HasNext():

page = itr.Current()

copy_pages.push_back(page)

itr.Next()

imported_pages = new_doc.ImportPages(copy_pages)

i = iter(imported_pages)

for x in i:

new_doc.PagePushBack(x)

doc.Close()

new_doc.Save("./test_resave.pdf", SDFDoc.e_linearized)

new_doc.Close()

I know that it may be difficult to debug this without the original pdf, so just pointing me at possible causes of this error message would be great. I cannot provide the pdf itself without approval from management, as it has confidential information in it.

Thanks for building an excellent product!

Spencer Rathbun

L & D Mail Masters, Inc.

110 Security Pkwy

New Albany, IN 47150

812.981.7161 X.171

Fax: 812.981.7169

www.ldmailmasters.com

Are you using the latest version (i.e. v.5.8 or higher - http://www.pdftron.com/pdfnet/downloads.html). There were some files which were causing similar errors in older versions of the library. If upgrading does not help, we would need to take a look at the file to diagnose the issue.