Hide / Remove standard stamps collection  SOLVED

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.
Post Reply
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Hide / Remove standard stamps collection

Post by MartinCS »

Hi,

is there a way to hide/remove the standard PDF Editor XChange stamps collection from the tool "Stamp"?

Below code throws an exception -> "Value does not fall within the expected range":

Code: Select all

var idxStandardStamps = PxcInst.StampsManager.FindCollection("Standard");
PxcInst.StampsManager.RemoveCollection(0);
Thank you,
Martin
Attachments
02-11-_2016_08-07-49.zip
(36.81 KiB) Downloaded 164 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Hide / Remove standard stamps collection

Post by Tracker Supp-Stefan »

Hi Martin,

As far as I remember, there is a requirement in the PDF specification that the default stamps should always be provided:

Code: Select all

Viewer applications should provide predefined icon appearances for at least the following standard names: 
Approved      Experimental   NotApproved
AsIs          Expired        NotForPublicRelease
Confidential  Final          Sold
Departmental  ForComment     TopSecret
Draft         ForPublicRelease
So I do not believe it should be possible to hide them at all.

Regards,
Stefan
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Hide / Remove standard stamps collection

Post by MartinCS »

Hi Stefan,

I noticed that my topic was posted to the wrong forum. It was supposed to be for the "PDF-XChange Editor SDK".

But I'm affraid it will not change your reply.


Martin
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Hide / Remove standard stamps collection

Post by Tracker Supp-Stefan »

Hi Martin,

I've moved this topic to the correct section of the forums, but yes you are right my reply will stay the same.

Cheers,
Stefan
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Hide / Remove standard stamps collection

Post by MartinCS »

Hi Stefan,

thank you for moving the topic.

Is it possible to collapse the standard palette by default?


Regards,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Hide / Remove standard stamps collection

Post by Sasha - Tracker Dev Team »

Hello Martin,

You mean in the Stamps Palette itself? Or in the Stamp dropdown menu?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am
Contact:

Re: Hide / Remove standard stamps collection

Post by MartinCS »

Hello Alex,

I attached you a scrennshot in order to sample my requirement. The stamps collection "Standard" is collapsed and anotherone like "EPLASS" is expanded:
03-11-_2016_11-38-10.zip
(53.46 KiB) Downloaded 178 times
Regards,
Martin
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Hide / Remove standard stamps collection

Post by Sasha - Tracker Dev Team »

Hello Martin,

It should be possible to do with the custom command handler. I will try to write a sample for you and will post here when finished.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Hide / Remove standard stamps collection  SOLVED

Post by Vasyl-Tracker Dev Team »

Hi MartinCS.

The working example how to hide stamp-collections:

Code: Select all

long hiddenCnt = 0;
PDFXEdit.ICabNode pr = pdfCtl.Inst.Settings["StampsView.HiddenItems"];
foreach (PDFXEdit.IPXC_StampsCollection col in pxcInst.StampsManager)
{
    hiddenCnt++;
    if (hiddenCnt > 3) // to hide first 3 collections only, just for example
        break;

    string colID = col.ID;
    // colID - for all collections excepting built-in 'Standard' it contains full file name
    bool bAdd = true;
    for (int i = 0; i < pr.Count; i++)
    {
        if (pr[i].v == colID)
        {
            bAdd = false;
            break;
        }
    }
    if (bAdd)
        pr.Add().v = colID;
}
- run it once, on start..

HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Post Reply