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

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post 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 3468 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post 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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post by Sasha - Tracker Dev Team »

Hi zarko,

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

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post by zarkogajic »

HI Alex,

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

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post by Sasha - Tracker Dev Team »

Hello žarko,

Check my previous post.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post by zarkogajic »

Hi Alex,

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

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post by Sasha - Tracker Dev Team »

Hi zarkogajic,

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

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

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

Post by zarkogajic »

Thanks Alex.

I'll close the topic.

User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

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

Post by Will - Tracker Supp »

:D
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply