Page 1 of 2

Hazel finds wrong date in document

PostPosted: Fri Feb 11, 2022 8:45 am
by hazelcamaso
Hi

Short question:
Is there a way for Hazel to always correctly detect the last date on a page regardless of it's pattern?

Long details:
I'm trying to rename a bunch of bank documents with the "1st occurrence of a date from the end" within each document (plus reversing the date which works well). For some reason Hazel ommits exactly this occurrence and uses the 2nd from the end or the first from the beginning.

See one of the documents here:
https://ln5.sync.com/dl/59f03a660/whc4p ... c-cgxzed2u

I have tried letting Hazel to "Automatically detect date format" as well as defining the exact patterns "DD.MM.YY" or "DD.MM.YYYY". Neither brings the desired result:

"Automatic" renames to "2021-12-27" (2nd from the bottom)
"DD.MM.YY" renames to "2020-01-01" (wrong year and 1st from the beginning)
"DD.MM.YYYY" renames to 2022-01-01 (1st from the beginning)

Now the next complication: The documents use either of the two patterns DD.MM.YY and DD.MM.YYYY for the last date on the page. I therefore cannot search for DD.MM.YYYY because that wouldn't detect DD.MM.YY.

Last complication: Some documents even use "DD. Name-of-month-in-German YYYY". But we can leave that away for the moment...

Can anyone help?

Re: Hazel finds wrong date in document

PostPosted: Fri Feb 11, 2022 9:06 am
by Mr_Noodle
Try using the preview feature. You can see the contents of the document as Hazel does and see if there are any quirks there. Note that with PDFs, the order of the text in the document is arbitrary and there may be odd characters mixed in that aren't visible.

Re: Hazel finds wrong date in document

PostPosted: Fri Feb 11, 2022 9:18 am
by hazelcamaso
Thanks, looks really awkward...
This leads to the conclusion that Hazel is not capable of doing what I need. Pity. I had put a lot of hope in the purchase.

Re: Hazel finds wrong date in document

PostPosted: Mon Feb 14, 2022 9:37 am
by Mr_Noodle
Can you post the text as it appears to Hazel? I'm curious what the dates look like.

Re: Hazel finds wrong date in document

PostPosted: Mon Feb 14, 2022 9:44 am
by hazelcamaso
I had to remove references to the company but the rest looks as seen here:

https://ln5.sync.com/dl/a4a522180/b4787 ... z-dg3c6a4a

Re: Hazel finds wrong date in document

PostPosted: Tue Feb 15, 2022 9:43 am
by Mr_Noodle
Can you select that text, paste it into a text document, removing any sensitive info, and email it in to support? I want to see if there are any hidden characters that might mess things up.

Re: Hazel finds wrong date in document

PostPosted: Tue Feb 15, 2022 11:29 am
by hazelcamaso

Re: Hazel finds wrong date in document

PostPosted: Wed Feb 16, 2022 12:26 pm
by Mr_Noodle
That error at the end seems odd. I'm wondering if that's screwing things up.

Re: Hazel finds wrong date in document

PostPosted: Wed Feb 16, 2022 12:45 pm
by hazelcamaso
I've found https://github.com/endigo/flutter_pdfview/issues/7
and https://quabr.com/58806425/vim-latex-su ... sing-error
but don't know whether this helps.
Any suggestions on how to proceed?

Re: Hazel finds wrong date in document

PostPosted: Thu Feb 17, 2022 9:40 am
by Mr_Noodle
Not sure. My guess is either an error in the OS's PDF parsing or a badly formed PDF. How does it look when you open it in Preview?

Re: Hazel finds wrong date in document

PostPosted: Thu Feb 17, 2022 10:09 am
by hazelcamaso
I have opened it in about 73 different Apps up to Adobe Photoshop and Illustrator. All but two render the PDF identically: Illustrator CS6 and CC2019 cannot find two of the fonts ("Times New Roman" not embedded) and render it without most of the text.

If I open it in a text editor the full text is there:

stream
1 0 0 1 0 841.95 cm 0 0 0 rg 0 0 0 RG 56.7 -14.2 496.1 -807.9 re W n 0.867 0.867 0.867 sc 56.7 -298.6 496.1 -12.75 re f 56.7 -362.5 496.1 -12.75 re f 0.5 w 56.7 -298.85 m 552.4 -298.85 l S 56.7 -362.75 m 552.4 -362.75 l S 0 w 56.7 -400.5 m 552.35 -400.5 l S 56.7 -428.3 m 552.75 -428.3 l S 56.7 -456.55 m 552.75 -456.55 l S 56.7 -484.8 m 552.75 -484.8 l S BT 1 0 0 1 326.5 -151.55 Tm 0 0 0 sc /9 9 Tf (Inhaber:) Tj 0 -28.1 Td (Konto Nr.:) Tj 85.2 0.95 Td (XXXXXXXXXXXXX CHF) Tj 0 -13.95 Td (XXXXXXXXXXXXX) Tj -85.2 -0.95 Td (IBAN:) Tj 85.2 -13.25 Td (XXXXXXX) Tj -85.2 -0.95 Td (BIC:) Tj 0 -53.45 Td (XXXXXX, 01.01.2022) Tj ET q 56.7 -247.05 162.45 -19.95 re W n BT 1 0 0 1 56.7 -260.55 Tm /9 16 Tf (Kontoauszug) Tj ET Q BT 1 0 0 1 56.7 -292.45 Tm (30.11.2021 - 31.12.2021) Tj 448.25 0 Td (Seite 1 von 1) Tj -448.25 -15.15 Td /a 9 Tf (Ihr Konto auf einen Blick) Tj 265.4 0 Td (Belastungen) Tj 68.4 0 Td (Gutschriften) Tj 138.85 0 Td (Saldo) Tj ET q 56.7 -311.35 497 -51.15 re W n BT 1 0 0 1 56.7 -319.4 Tm /9 9 Tf (Anfangssaldo per 30.11.2021) Tj 0 -38.3 Td (Schlusssaldo per 31.12.2021) Tj 0 24.6 Td (Total Gutschriften) Tj 0 -12.9 Td (Total Belastungen) Tj 279.3 0.95 Td ( XXXXXXX) Tj 177.25 -12.65 Td ( XXXXXXXX) Tj 4.5 38.3 Td ( XXXXXX) Tj -116.1 -12.75 Td ( XXXXXXXXX) Tj ET Q BT 1 0 0 1 99.45 -371.5 Tm (Informationen) Tj -42.75 0 Td (Datum) Tj 401.35 0 Td (Valuta) Tj -67.55 0 Td (Gutschriften) Tj -67.55 0 Td (Belastungen) Tj 205.05 0 Td (Saldo) Tj -10.25 -11.8 Td /9 9 Tf ( XXXXXXXX) Tj -461.05 0 Td (30.11.21) Tj 42.6 0 Td (Saldovortrag) Tj 0 -27.8 Td (Gutschrift) Tj 302.6 0 Td ( XXXXXXXXX) Tj 111.35 0 Td ( XXXXXXXXXXX) Tj -60.7 0 Td (15.12.21) Tj -395.85 0 Td (15.12.21) Tj 42.6 -12.45 Td (1/XXXXXXXXXXXXXX) Tj 0 -15.8 Td (Administrations-) Tj 247.3 0 Td ( XXXX) Tj 166.65 0 Td ( XXXXXXXXXXXX) Tj -60.7 0 Td (31.12.21) Tj -395.85 0 Td (16.12.21) Tj 42.6 -12.45 Td (geb¸hr) Tj 0 -15.8 Td (Verg¸tung) Tj 236.7 0 Td ( XXXXXXXX) Tj 177.25 0 Td ( XXXXXXXXX) Tj -60.7 0 Td (27.12.21) Tj -395.85 0 Td (27.12.21) Tj 42.6 -12.45 Td (an XXXXXXXXXXXXX) Tj 413.05 -28.4 Td /a 9 Tf ( xXXXXXXXXXXX) Tj -455.65 -0.3 Td (31.12.21) Tj 42.6 0 Td (Schlusssaldo) Tj ET q 196.45 -764.1 247.45 -12 re W n BT 1 0 0 1 196.45 -775.25 Tm 1 0 0 sc /b 12 Tf () Tj ET Q
endstream

Re: Hazel finds wrong date in document

PostPosted: Fri Feb 18, 2022 9:52 am
by Mr_Noodle
How about Preview? I ask about that one since Hazel uses the same rendering engine.

Re: Hazel finds wrong date in document

PostPosted: Mon Feb 21, 2022 5:55 am
by hazelcamaso
Within the "73" apps mentioned was Preview in 2 versions: 9.0 and 10.1
The reason for using those is that their behaviour is different from the more recent versions, and I need certain funtions not available anymore in later breeds.

Re: Hazel finds wrong date in document

PostPosted: Mon Feb 21, 2022 9:54 am
by Mr_Noodle
If you did, then please tell me the results. Does an error show up?

Re: Hazel finds wrong date in document

PostPosted: Mon Feb 21, 2022 11:55 am
by hazelcamaso
No errors. All but Illustrator render it perfectly and the same as if printed by the bank.