From 2ed4c7b6602f2d99e3a7fc40d917e2b30e5826e7 Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Fri, 10 Jan 2025 09:45:36 +0100 Subject: [PATCH] Added option to create multiple diff (marked as experimental) Issue: #4449 --- .../Application.e4xmi | 5 + .../OSGI-INF/l10n/bundle.properties | 1 + .../OSGI-INF/l10n/bundle_cs.properties | 1 + .../OSGI-INF/l10n/bundle_da.properties | 1 + .../OSGI-INF/l10n/bundle_de.properties | 1 + .../OSGI-INF/l10n/bundle_es.properties | 1 + .../OSGI-INF/l10n/bundle_fr.properties | 3 +- .../OSGI-INF/l10n/bundle_it.properties | 1 + .../OSGI-INF/l10n/bundle_nl.properties | 1 + .../OSGI-INF/l10n/bundle_pl.properties | 1 + .../OSGI-INF/l10n/bundle_pt.properties | 1 + .../OSGI-INF/l10n/bundle_pt_BR.properties | 1 + .../OSGI-INF/l10n/bundle_ru.properties | 1 + .../OSGI-INF/l10n/bundle_sk.properties | 1 + .../OSGI-INF/l10n/bundle_zh.properties | 1 + .../OSGI-INF/l10n/bundle_zh_TW.properties | 1 + .../ui/handlers/CreateDiffFromPDFHandler.java | 91 +++++++++++++++++++ 17 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateDiffFromPDFHandler.java diff --git a/name.abuchen.portfolio.bootstrap/Application.e4xmi b/name.abuchen.portfolio.bootstrap/Application.e4xmi index 51f02caf25..ef077ef9db 100644 --- a/name.abuchen.portfolio.bootstrap/Application.e4xmi +++ b/name.abuchen.portfolio.bootstrap/Application.e4xmi @@ -69,6 +69,9 @@ + + + @@ -206,6 +209,7 @@ + @@ -312,6 +316,7 @@ + diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle.properties index 9d908282bd..69378477b2 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle.properties @@ -20,6 +20,7 @@ command.fix.restoresourceattribute = Fix: Restore 'source' attribute f command.forceClearPersistedState.name = &Debug: Reset GUI... command.forceClearPersistedState.tooltip = Portfolio Performance stores the layout and state of the opened files. This command resets the UI back to defaults, which is helpful in case of issues. command.import.name = &Import +command.import.pdf.create-diff = Debug: Create diffs from PDF... command.import.pdf.create-text = Debug: Create text from PDF... command.import.pdf.create-text.tooltip = Converts the PDF document into a plain text file. Using this file, additional PDF importers can be developed or existing ones adapted to new layouts. Portfolio Peformance uses the plain text format so that it is easier to edit out personal information such as name and address. command.import.pdf.import-pdf = PDF Bank Documents diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_cs.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_cs.properties index 29d4ed144b..110aec534b 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_cs.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_cs.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Oprava: Obnovte atribut 'zdroj' z command.forceClearPersistedState.name = &Debug: Restartovat GUI... command.forceClearPersistedState.tooltip = Portfolio Performance ukl\u00E1d\u00E1 rozlo\u017Een\u00ED a stav otev\u0159en\u00FDch soubor\u016F. Tento p\u0159\u00EDkaz obnov\u00ED v\u00FDchoz\u00ED nastaven\u00ED u\u017Eivatelsk\u00E9ho rozhran\u00ED, co\u017E je u\u017Eite\u010Dn\u00E9 v p\u0159\u00EDpad\u011B probl\u00E9m\u016F. command.import.name = &Import +command.import.pdf.create-diff = Lad\u011Bn\u00ED: Vytvo\u0159it rozd\u00EDly z PDF... command.import.pdf.create-text = Lad\u011Bn\u00ED: Vytvo\u0159it text z PDF... command.import.pdf.create-text.tooltip = P\u0159evede dokument PDF do textov\u00E9ho souboru. Pomoc\u00ED tohoto souboru lze vytvo\u0159it dal\u0161\u00ED import\u00E9ry PDF nebo p\u0159izp\u016Fsobit st\u00E1vaj\u00EDc\u00ED import\u00E9ry nov\u00FDm rozlo\u017Een\u00EDm. Portfolio Peformance pou\u017E\u00EDv\u00E1 form\u00E1t prost\u00E9ho textu, tak\u017Ee je snaz\u0161\u00ED upravovat osobn\u00ED \u00FAdaje, jako je jm\u00E9no a adresa. command.import.pdf.import-pdf = Bankovn\u00ED dokumenty PDF diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_da.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_da.properties index f543acc982..0460f69535 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_da.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_da.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Rette: Gendan 'kilde'-attribut fr command.forceClearPersistedState.name = &Fejlfind: nulstil GUI... command.forceClearPersistedState.tooltip = Portfolio Performance gemmer layoutet og tilstanden af \u200B\u200Bde \u00E5bnede filer. Denne kommando nulstiller brugergr\u00E6nsefladen tilbage til standardindstillingerne, hvilket er nyttigt i tilf\u00E6lde af problemer. command.import.name = &Import +command.import.pdf.create-diff = Fejlfind: Opret diffs fra PDF ... command.import.pdf.create-text = Fejlfind: Opret tekst fra PDF... command.import.pdf.create-text.tooltip = Konverterer PDF-dokumentet til en almindelig tekstfil. Ved hj\u00E6lp af denne fil kan yderligere PDF-import udvikles eller eksisterende tilpasses nye layouts. Portfolio Peformance bruger almindeligt tekstformat, s\u00E5 det er nemmere at redigere personlige oplysninger som navn og adresse. command.import.pdf.import-pdf = PDF Bankdokumenter diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_de.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_de.properties index df2a655a52..ac4e7d35e9 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_de.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_de.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Fix: Attribut \u201EQuelle\u201C command.forceClearPersistedState.name = &Debug: GUI zur\u00FCcksetzen... command.forceClearPersistedState.tooltip = Normalerweise merkt sich Portfolio Performance den Zustand und das Layout der ge\u00F6ffneten Dateien. Bei bestimmten Fehlersituationen kann es Sinn ergeben, den gespeicherten Zustand wieder durch den Ursprungszustand zu ersetzen. command.import.name = &Importieren +command.import.pdf.create-diff = Debug: Diffs aus PDF erstellen... command.import.pdf.create-text = Debug: Text aus PDF extrahieren... command.import.pdf.create-text.tooltip = Wandelt das PDF-Dokument in ein reines Textdokument um. Mit diesem Text k\u00F6nnen weitere PDF-Importer entwickelt oder bestehende an neue Textformate angepasst werden. Im Gegensatz zu einem PDF-Dokument k\u00F6nnen pers\u00F6nliche Daten wie Name und Adresse leichter ge\u00E4ndert werden. command.import.pdf.import-pdf = PDF-Bankdokumente diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_es.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_es.properties index bfedcac392..cb0b279865 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_es.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_es.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Reparar: restauraci\u00F3n del at command.forceClearPersistedState.name = &Depurar: reiniciar GUI... command.forceClearPersistedState.tooltip = Normalmente Portfolio Performance guarda el estado de la cartera abierta. Este comando restaura todo a la configuraci\u00F3n original. command.import.name = &Importar +command.import.pdf.create-diff = Depurar: Crear diffs desde PDF... command.import.pdf.create-text = Depurar: Crear texto desde PDF... command.import.pdf.create-text.tooltip = Convierte archivos PDF a archivos de texto plano. Con este archivo, se pueden desarollar nuevos importadores de PDF o a daptarlos a nuevos modelos. Portfolio Peformance usa el formato de texto plano de forma que sea mas f\u00E1cil filtrar informaci\u00F3n personal como nombres o direcciones. command.import.pdf.import-pdf = PDF de bancos diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_fr.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_fr.properties index 32c4c7049b..3926822bfa 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_fr.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_fr.properties @@ -17,7 +17,8 @@ command.fix.restoresourceattribute = Correctif\u00A0: restaurer l'attr command.forceClearPersistedState.name = &Debug : r\u00E9initialiser l'interface graphique... command.forceClearPersistedState.tooltip = Portfolio Performance enregistre la disposition et l'\u00E9tat des fichiers ouverts. Cette commande r\u00E9initialise l'interface utilisateur \u00E0 ses valeurs par d\u00E9faut, ce qui est utile en cas de probl\u00E8me. command.import.name = &Importer -command.import.pdf.create-text = Debug : cr\u00E9er texte \u00E0 partir d'un PDF... +command.import.pdf.create-diff = Debug : Cr\u00E9er des diff\u00E9rences \u00E0 partir de PDF... +command.import.pdf.create-text = Debug : Cr\u00E9er texte \u00E0 partir d'un PDF... command.import.pdf.create-text.tooltip = Convertit le document PDF en un fichier texte brut. En utilisant ce fichier, d'autres importateurs PDF peuvent \u00EAtre d\u00E9velopp\u00E9s, ou ceux existants adapt\u00E9s \u00E0 de nouvelles mises en page. Portfolio Peformance utilise le format de texte brut pour faciliter la modification des informations personnelles telles que le nom et l'adresse. command.import.pdf.import-pdf = Documents bancaires PDF command.import.xml.ib = Interactive Brokers: Activit\u00E9 Flex Query diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_it.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_it.properties index 7204c3ba21..dfede03f52 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_it.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_it.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Correzione: ripristina l'attribut command.forceClearPersistedState.name = &Debug: reinizializza interfaccia grafica... command.forceClearPersistedState.tooltip = Portfolio Performance memorizza il layout e lo stato dei file aperti. Questo comando ripristina l'interfaccia utente ai valori predefiniti, il che \u00E8 utile in caso di problemi. command.import.name = &Importa +command.import.pdf.create-diff = Debug: Creare differenze da PDF... command.import.pdf.create-text = Debug: Crea testo da PDF... command.import.pdf.create-text.tooltip = Converte il documento PDF in un file di testo semplice. Utilizzando questo file, importatori PDF aggiuntivi possono essere sviluppati, o quelli esistenti possono essere adattati a nuovi layout. Portfolio Performance usa il formato di testo in modo da facilitare la modificare di informazioni personali come nome e indirizzo. command.import.pdf.import-pdf = Documenti bancari PDF diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_nl.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_nl.properties index bb7e886565..487644b87e 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_nl.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_nl.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Fix: Het transactiekenmerk 'Bron' command.forceClearPersistedState.name = User interface naar standaardinstellingen herstellen... command.forceClearPersistedState.tooltip = Vanuit de standaard bewaart Portfolio Performance de lay-out \u00E9n de status van eenmaal geopende bestanden. Met deze opdracht wordt de layout van de gebruikersinterface hersteld naar de standaardinstellingen. command.import.name = &Importeren +command.import.pdf.create-diff = Debug: maak diffs van PDF... command.import.pdf.create-text = Debug: maak tekst uit PDF... command.import.pdf.create-text.tooltip = Converteert het PDF-document naar een plat tekstbestand. Met behulp van dit bestand kan een extra PDF-importer worden ontwikkeld of een bestaande worden aangepast aan nieuwe lay-outs. Portfolio Performance maakt gebruik van het platte-tekstformaat, zodat het gemakkelijker is om persoonlijke gegevens zoals naam en adres te bewerken. command.import.pdf.import-pdf = PDF-bestand (afschriften) diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pl.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pl.properties index 718a375fd3..68e8aa6f99 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pl.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pl.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Poprawka: przywr\u00F3\u0107 atry command.forceClearPersistedState.name = &Debugowanie: Zresetuj GUI... command.forceClearPersistedState.tooltip = Portfolio Performance przechowuje uk\u0142ad i stan otwartych plik\u00F3w. To polecenie resetuje interfejs u\u017Cytkownika do ustawie\u0144 domy\u015Blnych, co jest pomocne w przypadku problem\u00F3w. command.import.name = &Import +command.import.pdf.create-diff = Debugowanie: tworzenie r\u00F3\u017Cnic z PDF... command.import.pdf.create-text = Debugowanie: utw\u00F3rz tekst z pliku PDF ... command.import.pdf.create-text.tooltip = Konwertuje dokument PDF na zwyk\u0142y plik tekstowy. Korzystaj\u0105c z tego pliku, mo\u017Cna opracowa\u0107 dodatkowy importer PDF lub dostosowa\u0107 istniej\u0105ce do nowych uk\u0142ad\u00F3w. Portfolio Peformance u\u017Cywa formatu zwyk\u0142ego tekstu, dzi\u0119ki czemu \u0142atwiej jest edytowa\u0107 dane osobowe, takie jak imi\u0119 i nazwisko oraz adres. command.import.pdf.import-pdf = Dokumenty bankowe PDF diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt.properties index 91a49f90cc..da073af6a1 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Corre\u00E7\u00E3o: restaurar o a command.forceClearPersistedState.name = &Debug: Repor a Interface Gr\u00E1fica... command.forceClearPersistedState.tooltip = Normalmente, o Portfolio Performance armazena o layout e o estado dos ficheiros abertos. Este comando rep\u00F5e o estado e o layout da Interface de Utilizador de volta ao estado original, o que pode ajudar em caso de problemas. command.import.name = &Importar +command.import.pdf.create-diff = Debug: Criar diffs a partir de PDF... command.import.pdf.create-text = Debug: Crie texto de PDF... command.import.pdf.create-text.tooltip = Converte o documento PDF num ficheiro de texto. Com esse ficheiro, \u00E9 poss\u00EDvel desenvolver um importador de PDF adicional ou adaptar os existentes para novos layouts. O Portfolio Performance usa o formato de texto sem formata\u00E7\u00E3o para facilitar a edi\u00E7\u00E3o de informa\u00E7\u00F5es pessoais, como nome e endere\u00E7o. command.import.pdf.import-pdf = PDF Documentos banc\u00E1rios diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt_BR.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt_BR.properties index 1134a9b61e..470f191b78 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt_BR.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_pt_BR.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Corre\u00E7\u00E3o: restaurar o a command.forceClearPersistedState.name = &Debugar: Resetar a Interface Gr\u00E1fica... command.forceClearPersistedState.tooltip = Normalmente o Portfolio Performance armazena o layout e o estado dos arquivos abertos. Este comando reseta o layout da Interface Gr\u00E1fica ao estado padr\u00E3o, o que pode ajudar em caso de problemas. command.import.name = &Importar +command.import.pdf.create-diff = Depurar: Criar diffs a partir de PDF... command.import.pdf.create-text = Debugar: Criar texto do PDF... command.import.pdf.create-text.tooltip = Converte o documento PDF em um arquivo de texto. Com esse arquivo, \u00E9 poss\u00EDvel desenvolver um importador de PDF adicional ou adaptar os existentes para novos layouts. O Portfolio Performance usa o formato de texto sem formata\u00E7\u00E3o para facilitar a edi\u00E7\u00E3o de informa\u00E7\u00F5es pessoais, como nome e endere\u00E7o. command.import.pdf.import-pdf = Documentos banc\u00E1rios (PDF) diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_ru.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_ru.properties index 026aa175a0..906039ca1a 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_ru.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_ru.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = \u0418\u0441\u043F\u0440\u0430\u0 command.forceClearPersistedState.name = &\u041E\u0442\u043B\u0430\u0434\u043A\u0430: \u0441\u0431\u0440\u043E\u0441\u0438\u0442\u044C GUI... command.forceClearPersistedState.tooltip = Portfolio Performance \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442 \u043C\u0430\u043A\u0435\u0442 \u0438 \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0445 \u0444\u0430\u0439\u043B\u043E\u0432. \u042D\u0442\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E, \u0447\u0442\u043E \u043F\u043E\u043B\u0435\u0437\u043D\u043E \u0432 \u0441\u043B\u0443\u0447\u0430\u0435 \u0432\u043E\u0437\u043D\u0438\u043A\u043D\u043E\u0432\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0431\u043B\u0435\u043C. command.import.name = &\u0418\u043C\u043F\u043E\u0440\u0442 +command.import.pdf.create-diff = \u041E\u0442\u043B\u0430\u0434\u043A\u0430: \u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u043B\u0438\u0447\u0438\u0439 \u0438\u0437 PDF... command.import.pdf.create-text = \u041E\u0442\u043B\u0430\u0434\u043A\u0430: \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0442\u0435\u043A\u0441\u0442\u0430 \u0438\u0437 PDF... command.import.pdf.create-text.tooltip = \u041F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442 PDF \u0432 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439 \u0444\u0430\u0439\u043B. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044F \u044D\u0442\u043E\u0442 \u0444\u0430\u0439\u043B, \u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0438\u043C\u043F\u043E\u0440\u0442\u0435\u0440 PDF \u0438\u043B\u0438 \u0430\u0434\u0430\u043F\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043A \u043D\u043E\u0432\u044B\u043C \u043C\u0430\u043A\u0435\u0442\u0430\u043C. Portfolio Peformance \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u0440\u043E\u0441\u0442\u043E\u0439 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442, \u0447\u0442\u043E\u0431\u044B \u0431\u044B\u043B\u043E \u043B\u0435\u0433\u0447\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043B\u0438\u0447\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E, \u0442\u0430\u043A\u0443\u044E \u200B\u200B\u043A\u0430\u043A \u0438\u043C\u044F \u0438 \u0430\u0434\u0440\u0435\u0441. command.import.pdf.import-pdf = \u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B \u0432 PDF diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_sk.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_sk.properties index 7a5d1d846b..fbf97f3f7d 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_sk.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_sk.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = Oprava: Obnovte atrib\u00FAt \u20 command.forceClearPersistedState.name = &Debug: Re\u0161tartova\u0165 grafick\u00E9 rozhranie... command.forceClearPersistedState.tooltip = Portf\u00F3lio Performance uklad\u00E1 rozlo\u017Eenie a stav otvoren\u00FDch s\u00FAborov. Tento pr\u00EDkaz obnov\u00ED predvolen\u00E9 nastavenia pou\u017E\u00EDvate\u013Esk\u00E9ho rozhrania, \u010Do je u\u017Eito\u010Dn\u00E9 v pr\u00EDpade probl\u00E9mov. command.import.name = &Import +command.import.pdf.create-diff = Ladenie: Vytv\u00E1ra\u0165 rozdiely z PDF... command.import.pdf.create-text = Ladenie: Vytvori\u0165 text z PDF... command.import.pdf.create-text.tooltip = Prevedie dokument PDF na oby\u010Dajn\u00FD textov\u00FD s\u00FAbor. Pomocou tohto s\u00FAboru mo\u017Eno vytvori\u0165 \u010Fal\u0161ie import\u00E9ry PDF alebo prisp\u00F4sobi\u0165 existuj\u00FAce import\u00E9ry nov\u00FDm rozlo\u017Eeniam. Portfolio Peformance pou\u017E\u00EDva form\u00E1t oby\u010Dajn\u00E9ho textu, tak\u017Ee je jednoduch\u0161ie upravova\u0165 osobn\u00E9 \u00FAdaje, ako je meno a adresa. command.import.pdf.import-pdf = Bankov\u00E9 dokumenty vo form\u00E1te PDF diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh.properties index f316503ffc..dd04e81885 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = \u4FEE\u590D\uFF1A\u4ECE\u5176\u4 command.forceClearPersistedState.name = &\u8C03\u8BD5\uFF1A\u91CD\u7F6E GUI... command.forceClearPersistedState.tooltip = Portfolio Performance \u4F1A\u4FDD\u5B58\u5DF2\u6253\u5F00\u6587\u4EF6\u7684\u5E03\u5C40\u4E0E\u72B6\u6001\u3002\n\u6B64\u547D\u4EE4\u5C06\u91CD\u7F6E UI\uFF0C\u4EE5\u4FBF\u89E3\u51B3\u95EE\u9898\u3002 command.import.name = &\u5BFC\u5165 +command.import.pdf.create-diff = \u8C03\u8BD5\uFF1A\u4ECEPDF\u521B\u5EFA\u5DEE\u5F02\u2026\u2026 command.import.pdf.create-text = \u8C03\u8BD5\uFF1A\u4ECE PDF \u4E2D\u521B\u5EFA\u6587\u672C... command.import.pdf.create-text.tooltip = \u5C06 PDF \u6587\u4EF6\u8F6C\u6362\u4E3A\u7EAF\u6587\u672C\u6587\u4EF6\u3002\u6B64\u6587\u4EF6\u53EF\u7528\u4E8E\u5F00\u53D1\u65B0 PDF \u5BFC\u5165\u5668\u6216\u8C03\u6574\u5DF2\u6709\u5BFC\u5165\u5668\u4EE5\u9002\u914D\u65B0\u5E03\u5C40\u3002Portfolio Perfomance \u4F7F\u7528\u7EAF\u6587\u672C\u683C\u5F0F\uFF0C\u4EE5\u4FBF\u6392\u9664\u4E2A\u4EBA\u4FE1\u606F\uFF0C\u4F8B\u5982\u59D3\u540D\u4E0E\u5730\u5740\u3002 command.import.pdf.import-pdf = PDF \u94F6\u884C\u6587\u4EF6 diff --git a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh_TW.properties b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh_TW.properties index 0648a0d4e7..69c41b154c 100644 --- a/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh_TW.properties +++ b/name.abuchen.portfolio.bootstrap/OSGI-INF/l10n/bundle_zh_TW.properties @@ -16,6 +16,7 @@ command.fix.restoresourceattribute = \u4FEE\u6B63\uFF1A\u5F9E\u5176\u4 command.forceClearPersistedState.name = &\u9664\u87F2\uFF1A\u91CD\u7F6E\u4ECB\u9762 command.forceClearPersistedState.tooltip = Portfolio Performance\u5B58\u5132\u5DF2\u6253\u958B\u6587\u4EF6\u7684\u4F48\u5C40\u548C\u72C0\u614B\u3002\u6B64\u6307\u4EE4\u5C07\u5C07UI\u91CD\u8A2D\u70BA\u9810\u8A2D\u503C\uFF0C\u5728\u51FA\u73FE\u554F\u984C\u6642\u6216\u6709\u5E6B\u52A9\u3002 command.import.name = &\u532F\u5165 +command.import.pdf.create-diff = \u8ABF\u8A66\uFF1A \u5F9E PDF \u5EFA\u7ACB\u5DEE\u7570... command.import.pdf.create-text = \u9664\u932F\uFF1A\u5F9E PDF \u5EFA\u7ACB\u6587\u672C... command.import.pdf.create-text.tooltip = \u5C07PDF\u6587\u4EF6\u8F49\u63DB\u70BA\u7D14\u6587\u672C\u6587\u4EF6\u3002\u4F7F\u7528\u6B64\u6587\u4EF6\uFF0C\u53EF\u4EE5\u958B\u767C\u5176\u4ED6\u7684PDF\u5C0E\u5165\u5668\uFF0C\u6216\u8005\u5C07\u73FE\u6709\u5C0E\u5165\u5668\u9069\u61C9\u65B0\u7684\u7248\u9762\u8A2D\u8A08\u3002Portfolio Performance \u4F7F\u7528\u7D14\u6587\u672C\u683C\u5F0F\uFF0C\u4EE5\u4FBF\u66F4\u5BB9\u6613\u7DE8\u8F2F\u500B\u4EBA\u4FE1\u606F\uFF0C\u4F8B\u5982\u59D3\u540D\u548C\u5730\u5740\u3002 command.import.pdf.import-pdf = PDF \u9280\u884C\u6587\u4EF6 diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateDiffFromPDFHandler.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateDiffFromPDFHandler.java new file mode 100644 index 0000000000..a28c3d4b1e --- /dev/null +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/CreateDiffFromPDFHandler.java @@ -0,0 +1,91 @@ +package name.abuchen.portfolio.ui.handlers; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.stream.Collectors; + +import jakarta.inject.Named; + +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.basic.MPart; +import org.eclipse.e4.ui.services.IServiceConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; + +import com.github.difflib.DiffUtils; +import com.github.difflib.UnifiedDiffUtils; + +import name.abuchen.portfolio.datatransfer.pdf.PDFInputFile; +import name.abuchen.portfolio.ui.Messages; +import name.abuchen.portfolio.ui.PortfolioPlugin; +import name.abuchen.portfolio.ui.dialogs.DisplayTextDialog; + +public class CreateDiffFromPDFHandler +{ + @SuppressWarnings("nls") + @Execute + public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, + @Named(IServiceConstants.ACTIVE_SHELL) Shell shell) throws IOException + { + FileDialog fileDialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); + fileDialog.setText(Messages.PDFImportDebugTextExtraction); + fileDialog.setFilterNames(new String[] { Messages.PDFImportFilterName }); + fileDialog.setFilterExtensions(new String[] { "*.pdf;*.PDF" }); //$NON-NLS-1$ + fileDialog.open(); + + String[] filenames = fileDialog.getFileNames(); + + if (filenames.length == 0) + return; + + var count = 0; + var diff = new StringBuilder(); + + for (String filename : filenames) + { + File file = new File(fileDialog.getFilterPath(), filename); + PDFInputFile inputFile = new PDFInputFile(file); + + try + { + + // create text from PDF + inputFile.convertPDFtoText(); + var extractedText = inputFile.getText(); + var pdfBoxVersion = inputFile.getPDFBoxVersion(); + + // check if the extracted text changed with the PDFBox version + inputFile.convertLegacyPDFtoText(); + var legacyText = inputFile.getText(); + var legacyPdfBoxVersion = inputFile.getPDFBoxVersion(); + var isDifferent = !extractedText.equals(legacyText); + + if (isDifferent) + { + count++; + + var patch = DiffUtils.diff(legacyText, extractedText, null); + var unifiedDiff = UnifiedDiffUtils.generateUnifiedDiff(legacyPdfBoxVersion, pdfBoxVersion, + Arrays.asList(legacyText.split("\n")), patch, 0); + + diff.append(inputFile.getName()).append("\n\n") + .append(unifiedDiff.stream().collect(Collectors.joining("\n"))).append("\n\n\n"); + } + } + catch (IOException e) + { + diff.append(inputFile.getName()).append("\n\n").append(e.getMessage()).append("\n\n\n"); + PortfolioPlugin.log(e); + } + } + + diff.append("\n\n").append(count).append(" of ").append(filenames.length) + .append(" documents show a difference."); + + DisplayTextDialog dialog = new DisplayTextDialog(shell, null, diff.toString()); + dialog.setDialogTitle(Messages.PDFImportDebugTextExtraction); + dialog.open(); + } +}