Page 1 of 1

Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Wed Feb 19, 2020 4:00 pm
by zarkogajic
Hi Support,

I'm using the PDFOptimizer.pvp plugin and as a result the "Save As Optimized..." appears under File menu.

When executing that command, the document will actually be saved to the file system, but in the UI it appears as not saved:

1. Create a new (empty) document

image.png

2. Document created:

image.png
image.png (17.09 KiB) Viewed 3470 times

3. Do "Save As Optimized..." -> "Optimize PDF" dialog appears, click "Ok" -> "Save File" dialog appears -> Specify the name and click "Save": the file IS saved to file system.

However, trying to close the document brings:

image.png

And also: events that happen BEFORE "Optimize PDF" dialog are e.document.beforeSave, e.document.performSave, e.document.savePerformed and e.document.afterSave - in all events IPXV_DocSaveEvent.Dest is assigned but is NOT IAFS_Name! What is it?

Then the "Save File" dialog appears, with an option to specify the name for the file, and upon clicking "Save" - no events are raised.


p.s.
I've edited the FullDemo to include loading of the PDFOptimizer.pvp ...

p.s.2
The same issue in EU Editor version 335.

-žarko

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 8:06 am
by Sasha - Tracker Dev Team
Hi zarkogajic,

If the same issue happens in the End-User Editor then please write to the appropriate forum (the End-User one) - you will be assisted there.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 10:44 am
by zarkogajic
Hi Alex,

Thanks. Will do so.

Note that this affects me as the user of the SDK - and that's my main concern.

So:
events that happen BEFORE "Optimize PDF" dialog are e.document.beforeSave, e.document.performSave, e.document.savePerformed and e.document.afterSave - in all events IPXV_DocSaveEvent.Dest is assigned but is NOT IAFS_Name! What is it?


-žarko

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 12:06 pm
by zarkogajic
Hi support,

Ok, so EU Forum reveals what's happening:
...Save As Optimized actually saves an optimized copy of the document, so it does not change the original.
Since none of the 4 events happen after the Save As dialog - how do I get the name of the file to be saved?


-žarko

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 12:27 pm
by Sasha - Tracker Dev Team
Hi žarko,

If you are saving the new, previously unsaved document then the Dest would be IString object with the path.
If you are optimizing some document that was previously saved, then these events won't be fired, as the IPXV_Document::Save method won't be called at all.
To be 100% sure, you can cast IAFS_Name, IAFS_File, IString and IStream - I think these are all of the possible interfaces for such kinds of destinations.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 12:29 pm
by Sasha - Tracker Dev Team
Hi zarko,

As for the file names obtaining, you should catch the id_e_afterShowOpenSaveDialog event.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 12:34 pm
by zarkogajic
HI Alex,

Are you saying I cannot get the info under what file name the optimized document will be saved?

-žarko

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 12:51 pm
by Sasha - Tracker Dev Team
Hello žarko,

Check my previous post.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 1:27 pm
by zarkogajic
Hi Alex,

Sorry, that post didn't show up for me before asking the last question.

Anyhow, I cannot locate that event in the list of events.

I can catch "e.document.askForSaveDest" but it states it gets fired *before asking for save destination* .

-žarko

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 1:49 pm
by Sasha - Tracker Dev Team
Hi zarkogajic,

Strange that it's not there - try catching it anyway. If you do, try casting it to the IPXV_ShowOpenSaveDialogEvent.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Thu Feb 20, 2020 3:14 pm
by zarkogajic
Hi Alex,

Yes, I can catch this event "e.afterShowOpenSaveDialog", however, no such interface to cast into :)


Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI  SOLVED

Posted: Fri Feb 21, 2020 9:01 am
by Sasha - Tracker Dev Team
Hi zarkogajic,

Added it - that interface should be available from the next release.

Cheers,
Alex

Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Fri Feb 21, 2020 9:15 am
by zarkogajic
Thanks Alex.

I'll close the topic.


Re: Save As Optimized (+PDFOptimizer.pvp plugin) - document saved but appears as not saved in UI

Posted: Fri Feb 21, 2020 9:18 am
by Will - Tracker Supp
:D