In case anyone needs a solution on this, at least until Laserfiche adds an option to encrypt and email the filled PDF itself, I ended up having to export the file to the local server, use a script to pass a .bat file that file location and password (which then calls the .exe file to encrypt the PDF, which was a workaround for the System32 folder's library restrictions), grab the returned encrypted file's location through the .bat, replace the electronic document with the newly encrypted one, and then send that off with the email as an attachment. A lot of steps to get it done, but it does.
What it looks like in Workflow:
The script (VB):
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess
Imports DocumentProcessor100
Namespace WorkflowActivity.Scripting.SDKScriptEncryptFile
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits RAScriptClass100
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
Dim processID As String = ""
Dim stdOut As String = ""
Dim exitCode As String = ""
Using process As System.Diagnostics.Process = New System.Diagnostics.Process
Try
Dim SourceFile as String = tokenreplace("%(DownloadElectronicDocument_Result File)")
SourceFile = SourceFile.Replace(":","")
SourceFile = "C:\ProgramData\Laserfiche\WF\ServerData\" & SourceFile
Dim PassCode As String = GetTokenValue("PassCode").ToString
Dim cmdLineParameters As String = sourcefile & " " & PassCode
Dim externalProgram As String = "PDFRun.bat"
Dim waitForExit As Boolean = True
If (Not String.IsNullOrWhiteSpace(externalProgram)) Then
process.StartInfo.UseShellExecute = False
process.StartInfo.RedirectStandardOutput = True
process.StartInfo.FileName = externalProgram
If (Not String.IsNullOrWhiteSpace(cmdLineParameters)) Then
process.StartInfo.Arguments = cmdLineParameters
End If
process.Start()
processID = process.Id
If (waitForExit) Then
Dim output As String = process.StandardOutput.Readline
output = process.StandardOutput.ReadLine
output = process.StandardOutput.ReadLine
'Iterating to the line I needed.
process.WaitForExit()
stdOut = output
exitCode = process.ExitCode
End If
End If
Me.SetTokenValue("CmdLine", cmdLineParameters)
Finally
If (Not process Is Nothing) Then
process.Dispose()
End If
End Try
End Using
Me.SetTokenValue("ProcessID", processID)
Me.SetTokenValue("FileOut", stdOut)
Me.SetTokenValue("ExitCode", exitCode)
End Sub
End Class
End Namespace
And the script from PDFRun.bat file to work as an intermediary between the executable console app and Workflow:
CALL "C:\PDFEncrypt\PDFEncrypt.exe" %1 %2