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.
Programmatically adjust size of stamps SOLVED
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Programmatically adjust size of stamps
Its possible by javascript:
HTH
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]
}
}
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.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am