Save Signatures

 

F/PDF, ASP, Self-Sign Signatures and ADO (Save Signatures Subroutine)

 

Sub SAVE_SIGNATURES(byVal Form_ID,byVal Primary_Value)

On error resume next

Dim FDFAcx2, FDFin2

Dim objFDF2

Set FdfAcX2 = Server.CreateObject("FdfApp.FdfApp")

Set objFdf2 = FDFAcx2.FDFCreate

Dim cTempFileSaveAppends, vntStream2, binObj2

Dim RS_Apr2

' Set to Session

cTempFileSaveAppends = Server.MapPath("Databases/”& Session.SessionID & ".pdf")

 

Set FDFin2 = FDFAcx2.FDFOpenFromBuf(Request.BinaryRead(Request.TotalBytes))

FDFin2.FDFExtractAppendSaves cTempFileSaveAppends

Set binObj2 = Server.CreateObject("binReadWriteBuf.BinRead")

vntStream2 = binObj2.readBinFile(cTempFileSaveAppends)

Dim SIG_NAME2

SIG_NAME2 = Fdfin2.FDFGetValue("NK_sigName") & ""

 

IF NOT SIG_NAME2 = "" THEN

Set RS_Apr2 = Server.CreateObject("ADODB.Recordset")

strDBPath = server.MapPath("Databases/PDF_Data.mdb")

 

          Dim sSQL, ConnStr

sSQL = "Select * From [NK_Signature] Where [SIGNAME] LIKE '" & SIG_NAME2 & "' AND [FormID] Like '" & Form_ID & "' AND [PrimaryValue] LIKE '" & Primary_Value & "';"

 

ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

 

          RS_Apr2.Open sSQL, ConnStr, 3, 3

IF RS_Apr2.RECORDCOUNT < 1 THEN

                    RS_Apr2.AddNew

          Else

                   RS_Apr2.MoveFirst

          END IF

          Response.ContentType = "application/pdf"

          RS_Apr2("FormID") = Form_ID

          RS_Apr2("PrimaryValue") = Primary_Value

          RS_Apr2("FormObj").AppendChunk(vntStream2)

          RS_Apr2("SIGNAME") = SIG_NAME2

          RS_Apr2("FormSize") = LenB(vntStream2)

          RS_Apr2("ContentType") = "application/pdf"

 

          if RS_Apr2("FormObj").ActualSize > 3000 then

                   RS_Apr2.Update

          else

                   RS_Apr2.CancelUpdate

          end if

          Set RS_Apr2 = Nothing

END IF

Set binObj2 = Nothing

Response.End

End Sub

 

 

Home
PDF Programming
ASP Server Setup
ASP Programming
Digital Signatures
FDF Programming
ASP.Net Server Setup
ASP.NET
Problems and Solutions
VB6 Programming
Load Signatures
Save Signatures

 

Copyright © 2003, 1991 - 2002