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, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

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: 674
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 » Wed Feb 19, 2020 4:00 pm

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 1447 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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Thu Feb 20, 2020 8:06 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 674
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 » Thu Feb 20, 2020 10:44 am

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: 674
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 » Thu Feb 20, 2020 12:06 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Thu Feb 20, 2020 12:27 pm

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Thu Feb 20, 2020 12:29 pm

Hi zarko,

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

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 674
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 » Thu Feb 20, 2020 12:34 pm

HI Alex,

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

-žarko

User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Thu Feb 20, 2020 12:51 pm

Hello žarko,

Check my previous post.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 674
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 » Thu Feb 20, 2020 1:27 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Thu Feb 20, 2020 1:49 pm

Hi zarkogajic,

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

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 674
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 » Thu Feb 20, 2020 3:14 pm

Hi Alex,

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


User avatar
Sasha - Tracker Dev Team
User
Posts: 4969
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 » Fri Feb 21, 2020 9:01 am

Hi zarkogajic,

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

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

zarkogajic
User
Posts: 674
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 » Fri Feb 21, 2020 9:15 am

Thanks Alex.

I'll close the topic.


User avatar
Will - Tracker Supp
Site Admin
Posts: 6905
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 » Fri Feb 21, 2020 9:18 am

: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