Data.Find() not finding text

Hi All

Trying to extract some data from a PDF and its not finding it51060 INSPIRE UK Labels - Copy.pdf (46.7 KB) although I can see it there.

var consignorRefReturn,consignorLocation,consignorLocationTop;

consignorRefReturn = 'ERROR ON RECORD INVESTIGATE ’ + record.index;

consignorLocation = data.find(‘Consignor’, 0, 210);

if(consignorLocation == null)
{

consignorLocation = data.find('Sender:', 0, 210);

if(consignorLocation != null)
{
consignorLocationTop = (consignorLocation.top);
}

}
else{
consignorLocationTop = consignorLocation.top;
}

if(consignorLocation != null)
{
consignorRefReturn = data.extract(1,100,consignorLocationTop,3,“
”);
}

consignorRefReturn;
//consignorLocation;

its not finding

consignorLocation = data.find(‘Sender:’, 0, 210); the word Sender. Is there a way to alter the magic number, word spacing or line spacing it uses during the input algorithms from within with the java script of the extraction? I’m assuming that might help?

Just to add on to this, the codes looking for ‘Consignor’ as well as half the labels that are sent contain this the other half Sender. Consignor extraction is working fine. I also realise my code will need some refining :slight_smile: its just the fact its not finding ‘Sender’ at the moment thats the issue

For anyone thats interested I ended up changing

consignorLocation = data.find('Sender Ref', 0, 20);

which now finds the text - not sure why looking at only part the page finds it while, searching the whole of the page doesn’t. Guessing the PDF may have elements in the background that are interfering