Use pdfstamp.dll on Windows 2008 64-bit system

Hi Support,

We have been using the OS 2003 32 bit version of pdfstamp.dll and able to stamp successfully using Domino applications. Recently we have moved to OS 2008 64-bit and we have purchased the new DLL files for the OS 2008 Windows -64 Bit with the above mentioned order number.
When we tried to register the new dll files we had some problems. Please let us know the detailed registration and configuration process.

Domino Error: We have an error message while loading the DLL. "Error in loading DLL".

Below are some of the error messages when we tried to register. Please help us as soon as possible as the business is effecting and also provide the contact number for more clarification. Thanks.
================================
Please run following command line to register PDFStampOcx.dll COM interface,

C:\windows\syswow64\regsvr32.exe PDFStampOcx.dll

PDFStampOcx.dll is a 32bit COM interface to the PdfStamp.dll library, after you registered PDFStampOcx.dll, you can call "PDFStampOCX.CPDFStamp" from your code to stamp PDF files easily, please refer to following sample ASP code,

--------------------------------------------
Very_Set_Range = 131
Very_Set_Opacity = 240
Very_Get_Opacity = 240
Very_Get_PdfPageCount = 206
Very_Get_PageBoxForStamp = 260

Set oTest = Server.CreateObject("PDFStampOCX.CPDFStamp")
Response.write "Create Object Success!"

szPDFFile = "d:\testtt\example.pdf"

oTest.veryRegEx("XXXXXXXXXXXXXXXXX")
'//%text stamp%
'//%page header and page footer%
'//%Stamps are placed in the duplicate file, leaving the original copy unchanged%
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, "http://www.verypdf.com", 0)
Next page
code = oTest.veryAddTextEx(id, 7, "\d\n\t", 255, 0, 50, -30, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = oTest.veryAddTextEx(id, 5, "Page \P3+1 of \c", 255, 0, -50, -30, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = oTest.veryAddTextEx(id, 3, "2003 verypdf.com Inc.", 2666666, 0, -30, 30, 0, 0, 0, 300, NullString, 10, 0, NullString, 0)
oTest.veryCloseEx (id)
Response.write "1.pdf Success!"
Else
Response.write "Open file failer!"
End If
--------------------------------------------

PdfStamp.dll is a Win32 DLL Library, you can call it from your code directly, but you can’t register it by regsvr32.exe application, because it is not a COM component.

In the PDFStamp SDK/COM v2.5 version, you can also use PDFStampCom.exe COM interface, this COM can be used from both 32bit and 64bit systems, you can run following command line to register it,

PDFStampCom.exe /regserver

You need register it in a CMD window by administrator privilege, after you register it, you can use following code to call it,

------------------------------------------
strPDFFile = strFolder & “\example.pdf”
strOutFile = strFolder & “\vbcom-test.pdf”
Set pdfstamp = CreateObject(“PDFStampCOM.CPDFStamp”)
pdfstamp.veryRegEx "XXXXXXXXXXXXXX"
id = pdfstamp.veryOpenEx(strPDFFile, strOutFile)
‘id = pdfstamp.VeryStampLayerOpenEx(strPDFFile, strOutFile, “PDFManWatermark_Overlayer”, “PDFManWatermark_Underlayer”)
If (id > 0) Then
Page = 1
iRet = pdfstamp.verySetFunctionEx(id, Very_Set_InsertMultipleImageCopy, 1, 0, 0, 0)
pagecount = pdfstamp.veryGetFunctionEx(id, Very_Get_PdfPageCount, 0, 0, 0, 0)
MsgBox “PDF file: ” & strPDFFile & “, Page Count = ” & CStr(pagecount)
For Page = 1 To pagecount

leftpos = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “left”, 0)
top = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “top”, 0)
pagewidth = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “width”, 0)
pageheight = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “height”, 0)

‘We need to control which pages the stamp goes on
iRet = pdfstamp.verySetFunctionEx(id, Very_Set_Range, Page, 1, 0, 0)
strStampBuf = “Page:” + CStr(pagecount – Page + 1) + “, Page Box: [" + CStr(leftpos) + " " + CStr(top) + " " + CStr(pagewidth) + " " + CStr(pageheight) + "]”
Next
pdfstamp.veryCloseEx (id)
End If
------------------------------------------

VeryPDF
==================================
Good Day!

We have tried to execute the below code in our environment in Win 2008 64 bit server through IE browser but we are getting error as "Error in loading dll in line 7"
The error is coming when we call this line "id=veryOpen(sInput,soutput). The below code in done in Lotus Notes.
Please let us know how to resolve it or let us know your contact number to discuss further on this.

Option Public
Declare Function veryReg Lib "PdfStamp.dll" (Byval reg As String) As Long
Declare Function veryOpen Lib "PdfStamp.dll" (Byval sIn1 As String, Byval sOut As String) As Long
Declare Function veryOpenEx Lib "PDFStampOCX.dll" (ByVal sIn1 As String, ByVal sOut As String) As Long
Declare Sub veryClose Lib "PdfStamp.dll" (Byval id As Long)
Declare Function verySetFunction Lib "PdfStamp.dll" (Byval id As Long, Byval func_code As Long, Byval Para1 As Long, Byval Para2 As Long, Byval szPara3 As String, Byval szPara4 As String) As Long
Declare Function veryAddImage Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval filename As String, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long, Byval zoomH As Long, Byval action As Long, Byval link As String, Byval pageno As Long) As Long
Declare Function veryAddText Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval sstring As String, Byval color As Long, Byval alignment As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval hollow As Long, Byval fontcode As Long, Byval fontname As String, Byval fontsize As Long, Byval action As Long, Byval link As String, Byval pageno As Long) As Long
Declare Function veryAddLine Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval line_width As Long, Byval color As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long, Byval zoomH As Long) As Long
'VeryAddRect(very_id id,long sx,long sy,long ex,long ey, long side_width,long side_color, long flagFill,long fill_color)
Declare Function VeryAddRect Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval line_width As Long, Byval color As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long) As Long

'define for VerySetFunction
Const Very_Set_Range = 131
Sub Initialize
On Error Goto Error_Handler
Dim sInput As String
sInput = |E:\costsheet1.pdf|
'soutput = |d:\hema\OptimizingLotusScriptWhitePaper_Stamped.pdf|
soutput=Replace(sInput,".pdf","_Stamped.pdf")
id=veryOpen(sInput,soutput)
Msgbox "able to open the pdf== " & id
Call veryAddText(id,5, "Stamping Test is Successful",9868950, 18, 0, 0, 0, 0, 1, 200, NullString, 12, 0, NullString, 0)
Call veryClose(id)
Msgbox "Successfully stamped in the file" & soutput
Exit Sub
Error_Handler:
Msgbox  Cstr(Error()) & " Line = " & Cstr(Erl())
Exit Sub
End Sub
======================================
Are you using VB.NET code?

In general, you can’t call "PdfStamp.dll" from your 64bit source code directly, because "PdfStamp.dll" is a 32bit DLL Library, it can only be called from 32bit application, please notice this matter.

We suggest you may register PDFStampCom.exe first, and import “PDFStampCOM.CPDFStamp” from your source code, please refer to following sample source code, “PDFStampCOM.CPDFStamp” com interface can be called from both 32bit and 64bit applications,

you can use administrator privilege to run following command line to register PDFStampCom.exe into your system first,

PDFStampCom.exe /regserver

then you can use following source code to call “PDFStampCOM.CPDFStamp” com interface,
------------------------------------------
strPDFFile = strFolder & “\example.pdf”
strOutFile = strFolder & “\vbcom-test.pdf”
Set pdfstamp = CreateObject(“PDFStampCOM.CPDFStamp”)
pdfstamp.veryRegEx “XXXXXXXXXXXXXX”
id = pdfstamp.veryOpenEx(strPDFFile, strOutFile)
‘id = pdfstamp.VeryStampLayerOpenEx(strPDFFile, strOutFile, “PDFManWatermark_Overlayer”, “PDFManWatermark_Underlayer”)
If (id > 0) Then
Page = 1
pagecount = pdfstamp.veryGetFunctionEx(id, Very_Get_PdfPageCount, 0, 0, 0, 0)
MsgBox “PDF file: ” & strPDFFile & “, Page Count = ” & CStr(pagecount)
For Page = 1 To pagecount

leftpos = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “left”, 0)
top = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “top”, 0)
pagewidth = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “width”, 0)
pageheight = pdfstamp.veryGetFunctionEx(id, Very_Get_PageBoxForStamp, Page, 0, “height”, 0)

‘We need to control which pages the stamp goes on
iRet = pdfstamp.verySetFunctionEx(id, Very_Set_Range, Page, 1, 0, 0)
strStampBuf = “Page:” + CStr(pagecount – Page + 1) + “, Page Box: [" + CStr(leftpos) + " " + CStr(top) + " " + CStr(pagewidth) + " " + CStr(pageheight) + "]”
Next
pdfstamp.veryCloseEx (id)
End If
------------------------------------------
If you still can’t get it work, please create a remote desktop account on your test machine, after we logged into your test machine, we will figure out a solution to you asap.

VeryPDF
====================================
We are using Lotus Notes Script to execute the function to stamp the documents.

FYI,
We have been using the stampPDF.dll from 2005 in our application.We have purchased the first version in 2005 and after that we have purchased the latest SDK version.
Presently we are using this Stamp functionality in more than 350 applications .
It is very difficult to add VeryRegEx() function in all the applications.
So please provide the full custom-build version of pdfstamp.dll to solve our problem as well as please do consider that the dll provided will work for All MS-office versions.
==============================
Thanks for your message, are you compile your source code at AnyCPU platform? If yes, we suggest you may recompile your source code at x86 platform, then you can call pdfstamp.dll from your source code directly. If you compile your source code at x86 platform, you needn’t call COM interface, you can call 32bit pdfstamp.dll directly, you needn’t change anything to your source code.

VeryPDF

Good Day! 

We have tried to execute the below code in our environment in Win 2008 64 bit server through IE browser but we are getting error as "Error in loading dll in line 7"
The error is coming when we call this line "id=veryOpen(sInput,soutput). The below code in done in Lotus Notes.
Please let us know how to resolve it or let us know your contact number to discuss further on this.

Option Public
Declare Function veryReg Lib "PdfStamp.dll" (Byval reg As String) As Long
Declare Function veryOpen Lib "PdfStamp.dll" (Byval sIn1 As String, Byval sOut As String) As Long
Declare Function veryOpenEx Lib "PDFStampOCX.dll" (ByVal sIn1 As String, ByVal sOut As String) As Long
Declare Sub veryClose Lib "PdfStamp.dll" (Byval id As Long)
Declare Function verySetFunction Lib "PdfStamp.dll" (Byval id As Long, Byval func_code As Long, Byval Para1 As Long, Byval Para2 As Long, Byval szPara3 As String, Byval szPara4 As String) As Long
Declare Function veryAddImage Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval filename As String, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long, Byval zoomH As Long, Byval action As Long, Byval link As String, Byval pageno As Long) As Long
Declare Function veryAddText Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval sstring As String, Byval color As Long, Byval alignment As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval hollow As Long, Byval fontcode As Long, Byval fontname As String, Byval fontsize As Long, Byval action As Long, Byval link As String, Byval pageno As Long) As Long
Declare Function veryAddLine Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval line_width As Long, Byval color As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long, Byval zoomH As Long) As Long
'VeryAddRect(very_id id,long sx,long sy,long ex,long ey, long side_width,long side_color, long flagFill,long fill_color)
Declare Function VeryAddRect Lib "PdfStamp.dll" (Byval id As Long, Byval position As Long, Byval line_width As Long, Byval color As Long, Byval shift_lr As Long, Byval shift_tb As Long, Byval rotate As Long, Byval layer As Long, Byval zoomW As Long) As Long
'define for VerySetFunction
Const Very_Set_Range = 131
Sub Initialize
On Error Goto Error_Handler
Dim sInput As String
sInput = |E:\costsheet1.pdf|
'soutput = |d:\hema\OptimizingLotusScriptWhitePaper_Stamped.pdf|
soutput=Replace(sInput,".pdf","_Stamped.pdf")
id=veryOpen(sInput,soutput)
Msgbox "able to open the pdf== " & id
Call veryAddText(id,5, "Stamping Test is Successful",9868950, 18, 0, 0, 0, 0, 1, 200, NullString, 12, 0, NullString, 0)
Call veryClose(id)
Msgbox "Successfully stamped in the file" & soutput
Exit Sub
Error_Handler:
Msgbox Cstr(Error()) & " Line = " & Cstr(Erl())
Exit Sub
End Sub

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!