Skip to main content
Inspiring
June 22, 2010
Question

[CS5] Unable to save or close a document

  • June 22, 2010
  • 3 replies
  • 1293 views

I'm working on porting a plugin from CS4 to CS5. One of its functions is to save each page of a document as a separate file. It does this by saving a copy of the main document, opening it, removing the unwanted pages, and finally saving it. This worked fine in all previous InDesign versions, but in CS5 IDocFileHander is returning false for CanSave() and CanClose(). Ignoring that, or processing a save or close command directly, causes ID to enter protective shutdown.

There was another message posted recently with a similar problem  ( http://forums.adobe.com/thread/647045?tstart=0 ), but I'm not performing my actions as part of a command or a command sequence. Is there another reason why InDesign wouldn't allow me to save or close a document?

This topic has been closed for replies.

3 replies

Participating Frequently
January 11, 2011

Hi Caerwyn,

First of all thanks a lot for replying to the post.

Well the issue is not exactly with opening any CS4 document in CS5 as i am creating new document in InDesign CS5  all the time.On further analysis , i found that even my plugin is not able to save the document using IDocFileHandler->Save(docUIDRef);.Save option fails only when the database is corrupt,but even that doesn't seem to be the case here as i am able to manually save the document.Only if i am saving using command,it is not saving the document.Any idea what could probably be wrong??

Regards,

Shailesh 

Participating Frequently
January 11, 2011

Hi Andrews,

Even i am porting my project from CS4 to CS5.I had a functionality wherein i had to close the document after generating the xml.For closing the document, i am using IDocFileHandler->Close(docUIDRef,uiFlags).On using kSuppress as uiFlags ,its working fine.But on Selecting kFullUI as uiFlags, i am not able to save the document.If i try to save the document before closing ,it showing "cannot save document1.indd".I tried looking in the forum but apart from this post,couldn't find much help.Can somebody please help me out on this.

Regards,

Shailesh

Inspiring
January 11, 2011

My guess is that it is only a problem if you're opening a CS4 document in CS5.

What happens if you open the document in CS5 without using your plugin?

I bet if you make a change and hit save, you'll be prompted to "Save As..." somewhere else instead of over-writing the original.

I think if you suppress the UI it will over-write the original older version.

If you have full UI then it will give the user the choice.

I'm sure someone wiser and older than me will fill in the details.

Regards

Caerwyn

pardalek
Inspiring
June 22, 2010

Hello Andrew,

here is Adam from the thread you already read. I might some more hints for you. First, when I was saving my document, I needed to add a textframe, then export the document *with* the textframe to XML and after that I deleted the textframe so the user doest see anything. So it looked like:

SaveMyDoc(docref)

{

     1. add a textframe

     2. export my XML file

     3. delete my textframe

     4. call IDocFileHandler to save it <- here CanSaveAs Asserted

}

When I changed to following style, I got what I needed without the Assert

SaveMyDoc(docref)

{

     1. call IDocFileHandler to save it

     2. add a textframe

     3. export my XML file

     4. delete the textframe

}

I got no assert, but the document was dirty and the user had to do Save again which was not nice.

I added line 5:

     call IDocFileHandler to revert to the saved file.

Now it feels OK.

More notes: my methods are in a facade in the model plugin and are called via Utils<IIMyUtils>(). I double checked my commands which set the persistent data in my document.

Lets hope what is written here is useful.

//Adam