How to "inject" into "Save As Optimized..." dialog and execution SOLVED
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.
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.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
How to "inject" into "Save As Optimized..." dialog and execution
Hi Support,
Here's what I'm after:
1. I'd like to get my hands on the IUIX_Dialog displayed when a user goes for "File - Save As Optimized..." command. Such a dialog does not appear in "DlgTemplates.xml" (Resources.dat) and therefore I do not know how to implement an IUIX_EventMonitor for it. Is that even possible (since this command is from the plugin)? If possible I will have more questions
2. I would need to get notified once the "save as optimized..." file is saved to the file system. For this I have my custom IUIX_CmdHandler.OnNotify (UIX_CmdNotify_Exec) for "cmd.pdfopt.pages". Using it I can catch the moment when the command is executed and the "Optimize PDF" dialog appears to the user. If the user clicked "ok" on it - the "Save File" dialog appears and if "Save" button is clicked, the "e.afterShowOpenSaveDialog" is triggered and I can use IPXV_ShowOpenSaveDialogEvent to get to the file name the user used for saving the optimized file.
And at this moment I'm stuck, because saving goes on and I do not have a way to figure out when it is done (and the file is available on the file system so I can do something with it).
Any idea / help?
p.s.
Why: I want to add an option to linearize a document after saving as optimized. I know how to linearize.
-žarko
Here's what I'm after:
1. I'd like to get my hands on the IUIX_Dialog displayed when a user goes for "File - Save As Optimized..." command. Such a dialog does not appear in "DlgTemplates.xml" (Resources.dat) and therefore I do not know how to implement an IUIX_EventMonitor for it. Is that even possible (since this command is from the plugin)? If possible I will have more questions
2. I would need to get notified once the "save as optimized..." file is saved to the file system. For this I have my custom IUIX_CmdHandler.OnNotify (UIX_CmdNotify_Exec) for "cmd.pdfopt.pages". Using it I can catch the moment when the command is executed and the "Optimize PDF" dialog appears to the user. If the user clicked "ok" on it - the "Save File" dialog appears and if "Save" button is clicked, the "e.afterShowOpenSaveDialog" is triggered and I can use IPXV_ShowOpenSaveDialogEvent to get to the file name the user used for saving the optimized file.
And at this moment I'm stuck, because saving goes on and I do not have a way to figure out when it is done (and the file is available on the file system so I can do something with it).
Any idea / help?
p.s.
Why: I want to add an option to linearize a document after saving as optimized. I know how to linearize.
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hello zarkogajic,
Is this still needed or does this topic answer your questions:
viewtopic.php?f=66&t=35186
Cheers,
Alex
Is this still needed or does this topic answer your questions:
viewtopic.php?f=66&t=35186
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hi Alex,
Q1 is still open
That is : is it possible to get IUIX_Dialog displayed when a user goes for "File - Save As Optimized..." - as I'd like to place a check box on it (on the Cleanup "tab").
-žarko
Q1 is still open
That is : is it possible to get IUIX_Dialog displayed when a user goes for "File - Save As Optimized..." - as I'd like to place a check box on it (on the Cleanup "tab").
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hello zarkogajic,
How does it differ from other IUIX_Dialog extraction? I mean, for example any other dialog like Crop Pages.
Cheers,
Alex
How does it differ from other IUIX_Dialog extraction? I mean, for example any other dialog like Crop Pages.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hi Alex,
Do not know the dialog name / id (not found in DlgTemplates).
-žarko
Do not know the dialog name / id (not found in DlgTemplates).
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hello zarkogajic,
The ID of that dialog is dlg.PDFOptimizer. And it's not inside of the DlgTemplates as that's a plugin's dialog.
Cheers,
Alex
The ID of that dialog is dlg.PDFOptimizer. And it's not inside of the DlgTemplates as that's a plugin's dialog.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hi Alex,
I can catch e.Visible for 'dlg.PDFOptimizer', but pTarget in my IUIX_EventMonitor's OnEventMonitor is not IUIX_Dialog (nor any of pTarget.Parents) - so cannot do anything with it What is pTarget when e.Visible for that dialog?
What I am after: to place a check box here:
Or even better here:
-žarko
I can catch e.Visible for 'dlg.PDFOptimizer', but pTarget in my IUIX_EventMonitor's OnEventMonitor is not IUIX_Dialog (nor any of pTarget.Parents) - so cannot do anything with it What is pTarget when e.Visible for that dialog?
What I am after: to place a check box here:
Or even better here:
-žarko
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hi Support,
Any options here?
-žarko
Any options here?
-žarko
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: How to "inject" into "Save As Optimized..." dialog and execution SOLVED
The struggle was real, but I finally figured out
-ž
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to "inject" into "Save As Optimized..." dialog and execution
Hello zarkogajic,
Glad that you have found a solution
Cheers,
Alex
Glad that you have found a solution
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ