Hello ,
I need to develop a script .net that can parse a pdf attachement on WorkflowGen.
Any helps please ?
I decelopped this code but i use external librairy so i’m not sure that is will work on My WorkflowGen
Thanx
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PDFPARSER
{
class Program
{
static void Main(string[] args)
{
String path = @“C:\Users\hazouzi\Desktop\docs rh\WELCOME BOOK_stagiaire.pdf”;
var a = ExtractTextFromPdf(path);
var b = a.ToString().Contains(“Refraining from cluttering the work”);
if (b == true)
{
var c = a.IndexOf(“Refraining from cluttering the work”);
}
}
public static string ExtractTextFromPdf(string path)
{
using (PdfReader reader = new PdfReader(path))
{
StringBuilder text = new StringBuilder();
for (int i = 1; i <= reader.NumberOfPages; i++)
{
text.Append(PdfTextExtractor.GetTextFromPage(reader, i));
}
return text.ToString();
}
}
}
}