Insert pages

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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Insert pages

Post by anovy »

Hi,

I have a wish for the "op.document.insertPages" operation. Could you please add to the options table a possibility to hide Source controls in the UI dialog (as called by the ShowSetupUI method)? In some cases I define the source myself and I want to offer to the user only possibility to change actions and target position. Thank you.

BTW:
The "op.document.insertPages" operation supports for Src also IPXC_Document and maybe (not tested) IPXV_Document. However the documentation states only IAFS_Name and IAFS_File.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

Hello anovy,

As you are using the SDK, you can do that by yourself :wink:

First you will need to get to the dialog itself. You can do that by using the custom event monitor like described here:
https://forum.pdf-xchange.com/ ... 43#p108843
Though you will need to listen to the e_ShowModal event.

Then you should look at the Editor's resources and see the names of the items in the dialog. The Resources.dat file is a zip file, so you can open it easily. Here's the path to the Dialogs' Templates: "Resources.dat\Misc\DlgTemplates.xml". The dialog itself is called DlgInsertPages. Then you can disable or hide the controls you need. Disabling them would be easier, because if you want to hide them permanently you will need to move all of the other items and also resize the dialog itself.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

Hi,

That's nice, but I think it is not good idea to rely on your internal undocumented resource templates which can change in future releases.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

Hello anovy,

Well, we do not plan to add the desired functionality, because every user\developer sees something their way. I don't see why this dialog should be changed, so you can do as I advised. Even though we work had on it we cannot possibly have everything documented at once, so this way is correct.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

OK, but please note: I'm not asking to change overall functionality, I'm only asking for one new option, which can be used also by others (and if not used, then nothing changes).

Anyway thanks for your help.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

I see, well as it is doable via the SDK so I doubt that we will add this option. If it was some missing method or something - then sure - not a problem. But custom modification of the functionality should be up to the developer to handle.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

I understand, but I really don't believe that the resource dialog templates will not change in future.

For example:
Do you think that it is good idea that the op.document.insertPages can operate with more sources (as for example op.combineDoc can, so its UI dialog has list of sources)? Currently op.document.insertPages can operate only with one source, but if you will decide in future (btw my next recommendation/wish) to enable multiple sources in one operation, then surely the UI dialog will change, and just the source controls will change. Etc.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

Well technically the op.combineDoc (with the options button added) is the op.document.insertPages with multiple sources ;)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

Yes, it is obvious. But op.combineDoc creates new document, it cannot directly insert the result to another document, so its UI dialog has no target location part (page position and location). And it is just why I must call two UI dialogs, first combineDoc, then insertPages, where insertPages has as Src the combineDoc result. And it is just why I need disable the source controls in insertPages dialog, because they should not be changed and moreover, they are empty in such case, which looks weird. And now I realized that the source page range (Options.PageRange) in the insertPages dialog should be hidden or disabled too. In fact after the combineDoc dialog I need only dialog with page position and location (Options.Position and Options.Location). Maybe there is some other possibility in SDK how to call such dialog?
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

Addendum:

Or another possibility is to add to the op.combineDoc a new Target option (then it can insert the combined result to an existing document).
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

Hello anovy,

Just spoke with the lead devs. The thing is that we won't do the custom coding for each and every person that asks something. We can take some advice and interesting thoughts and probably include them in our features, but we wont do the custom Editor modification.
As for the problem, there are two ways of solving this:
1) You can do as I advised, though that could lead to some unexpected UI behavior (though just hiding the controls shouldn't cause anything).
2) You can implement your own fully operational dialog that would suite your needs. Then you can load it when the user executes the command in place of the default one. This is time consuming but this is a correct way of doing things.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Insert pages

Post by anovy »

Hi,

So my advice (and I think an interesting thought which will be useful for many developers) is to add to the op.combineDoc operation a new Target option. This option can accept pointer to an opened document, if not used, the operation will act as now (new document is created).

Of course I can live without it, on my side the current solution is my custom UI interface for the page position location in the target document, then I use UI dialog from the op.combineDoc.

Thank you for your time and attention.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Insert pages

Post by Sasha - Tracker Dev Team »

Well we will take this into consideration :)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ