How to add image to PDF file from ASP?

Question:I have a PDF document but I must put my own image on it. It's an official document and I must apply an image with the text "example" to the whole page.Is there any way to solve this problem from ASP?(text in the document is curves) Is there any solution on VeryPDF?

Answer: According to your needs, you can add image stamp to PDF from ASP. Software VeryPDF PDF Stamp COM can help you handle this problem easily. By this software you can stamp PDF either by text “example” or image stamp "example". By the COM version, you can call it also from programming languages like C#, VB .NET, J# via .NET, Java via JNI, MS Visual Basic, Borland Delphi, MS Office products such as Access and C++ via COM, C and C++ via native C. Please check more detail information of this software on homepage, in the following part, let us check how to use this software.

Step 1. Free download PDF Stamp COM

  • As it is COM version, when downloading finishes, there will be a zip file. You need to extract it to folder form then you can use it normally.
  • When you use this software, please refer to the usage and example in the extracted folder.

Step 2. Apply an image with the text "example" to whole page.

    • When you need to add image stamp. please refer to the following usage:

long  VeryStampAddImage ( long id, long position,
char * filename,
long shift_lr,long shift_tb,long rotate,long layer,
long zoomW,long zoomH,
lont action, char *link, long pageno);
Create an Image Stamp.
Returned by VeryStampOpen function.
Position where on the page the stamp item will appear. Allowed values are Top, Bottom, Top-Left, Bottom-Left, Center etc. If Position is 0, PDF Stamp will use the default, Top-Left, and the stamp will appear at the Top-Left of the page.

    • When you need to stamp image from ASP, please refer to the following code template:

id = oTest.veryOpenEx(szPDFFile, "d:\testtt\1.pdf")
If (id > 0) Then
page = 1
pagecount = oTest.veryGetFunctionEx(id, 206, 0, 0, 0, 0)
For page = 1 To pagecount
left = oTest.veryGetFunctionEx(id,
Very_Get_PageBoxForStamp, page, 0,"left", 0)
top = oTest.veryGetFunctionEx(id,
Very_Get_PageBoxForStamp, page, 0, "top", 0)
pagewidth = oTest.veryGetFunctionEx(id,
Very_Get_PageBoxForStamp, page, 0, "width", 0)
pageheight = oTest.veryGetFunctionEx(id,
Very_Get_PageBoxForStamp, page, 0, "height", 0)

iRet = oTest.verySetFunctionEx(id, 131, page,1, 0, 0)
strStampBuf = "Page:" + Str(pagecount - page + 1) +", Page Box: [" + Str(left) + " " +                      Str(top) + " " + Str(pagewidth) + " " + Str(pageheight) "]"

iRet = oTest.veryAddTextEx(id, 2, strStampBuf, 255,
0, 0, 0, 0, 0, 0, 300, 0, 10, 1, "", 0)

Response.write "1.pdf Success!"
Response.write "Open file failer!"
End If

During the using, if you have any question, please contact us as soon as possible.

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

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!