Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

saveAs and postSave issue, help!

Avatar

Level 3

The postSave event is called although saveAs down!

Sometimes when you download a form to fill out, when save it with SaveAs and choose "overwrite existing file" sometimes (randomly) fails, the error message are: "The file can be read only or another user may be open ...", finally NOT save the file, it nevertheless invokes the event postSave!

I just want to invoke postSave event code in case that was saved application form and present it does not matter if it successfully saved or not, the method is invoked postSave


How can I be sure the form is saved? ... I simply need to execute my code  ONLY when the form has been successfully saved, is there any way to get the result of the SaveAs method?

Thx!

5 Replies

Avatar

Level 3

Please, nobody can help me with this?

It is very important!

Thanks

Avatar

Level 10

Hi,

Here is a file that looks at how events fire. If you select "buttons" from the dropdown on page 2 and hit the "save" button, you will see the preSave and postSave events fire (for all 13 objects in the test area).

https://acrobat.com/#d=gQsdhRtm*K8xDIzZirfLcw

If you cancel the save operation, then the preSave and postSave events will not fire.

I have done this for a replace and it works. However I cannot replicate your situation.

Not much help, but I on't think you can access what is happening beyond postSave event.

Good luck,

Niall

Avatar

Level 3

Niall Thanks for your response, but does not answer my question, I understand you can not play my position, try to explain it better.

First of all mention that the forms is granted special permits to be filled with Reader, using Adobe Livecycle ES2, ReaderExstensions.

1. Download the PDF form from the web.


2. IE asked me, 'open, save?


3. Select Open directly (stored by IE temporary folders).


4. Fill out the form.


5. I click my button "save as", which executes the following code: "app.execMenuItem (" SaveAs ");"


6. Acrobat / Reader displays the popup asking me "Save a copy directly ...", select" SAVE "(without changing the form name) ... then Acrobat / Reader question again" file exist, overwrite it? " -> YES, override it.

That's when "sometimes" fails, I have tried on different computers, different OS (XP, Vista, 7), with different versions of Reader 8, 9, gets error message that said in previous post ( you can see in the picture below), the message is in Spanish.

saveAsError.png

The code in the method "postSave" is executed! despite being wrong: (

More disconcerting is that after this, if I click my save button again (or save the bar from adobe) DOES work! ... the second time it does it well.

Indeed, the link you post is not going well: S

acrobatdotcomError.png

Any other ideas?

Avatar

Level 10

Hi,

For what it is worth, the file is also here: http://cookbooks.adobe.com/post_How_often_events_fire_and_their_sequence-16547.html

However I don't think it will help your particular problem.

I think the problem is that the form was opened from the web directly and as you say, it is in an IE temporary folder. Acrobat may see that IE has the form opened, when it is trying to save it and therefore it fails to save.

When I test a form here (saveAs) it works OK, when opened directly and when opened off a webpage. I am using Safari on a Mac OS X 10.6.2.

Hopefully someone will have a solution.

Niall

Avatar

Level 3

Hi

Probably you are right and IE thongs who hold "in use" in question form (which propisie failure to save), but unfortunately this does not solve my problem.

It does not really worry me too much not to save the file itself, what worries me is that the event is invoked when postSave NOT BEEN SAVED.

If the postSave event is not invoked would have no problem, since the user would see the error message and might try to save it again, under another name, but the problem is that invoking the event as if everything had gone well.

What should be the behavior of the mechanism to saveAs and associated events if an unexpected error occurs as in this case?

I see no coherent or logical the current behavior of mechanism

I can not tell customers "Gentlemen this is the fault of IE" ... nor can I say "when they download the PDF, do not open the file directly, keep it in a diferent folder and then open it ...". Expected (at least for me) was that the event postSave be invoked only when the PDF is saved correctly, regardless of the causes of failure that prevents saving.

It is very hard to work with the Adobe PDF / Designer / LC platform... to do simple tasks, develop small applications/pdf forms over controlled environments, everything is fine, but when you need to integrate the platform into complex processes, with a variety of clients / environments (XP, Vista, W7, Reader and Acrobat 8,9, IE 7,8) arise multitude of "small" problems in which one developer many times (as in this case) can not provide a solution, it is really frustrating.

The only thing I can do right now is not to use the event postSave and consider a new mechanism to manage my PDF forms, not sure yet how I will do this.

Thanks anyway, and excuse my basic level of English.