Page 1 of 1

How to mimic "licensed features" as in EU Editor

Posted: Wed Jan 29, 2020 3:28 pm
by zarkogajic
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

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

Posted: Wed Feb 19, 2020 9:34 am
by zarkogajic
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

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

Posted: Wed Mar 04, 2020 6:31 pm
by Paul - Tracker Supp
Hi Zarko,

sorry for the delayed response.

Can you email this question to support@pdf-xchange.com and pass along with the email your license details please?

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

Posted: Wed Mar 04, 2020 7:24 pm
by zarkogajic
Hi Paul,

Tx. Done.


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

Posted: Thu Mar 05, 2020 8:09 am
by Sasha - Tracker Dev Team
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

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

Posted: Fri Mar 06, 2020 1:54 pm
by zarkogajic
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

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

Posted: Thu Mar 19, 2020 8:02 am
by Sasha - Tracker Dev Team
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

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

Posted: Thu Mar 19, 2020 8:45 am
by zarkogajic
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


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

Posted: Thu Mar 19, 2020 1:05 pm
by Sasha - Tracker Dev Team
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

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

Posted: Thu Mar 19, 2020 3:29 pm
by zarkogajic
Great, thanks.


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

Posted: Thu Mar 19, 2020 3:39 pm
by Sasha - Tracker Dev Team
:)