opacity option in PDF Stamp COM/SDK

Hello, i'm spanish programmer and in command line i can create watermark images into pdf files but in PDF "Stamp COM Server License, i don't do it.
i can send "-opacity" parameter in veryaddimage function?
==========================
Please refer to following sample code, you can use VeryStampSetFunction(id, Very_Set_Opacity, 30, 0, 0, 0); to set opacity for text and image stamps easily,

//define for VerySetFunction
#define Very_Set_Range                                                                    131
#define Very_Get_PdfPageCount                               206
#define Very_Get_PageBoxForStamp            260
#define Very_Set_Text_Leading                                 134
#define Very_Set_Opacity                                                      240
#define Very_Set_EmbedFont                                                241
#define Very_Get_EmbedFont                                                241
#define Very_Set_TransparentColor  242

{
//int pagecount = VeryStampGetFunction(id,206,0,0,0,0);
//strcpy(szPDFFile,"C:\\temp\\pdfstamp_sdk_v1.1_full\\bin\\example.pdf");
//strcpy(szImageFile,"C:\\_12_example.pdf");
id=VeryStampOpen(szPDFFile,"_001.pdf");
if(id>0)
{
int page = 1;
int pagecount = VeryStampGetFunction(id, Very_Get_PdfPageCount, 0, 0, 0, 0);
VeryStampSetFunction(id, Very_Set_Opacity, 50, 0, 0, 0);
for(page = 1; page <= pagecount; page++)
{
char m_szStampBuf[1024];
int left = VeryStampGetFunction(id, Very_Get_PageBoxForStamp, page, 0, "left", 0);
int top = VeryStampGetFunction(id, Very_Get_PageBoxForStamp, page, 0, "top", 0);
int pagewidth = VeryStampGetFunction(id, Very_Get_PageBoxForStamp, page, 0, "width", 0);
int pageheight = VeryStampGetFunction(id, Very_Get_PageBoxForStamp, page, 0, "height", 0);

VeryStampSetFunction(id, Very_Set_Range, page, 1, 0, 0);
sprintf(m_szStampBuf,"Page:<%d>, Page Box: [%d %d %d %d]",pagecount-page+1,left,top,pagewidth,pageheight);
VeryStampAddText(id, 2, m_szStampBuf,255,0,0,0,0,0,0,300,0,10,1,"http://www.verypdf.com",0);
VeryStampSetFunction(id,Very_Set_Text_Leading,20,0,0,0);
strcpy(m_szStampBuf,"2200444\n20555\n2200666\n2777");
VeryStampAddText(id, 1, m_szStampBuf, 255,18,0,0,0,0,0,200,0,10,1,NULL,0);
}
VeryStampSetFunction(id, Very_Set_Range, 2, 2, 0,0);
VeryStampSetFunction(id, Very_Set_Opacity, 30, 0, 0, 0);
VeryStampAddImage( id, 7, "logo.jpg",30,-30,0,0,0,0,0,0,0);
VeryStampAddImage( id, 3, "logo.jpg",-30,30,0,0,0,0,0,0,0);

//Set page range, stamp on all pages
VeryStampSetFunction(id, Very_Set_Range, 0, 0, 0,0);

//Convert white color to transparent background
VeryStampSetFunction(id, Very_Set_TransparentColor, 1, RGB(255,255,255), 0, 0);
VeryStampAddImage( id, 1, "logo.jpg",0,0,0,0,0,0,0,0,0);

VeryStampAddRect(id, 100, 100, 150,150, 2, RGB(255,0,0),0,RGB(255,0,0));
VeryStampAddRect(id, 100, 300, 150,350, 2, RGB(255,0,0),1,RGB(255,0,0));
VeryStampAddRect(id, 100, 400, 150,450, 4, RGB(255,255,0),0,RGB(255,0,0));
VeryStampAddRect(id, 100, 500, 150,550, 4, RGB(255,255,0),1,RGB(255,0,255));

VeryStampAddCircle(id, 100, 300, 50, 20, RGB(255,0,0), 0, 0);
VeryStampAddEllipse(id, 20, 20, 200, 80, 10, RGB(0,0,255), 0, 0);
{
int pageheight = 800;
VeryStampAddCurveTo(id, 0, pageheight, 86, pageheight-108, 201, pageheight-158,
216, pageheight-86,    5,RGB(0,0,255));
}

VeryStampSetFunction(id, Very_Set_Opacity, 70, 0, 0, 0);
VeryStampAddLine(    id, 2, 1, RGB(255,0,0),
0,80,0,0,
80,0);
VeryStampAddLine(    id, 6, 1, RGB(0,255,0),
0,-80,0,0,
80,0);
VeryStampSetFunction(id, Very_Set_Opacity, 25, 0, 0, 0);
VeryStampAddRectWithLayer(id, 200, 100, 250,150, 2, RGB(255,0,0),0,RGB(255,0,0),1);
VeryStampAddRectWithLayer(id, 200, 300, 250,350, 2, RGB(255,0,0),1,RGB(255,0,0),1);
VeryStampAddRectWithLayer(id, 200, 400, 250,450, 4, RGB(255,255,0),0,RGB(255,0,0),1);
VeryStampAddRectWithLayer(id, 200, 500, 250,550, 4, RGB(255,255,0),1,RGB(255,0,255),1);

VeryStampClose(id);
}

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PDFStamp Command Line and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!