These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Cannot open or delete corrupted files from Portfolio

Naomi K
Registered: Jul 18 2011
Posts: 1
Answered

When my staff added records to a portfolio, somehow a few files became corrupt. When trying to open them, the dialogue box reads "There was an error opening this document. There was a problem reading this document (20)". Oh well, The files themselves are undamaged, so its no big deal, we can just take care of those records later.
 
However, we cannot delete the files from our assembled portfolios. When trying to, it says "expected a stream object", and does not let me get rid of it. My staff asked me to see if I could figure this out, and so far, nothing's worked. The way around it that I've found is to select the working documents, drag into a blank folder, and drag back into a new portfolio. It works fine, except all of the descriptive information that was entered into the fields does not come with it. We're dealing with hundreds of files, and it'd be a pain to manually re-enter it all.
 
My question is whether there is a way to either:
a) delete these corrupt files within the portfolio
or
b)get all of the working files with corresponding field info into a new portfolio
 
While I am using Adobe 9, some of my staff is using Adobe X. Even on their computers, I cannot remove these files.

My Product Information:
Acrobat Pro 9.0, Windows
KellyMcC
Acrobat 9ExpertTeam
Registered: Jul 11 2011
Posts: 389
Accepted Answer
Naomi,

Were you using any scripting (Assembler Java or web service API) to create the Portfolio, or simply File > Create PDF Portfolio?

Even if you weren't if you have someone on staff who knows JavaScript, I believe they could remedy this problem with some tips from Joel Geraci, check out this article:
http://blogs.adobe.com/pdfdevjunkie/2011/06/joels_pdf_portfolio_utilities.php

Another cause may be Optimize for Fast Web view option. See article:
http://blogs.adobe.com/pdfdevjunkie/category/acrobat/pdf-portfolios/page/3

In Acrobat 9 you can disable Fast Web View through a Batch Action.

1. Choose Advanced > Document Processing > Batch Processing
2. Click on Fast Web View and choose Edit Sequence
3. Click Output Options
4. Un-Check Fast Web View
5. Click Ok twice
6. Select Run Sequence on your files

Kelly McCathran
Adobe Community Expert
Certified Technical Trainer+

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
If you're getting a low-level exception (a dialog saying "Expected a....") there's no way round it with high-level tools such as JavaScript, and if Acrobat can't find the stream object that represents the attachment, it certainly can't edit that file's structure. Fast Web View can have an impact on the speed of display of large PDF documents *in a browser*, but it's not relevant here as we're talking about corrupted data.

It's possible to repair some damaged files using developer tools that allow you to manipulate the PDF at a raw code level, but if your Portfolio is large, digging through it to manually remove dead stream references is far from fun. There's a "Repair document" item in Preflight, but Preflight can't be run against a PDF Portfolio. As you can't even delete the damaged attachment, you're correct in assuming the only viable option is to make a new Portfolio from the working files, and repopulate the collection description fields.

As Kelly says it's possible to use JavaScript to dump the field data from the "details" view into an XML file, and use that file to repopulate a new Portfolio (containing member files with the same names). We don't have a pre-written utility available to the public which will do it all automatically, but I'll be covering how to make one in a forthcoming tutorial. Joel's utility gives a bare-bones idea of where to start, but it doesn't cover how to handle the structure, record-saving and re-population parts of the process.