You are viewing limited content. For full access, please sign in.

Question

Question

Using PDF Sharp in an Workflow Script Activity

asked on December 31, 2019 Show version history

Hi, I'm trying to accomplish the following with a workflow script activity:

Using PDFSharp I want to add an image to a pdf (in this case a signature). The signature image is captured in Forms. Once the form is submitted I want to run this workflow which will use the process variable to fill out a pdf. Once the pdf is filled out, use the script activity to add the signature image. 

I have a template of the code using PDF to accomplish the adding of the signature image which works in  console application. The part I'm struggling with is working with the workflow script activity. I cannot for the life of me find any useful documentation or examples (for working with the script activity specifically).

Could someone show me an example of how you would grab the output entry of a search or move workflow activity? I need either a string (path) or stream to open it using PDFSharp.PdfReader(...). 

1 0

Replies

replied on December 31, 2019 Show version history

If you go to https://answers.laserfiche.com/questions/148898/Workflow-to-Export-Document-to-Windows-Folder you can see how to use a Workflow SDK Script activity to export a document to a Windows path, but you should be able to modify the code to get a stream object and bypass using temp windows documents.

1 0
replied on December 31, 2019

The SDK Script activity exposes the workflow starting entry via the BoundEntryInfo object.  Casting the BoundEntryInfo object as a DocumentInfo object will give you access to it.  You can use the Change Starting Entry activity in your workflow to change the workflow starting entry to your Find or Move entry and then access it as the BoundEntryInfo object in the SDK Script activity.

You will need to export the electronic document (pdf) attached to the BoundEntryInfo object from the repository as a stream or local file, modify it with iTextSharp, then import that modified stream or local file back over the electronic attachment of the document in the repository.

There are several code examples of exporting and importing documents with the SDK Script activity.  You should be able to do a search on Answers for those code examples.  In order to access the export/import functionality you will need to add a reference in your script activity to the Laserfiche.DocumentServices assembly.

1 1
replied on August 12, 2021

Francisco--  I'm also interested in adding a signature from forms onto a merged pdf document.  Have you been able to get this to work?

0 0
replied on August 12, 2021

At the time of of writing I didn't quite have enough knowledge to get this to work so we decided to go a different route. However now thinking about this, I believe I have a good idea of how to make it work. If I find that my org needs this functionality again I'll revisit and update this thread. Otherwise I'll have to review on my downtime, which idk when that will be.  

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.