Forum Discussion

Todd351's avatar
Todd351
Occasional Contributor
3 years ago

PDF.ConvertToText

I have a standard PDF that I use as my base line PDF. My application creates a new PDF to compare it to. Sometimes but not always when I use the PDF.ConvertToText method, the actual text is not the same. The only difference that I can see when I look at the 2 PDF's are the dates and times on them. Everything else is exactly the same.

I use this method:

var regEx = /\d{1,2}\/\d{1,2}\/\d{4}/gm;

// using re.sub method to replace dates with a constant str
str1 = str1.replace(regEx, "<ignore_date>")

to replace the dates & times in text.

// time regex
regEx = /\d{1,2}:\d{1,2}:\d{1,2}\s((AM)|(PM))/gm;

// using re.sub method to replace times with a constant str
str1 = str1.replace(regEx, "<ignore_time>")
str2 = str2.replace(regEx, "<ignore_time>")

to replace the dates & times.

 

No RepliesBe the first to reply