I am in the middle of trying to write a basic script to convert a PDF to base64 using examples from Answers. I have gotten this far where the build runs clean, but when I execute the workflow it says the entry point can't be found.
The problem is with the line of code docExporter.ExportElecDoc(LFDoc, MS); near the bottom of the script. I am wondering if this is because I am trying to pass a DocumentInfo to the ExportElecDoc method which does not accept this type. Yet others are successfully doing it this way.
namespace WorkflowActivity.Scripting.SDKScript
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Laserfiche.RepositoryAccess;
using Laserfiche.DocumentServices;
/// <summary>
/// Provides one or more methods that can be run when the workflow scripting activity is performed.
/// </summary>
public class Script1 : RAScriptClass110
{
/// <summary>
/// This method is run when the activity is performed.
/// </summary>
protected override void Execute()
{
// Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
String base64String = "test";
// Get DocumentInfo object
using (DocumentInfo doc = (DocumentInfo)BoundEntryInfo)
{
base64String = ExportElectronicToBase64(doc);
}
SetTokenValue("base64String", base64String);
}
private String ExportElectronicToBase64(DocumentInfo LFDoc)
{
string base64 = null;
DocumentExporter docExporter = new DocumentExporter();
using (System.IO.MemoryStream MS = new System.IO.MemoryStream())
{
docExporter.ExportElecDoc(LFDoc, MS);
base64 = "test";
//Convert.ToBase64String(MS.ToArray());
}
return base64;
}
}
}