How to mimic "licensed features" as in EU Editor  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: 630
Joined: Thu Sep 05, 2019 12:35 pm

How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Wed Jan 29, 2020 3:28 pm

Hi support,

In EU Editor (without license) if some features are used, like "flatten comments", the info bar will display the "licensed features used ... demo stamps placed.. if saved...".

How would I go about adding something like "licensed features" using the SDK?

Say I have defined some actions and I have IPXV_Document::OperationHistory.AddNew (or [Begin|End]Macro) for each. Some of those actions are "special" and if they were used I'd like to disable saving of the document.

My idea:
- Before (any type of) save operation is initiated, I'll somehow check if "special" actions were used and cancel the save (via events).
- How to lookup IPXV_Document::OperationHistory to see if it contains my "special" action(s)? The AddNew methods accepts nFlags parameter - so maybe I could use it to store something that would mark the item as "special" - however I do not see how to read this from IOperationHistoryItem.
- Is there a limit to OperationHistory items? As if the above makes sense, I need to ensure the following will not happen: my special action executed, then a series of standard actions, and as a result my special action is lost in OperationHistory due to, and I guess, MaxUsedMemSize.

Also: how can I check if some of the standard features, like "flatten comments" was executed (and not undone) on a document?

Finally: how can I add my own message (type) to the document info bar? If my special features are used I'd like the info bar to display my custom message (like it does for licensed features in EU Editor).


p.s.
I think I've found a bug in the EU Editor related to "licensed options" - if "Bookmark Every Nth page" is executed, the protected feature warning will appear, but the info bar will not display the warning nor will the demo stamp be placed upon save.


-žarko

zarkogajic
User
Posts: 630
Joined: Thu Sep 05, 2019 12:35 pm

Re: How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Wed Feb 19, 2020 9:34 am

Hi support,

Any comments here?

At least this:
how can I add my own message (type) to the document info bar? If my special features are used I'd like the info bar to display my custom message (like it does for licensed features in EU Editor).
-žarko

User avatar
Paul - Tracker Supp
Site Admin
Posts: 4999
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: How to mimic "licensed features" as in EU Editor

Post by Paul - Tracker Supp » Wed Mar 04, 2020 6:31 pm

Hi Zarko,

sorry for the delayed response.

Can you email this question to support@tracker-software.com and pass along with the email your license details please?
_________________
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

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

zarkogajic
User
Posts: 630
Joined: Thu Sep 05, 2019 12:35 pm

Re: How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Wed Mar 04, 2020 7:24 pm

Hi Paul,

Tx. Done.


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

Re: How to mimic "licensed features" as in EU Editor

Post by Sasha - Tracker Dev Team » Thu Mar 05, 2020 8:09 am

Hello žarko,

The IPXV_Document::InfoBar property allows you to obtain the IPXV_DocInfoBar interface. From there, you can modify it to your liking and also hide/show it.

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

zarkogajic
User
Posts: 630
Joined: Thu Sep 05, 2019 12:35 pm

Re: How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Fri Mar 06, 2020 1:54 pm

Hi Alex,

Yes, that's it, great, thanks.

Btw, couple of questions though:

1. What is nWeight parameter used for in AddSpan?
2. What does AddSpan2 do (seems like nothing)?
3. How to add formatted text (bold) via SetText?
4. When would I use Inst.RegisterDocInfoBarSpan?

-žarko

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

Re: How to mimic "licensed features" as in EU Editor

Post by Sasha - Tracker Dev Team » Thu Mar 19, 2020 8:02 am

Hello žarko,

The AddSpan2 method looks for an already existing span by the ID and then calls the AddSpan method inside if found. It also uses the PXV_DocInfoSpanFlags as an additional argument.
The weight of the span is used to find the insert position of the span in the Span List - this will also be used to prioritize one span over another. For example, the maximum weight right now is 800. Then the values like 700, 600 etc are used.
Can you give me an example on one of the spans with bold text that you have in mind?
The perfect place would be the e.app.initialized event from what I see.

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

zarkogajic
User
Posts: 630
Joined: Thu Sep 05, 2019 12:35 pm

Re: How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Thu Mar 19, 2020 8:45 am

Hi Alex,

Thanks.

Regarding "Inst.RegisterDocInfoBarSpan" - I meant why/when would I need to use it (not where in code).


Here's one bold section:

image.png


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

Re: How to mimic "licensed features" as in EU Editor  SOLVED

Post by Sasha - Tracker Dev Team » Thu Mar 19, 2020 1:05 pm

Hello zarkogajic,

Simply give it a string with <b> tag, for example:
"This document complies with the <b>%1</b> standard"
Better to register your custom spans so that it will smoothly work with other DocSpan logic.

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

zarkogajic
User
Posts: 630
Joined: Thu Sep 05, 2019 12:35 pm

Re: How to mimic "licensed features" as in EU Editor

Post by zarkogajic » Thu Mar 19, 2020 3:29 pm

Great, thanks.


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

Re: How to mimic "licensed features" as in EU Editor

Post by Sasha - Tracker Dev Team » Thu Mar 19, 2020 3:39 pm

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

Post Reply