First off, those are 2 different PDF files, so it may need a different configuration based on which pdf file it is.
Is there an example or possibility for the second one to have numbers under the Discount or WHT amount columns? If not, then you might be able to just ignore those numbers.
In any case, you essentially need to create a keyword argument or variable to store either “SUM TOTAL” or “TOTALS:”, then you can split it to find the Net Amount which is the last value.
This splits by the keyword and takes (1) item, then splits by Newline and takes (0) item, then finally splits by the space and takes the Last item.
You can also do this with Regex which may or may not be simpler.
Extracting the other amounts when they are sometimes not there will be more tricky, but if all you need is the Net Amount, then I wouldn’t worry about it since the Net Amount is always the last value.
I hope this helps some.