Programmatically adjust size of stamps  SOLVED

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Programmatically adjust size of stamps

Post by docu-track99 »

Hello,

Is there any way to programmatically adjust the size of stamps to a percentage (say 80%) of their size when placed. The reason we are asking is that a customer has created custom stamps which are only 14x14 pixels but they are still appearing too large for them to place them in in the boxes on their forms. They cannot make them any smaller by reducing pixel count, is there any other way for them to make them smaller.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Programmatically adjust size of stamps

Post by Vasyl-Tracker Dev Team »

Its possible by javascript:

Code: Select all

var pn = this.numPages;
for (i = 0; i < pn; i++)
{
    var aa = this.getAnnots(i);
    if (aa.length == 0)
        continue;
    for (j = 0; j < aa.length; j++)
    {
        var a = aa[j];
        if (a.type != "Stamp")
           continue;
        var x = a.rect[0];
        var y = a.rect[1];
        var w = a.rect[2] - x;
        var h = a.rect[3] - y;
        a.rect = [x, y, x + w * 0.8, y + h * 0.8]
    }
}
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.
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: Programmatically adjust size of stamps

Post by docu-track99 »

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

Re: Programmatically adjust size of stamps

Post by Tracker Supp-Stefan »

:)
Post Reply