Programmatically modify stamp collection

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

dougk@bbsoft.com.au
User
Posts: 2
Joined: Thu Jan 01, 1970 12:00 am

Programmatically modify stamp collection

Post by dougk@bbsoft.com.au »

Is it possible to perform the following programmatically from a c# application:
1) Add a new PDF file (which has the stamp) to a custom stamp collection
2) Replace an existing PDF file (which has a replacement stamp) to the same stamp collection

The reason I am trying to replace the stamp is that information on it has to change each time.
I can recreate the PDF stamp with this changed information (date, unique number, etc.) and utilise this as the stamp.

Any sample code would be greatly appreciated.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Programmatically modify stamp collection

Post by Vasyl - PDF-XChange »

Hi,

I'm afraid but you have no possibility to manage programmatically the stamp collections using our Viewer SDK. Such features are available for you in our new Editor SDK only.

Cheers.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
dougk@bbsoft.com.au
User
Posts: 2
Joined: Thu Jan 01, 1970 12:00 am

Re: Programmatically modify stamp collection

Post by dougk@bbsoft.com.au »

Okay. Would you have any samples on how this is done using the Editor SDK.
Sasha - PDF-XChange
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Programmatically modify stamp collection

Post by Sasha - PDF-XChange »

Hello dougk@bbsoft.com.au,

Here's a small code snippet that I had on this matter:

Code: Select all

PDFXEdit.IPXC_StampsCollection SC = pxcInst.StampsManager.CreateEmptyCollection("MyStamps");
PDFXEdit.IAFS_Name name = fsInst.DefaultFileSys.StringToName(@"C:\Program Files\Tracker Software\PDF Editor\Stamps\ENU\DynamicDate.pdf");
PDFXEdit.IAFS_File file = fsInst.DefaultFileSys.OpenFile(name, (int)PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_Read | (int)PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
SC.AddStamp(file, "Red", 0);
file = fsInst.DefaultFileSys.OpenFile(name, (int)PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_Read | (int)PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
SC.AddStamp(file, "Blue", 1);
Also, there is a IPXC_StampsCollection::RemoveStamp method that allows removing the stamp from the stamps collection.
Also, check out this interface - it is used to work with Stamp Collections:
https://sdkhelp.pdf-xchange.com/vie ... mpsManager

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ