- TRIAS Anpassung Rechnung für Haushaltshilfe - Bugfix Löschen von ServiceRecords ohne Unterschrift
1186 lines
46 KiB
C#
1186 lines
46 KiB
C#
using BeWo.Data;
|
|
using BS.Shared.DataContracts;
|
|
using DevExpress.Pdf;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.Service.Import.Perseh
|
|
{
|
|
public class PersehReader
|
|
{
|
|
public HilfeplanImportDC ReadPdfDocument(byte[] daten)
|
|
{
|
|
HilfeplanImportDC result = new HilfeplanImportDC();
|
|
result.Gruppen = new List<HilfeplanImportItemDC>();
|
|
result.Ziele = new List<HilfeplanImportZielDC>();
|
|
|
|
|
|
var tenant = MultitenancyOperationContextExt.Current?.Tenant;
|
|
if ("9876543210".Equals(tenant)) // || "demo".Equals(tenant))
|
|
{
|
|
//Hack für Simpsons DB um die Präsi zu vereinfachen
|
|
|
|
var gruppe1 = new HilfeplanImportItemDC { Label = "Stammdaten", Items = new List<HilfeplanImportItemDC>() };
|
|
gruppe1.Items.Add(new HilfeplanImportItemDC { Label = "Name", Content = "Ned Flanders", FieldName = "LastnameFirstname" });
|
|
gruppe1.Items.Add(new HilfeplanImportItemDC { Label = "Geburtsdatum", Content = "09.11.2015", FieldName = "Birthdate" });
|
|
gruppe1.Items.Add(new HilfeplanImportItemDC { Label = "GP-Nummer/Az", Content = "123456789", FieldName = "CustomerReferenceNumber" });
|
|
result.Gruppen.Add(gruppe1);
|
|
//result.Ziele.Add(CreateZiel(
|
|
// "Lebensbereich Bedeutende Lebensbereiche",
|
|
// "Ich entwickle eine berufliche Perspektive.",
|
|
// "1. Motivierende Gesprächsführung zur Auseinandersetzung mit beruflicher Zukunft."));
|
|
|
|
result.Ziele.Add(CreateZiel("Lebensbereich Lernen und Wissensanwendung",
|
|
"Ich treffe selbstbestimmt Entscheidungen und setze diese in die Tat um.",
|
|
"1. Reflektierende Gespräche führen.\r\n2. Anleitung: Eine Liste mit Tätigkeiten erstellen die förderlich sind.\r\n3. Reflektion welche Handlung in welchem Moment förderlich oder hilfreich ist.\r\n4. Bestärken und loben wenn Entscheidungen selbstständig getroffen und umgesetzt wurden.\r\n5. Motivieren selbstständig Entscheidungen zu treffen."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Allgemeine Aufgaben und Anforderungen",
|
|
"Ich entwickle Strategien zur Stressbewältigung.",
|
|
"1. Krisenplan und Krisenintervention\r\n2. Anleitung Stress frühzeitig zu erkennen um einer Krise vorzubeugen.\r\n3. Herausarbeiten von stressreduzierenden Aktivitäten/Beschäftigungen.\r\n4. Reflektion Anwendung der Strategien.\r\n5. Positive Bestärkung bei Erreichen von kleinsten Zielen."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Selbstversorgung",
|
|
"Ich möchte mich gesünder ernähren und mein Gewicht reduzieren.",
|
|
"1. Klare Regeln und Absprachen bei welchem Gewicht welche Maßnahme erfolgt.\r\n2. Kontinuierliche Annäherung und Auseinandersetzung mit dem Thema Ernährung.\r\n3. Niedrigschwelligen Standard erarbeiten und halten."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Selbstversorgung",
|
|
"Ich bereite mir regelmäßig mich selbst eine Mahlzeit zu.",
|
|
"1. Motivieren, Anleiten, Unterstützung und Beratung.\r\n2. Begleitung zu Einkäufen.\r\n3. Planung und Betreuung bei der Umsetzung.\r\n4. Überprüfung ob die Umsetzung klappt."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Häusliches Leben",
|
|
"Ich finde eine eigene Wohnung.",
|
|
"1. Anleitung, Beratung, Motivation und Unterstützung bei der Wohnungssuche.\r\n2. Gemeinsame Planung des Umzuges bzw. Einzuges.\r\n3. Begleitung zu Besichtigungsterminen.\r\n4. Unterstützung, Beratung und Anleitung bei der Beschaffung des Mobiliars.\r\n5.Unterstützung, Anleitung bei Renovierungs- oder Restaurierungsarbeiten."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Häusliches Leben",
|
|
"Ich entwickele einen Putzplan und halte meine Wohnung sauber.",
|
|
"1. Unterstützung bei der Entwicklung eines Haushaltsplans.\r\n2. Erarbeitung und Implementierung eines Putzplans.\r\n3. Motivierende Gesprächsführung und Anleitung.\r\n4. Wenn benötigt, anfängliche Unterstützung.\r\n5. Reflektieren was gut funktioniert und was nicht gelingt."));
|
|
|
|
result.Ziele.Add(CreateZiel(
|
|
"Lebensbereich Bedeutende Lebensbereiche",
|
|
"Ich entwickle eine berufliche Perspektive.",
|
|
"1. Motivierende Gesprächsführung zur Auseinandersetzung mit beruflicher Zukunft.\r\n2. Unterstützung bei der Anbindung an hilfreiche Stellen, Behördenangeboten"));
|
|
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using (var processor = new PdfDocumentProcessor())
|
|
{
|
|
using (var ms = new MemoryStream(daten))
|
|
{
|
|
processor.LoadDocument(ms);
|
|
|
|
|
|
var pdfText = processor.Text;
|
|
|
|
|
|
var customerGruppe = ErstelleKlientenStammdatenGruppe(pdfText);
|
|
|
|
if (customerGruppe == null)
|
|
{
|
|
customerGruppe = ErstelleGruppeMitNamenUndAktenzeichen(pdfText);
|
|
}
|
|
if (customerGruppe != null)
|
|
{
|
|
result.Gruppen.Add(customerGruppe);
|
|
}
|
|
|
|
result.Ziele = ErstelleAlleZiele(pdfText);
|
|
if (result.Ziele.Count == 0) // Keine Ziele gefunden, versuche andere PDF Version
|
|
{
|
|
result.Ziele = ErstelleAlleZiele2(processor);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
private HilfeplanImportZielDC CreateZiel(string bereich, string ziel, string massnahme)
|
|
{
|
|
var z = new HilfeplanImportZielDC { Bereich = bereich, ZielName = ziel, DoImport = true};
|
|
z.Massnahmen = new List<HilfeplanImportZielDC>();
|
|
z.Massnahmen.Add(new HilfeplanImportZielDC { ZielName = massnahme, DoImport = true });
|
|
return z;
|
|
}
|
|
|
|
private void ReplaceContent(HilfeplanImportItemDC sd, string fieldname, string content)
|
|
{
|
|
if (sd.Items != null)
|
|
{
|
|
var item = sd.Items.FirstOrDefault(i => i.FieldName == fieldname);
|
|
if (item != null)
|
|
{
|
|
item.Content = content;
|
|
}
|
|
}
|
|
}
|
|
|
|
private IList<HilfeplanImportZielDC> ErstelleAlleZiele(string pdfText)
|
|
{
|
|
var ziele = new List<HilfeplanImportZielDC>();
|
|
//Suche Zeile "Zielplanung". So beginnt hinten im Dokument der Bereich mit der Zusammenfassung der Ziele
|
|
|
|
var zeilen = pdfText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
var startIdx = -1;
|
|
var endIdx = -1;
|
|
var uebersichtLeistungsplanungIdx = -1;
|
|
var gesamtUebersichtIdx = -1;
|
|
var zielplanungStart = -1;
|
|
var lastLebensbereichIdx = -1;
|
|
|
|
StringBuilder gesamtTextMitZielen = new StringBuilder();
|
|
|
|
for (int i = zeilen.Length - 1; i >= 0; i--)
|
|
{
|
|
var z = zeilen[i];
|
|
|
|
if (z == "Zielplanung")
|
|
{
|
|
zielplanungStart = i;
|
|
startIdx = i;
|
|
}
|
|
if (z.StartsWith("Übersicht der Leistungsplanung "))
|
|
{
|
|
uebersichtLeistungsplanungIdx = i;
|
|
}
|
|
if (z.StartsWith("Lebensbereich ") && lastLebensbereichIdx == -1)
|
|
{
|
|
lastLebensbereichIdx = i;
|
|
}
|
|
if (z.StartsWith("Gesamtübersicht Stunden pro Woche"))
|
|
{
|
|
gesamtUebersichtIdx = i;
|
|
}
|
|
}
|
|
|
|
endIdx = uebersichtLeistungsplanungIdx;
|
|
if (lastLebensbereichIdx > endIdx && gesamtUebersichtIdx > lastLebensbereichIdx)
|
|
{
|
|
endIdx = gesamtUebersichtIdx;
|
|
}
|
|
else
|
|
{
|
|
endIdx = zeilen.Length - 1;
|
|
}
|
|
|
|
//if (endIdx < startIdx)
|
|
//{
|
|
// for (int i = zeilen.Length - 1; i >= 0; i--)
|
|
// {
|
|
// var z = zeilen[i];
|
|
// if (z.StartsWith("Gesamtübersicht Stunden pro Woche"))
|
|
// {
|
|
// endIdx = i;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
|
|
if (startIdx >= 0)
|
|
{
|
|
for (int i = startIdx; i < endIdx; i++)
|
|
{
|
|
gesamtTextMitZielen.AppendLine(zeilen[i]);
|
|
}
|
|
zeilen = gesamtTextMitZielen.ToString().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
startIdx = 0;
|
|
while (startIdx >= 0)
|
|
{
|
|
var ta = TextAbschnittReader.LeseBisText(zeilen, startIdx, "Lebensbereich ", true, false, false);
|
|
if (ta.Success)
|
|
{
|
|
ziele.AddRange(ErstelleBereichMitZielen(zeilen, ta));
|
|
startIdx = ta.ZeilenIndex + 1;
|
|
}
|
|
else
|
|
{
|
|
startIdx = -1;
|
|
}
|
|
|
|
}
|
|
}
|
|
if (zielplanungStart >= 0)
|
|
{
|
|
ErstelleMassnahmen(pdfText, zielplanungStart, ziele);
|
|
}
|
|
return ziele;
|
|
|
|
}
|
|
|
|
private IList<HilfeplanImportZielDC> ErstelleAlleZiele2(PdfDocumentProcessor processor)
|
|
{
|
|
var ziele = new List<HilfeplanImportZielDC>();
|
|
|
|
var bereiche = LeseBereicheMitZielenUndMassnahmen(processor);
|
|
|
|
|
|
foreach (var bereich in bereiche)
|
|
{
|
|
ziele.AddRange(LeseZieleUndMassnahmenAusBereich(bereich));
|
|
}
|
|
|
|
return ziele;
|
|
|
|
}
|
|
|
|
private IList<HilfeplanImportZielDC> LeseZieleUndMassnahmenAusBereich(BereichMitZielenUndMassnahmen bereich)
|
|
{
|
|
var ziele = new List<HilfeplanImportZielDC>();
|
|
|
|
if (!String.IsNullOrEmpty(bereich.Lebensbereich) && !String.IsNullOrEmpty(bereich.Ziele))
|
|
{
|
|
var zeilen = bereich.Ziele.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).Where(z => z != "Handlungsziele" && z != "Maßnahmeplanung" && !IgnoriereZeile(z)).ToList();
|
|
|
|
|
|
HilfeplanImportZielDC ziel = null;
|
|
|
|
int index = 0;
|
|
foreach (var zeile in zeilen)
|
|
{
|
|
//Suche den Punkt, mit dem jedes Ziel anfängt. Unglücklicherweise steht das eigentliche Ziel manchmal in der Zeile vor und nach dem Punkt, so dass hier unterschieden wird, so wie in diesem Beispiel:
|
|
//
|
|
/*
|
|
-Ich möchte meine psychiatrischen Gesprächstermine bei Frau Dr. Kramer regelmäßig
|
|
•
|
|
-Ich möchte meine psychiatrischen Gesprächstermine bei Frau Dr. Kramer regelmäßig
|
|
wahrnehmen.
|
|
wahrnehmen.
|
|
• -Ich möchte verlässlicher meine fachärztlichen Kontrollen wahrnehmen.
|
|
•
|
|
• - Meinen hauswirtschaftlichen Tätigkeiten möchte ich weiterhin nachkommen.
|
|
- im Rahmen meiner ambulanten psychiatrischen Gesprächstermine werde ich meine
|
|
•
|
|
- im Rahmen meiner ambulanten psychiatrischen Gesprächstermine werde ich meine
|
|
Bedenken zur Schulmedizin und der daraus resultierenden Verhaltensweise der oft sich
|
|
Bedenken zur Schulmedizin und der daraus resultierenden Verhaltensweise der oft sich
|
|
gegen von Ärzten empfohlene medikamentöse Therapien, thematisieren.
|
|
|
|
*/
|
|
if (zeile.StartsWith("•"))
|
|
{
|
|
String trim = zeile.Replace("•", "").Trim();
|
|
|
|
String zielString = "";
|
|
if (trim.Length > 0 || index == 0)
|
|
{
|
|
//Neues Ziel in einer Zeile
|
|
zielString = trim;
|
|
ziel = new HilfeplanImportZielDC();
|
|
ziel.DoImport = true;
|
|
ziel.Bereich = bereich.Lebensbereich.Trim();
|
|
|
|
}
|
|
else if (index < zeilen.Count -1 && zeilen[index - 1].Trim().Equals(zeilen[index + 1].Trim()))
|
|
{
|
|
//Neues Ziel
|
|
zielString = zeilen[index + 1];
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(zielString))
|
|
{
|
|
ziel = new HilfeplanImportZielDC();
|
|
ziel.DoImport = true;
|
|
ziel.Bereich = bereich.Lebensbereich.Trim();
|
|
ziel.ZielName = zielString;
|
|
|
|
ziele.Add(ziel);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
bool neuesZielbeginnt = false;
|
|
if (index > 0 && index < zeilen.Count - 2 && zeilen[index].Trim().Equals(zeilen[index + 2].Trim()) && zeilen[index + 1].StartsWith("•") && zeilen[index + 1].Replace("•", "").Trim().Length == 0)
|
|
{
|
|
neuesZielbeginnt = true;
|
|
}
|
|
if (ziel != null && !neuesZielbeginnt)
|
|
{
|
|
if (!ziel.ZielName.EndsWith(zeile.Trim()))
|
|
{
|
|
ziel.ZielName += " " + zeile.Trim();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
index++;
|
|
}
|
|
|
|
|
|
index = 1;
|
|
foreach (var z in ziele)
|
|
{
|
|
LeseMassnahmenAusBereich(bereich, z, index++, ziele.Count);
|
|
}
|
|
}
|
|
|
|
return ziele;
|
|
}
|
|
|
|
private void LeseMassnahmenAusBereich(BereichMitZielenUndMassnahmen bereich, HilfeplanImportZielDC ziel, int zielIndex, int maxZiele)
|
|
{
|
|
if (!String.IsNullOrEmpty(bereich.Massnahmenplanung))
|
|
{
|
|
ziel.Massnahmen = new List<HilfeplanImportZielDC>();
|
|
|
|
var zeilenArray = bereich.Massnahmenplanung.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
var zeilen = zeilenArray.Where(z => z != "Maßnahmeplanung" && z != "Maßnahme" && z != "Leistungsplanung" && !IgnoriereZeile(z)).ToList();
|
|
|
|
var massnahmen = new List<string>();
|
|
|
|
//Aus dem Text in den Zeilen geht nicht hervor, wieviele Massnahmen insgesamt enthalten sind. Trenne daher nach Satzzeichen. (Führendes "-") und Punkt
|
|
String massnahme = "";
|
|
|
|
foreach (var item in zeilen)
|
|
{
|
|
String zeile = item.Trim();
|
|
if (zeile.StartsWith("-"))
|
|
{
|
|
if (!String.IsNullOrEmpty(massnahme))
|
|
{
|
|
massnahmen.Add(massnahme);
|
|
}
|
|
massnahme = zeile;
|
|
}
|
|
else
|
|
{
|
|
if (massnahme.Length > 0)
|
|
{
|
|
massnahme += " ";
|
|
}
|
|
massnahme += zeile;
|
|
if (zeile.EndsWith("."))
|
|
{
|
|
massnahmen.Add(massnahme);
|
|
massnahme = "";
|
|
}
|
|
}
|
|
}
|
|
if (massnahmen.Count == 0 && !String.IsNullOrEmpty(massnahme))
|
|
{
|
|
//Kein Bindestrich oder Punkt im Satz enthalten
|
|
massnahmen.Add(massnahme);
|
|
}
|
|
//Jetzt versuche anhand der Anzahl der Massnahmen die Zuordnung zu den Zielen zu erraten.
|
|
//Die Ziele werden in dieser PDF Version oben aufgelistet und die Massnahmen in deiner Tabelle darunter
|
|
|
|
int anzahlMinusTrennzeichen = massnahmen.Count(m => m.StartsWith("-"));
|
|
int anzahlPunkte = massnahmen.Count(m => m.EndsWith("."));
|
|
|
|
HilfeplanImportZielDC letztesDc = null;
|
|
int index = 1;
|
|
if (anzahlMinusTrennzeichen > 0)
|
|
{
|
|
foreach (var mZeile in massnahmen)
|
|
{
|
|
if (mZeile.StartsWith("-"))
|
|
{
|
|
letztesDc = new HilfeplanImportZielDC();
|
|
letztesDc.DoImport = true;
|
|
if (index++ == zielIndex)
|
|
{
|
|
ziel.Massnahmen.Add(letztesDc);
|
|
}
|
|
letztesDc.ZielName = mZeile;
|
|
}
|
|
else
|
|
{
|
|
if (letztesDc != null)
|
|
{
|
|
if (letztesDc.ZielName.Length > 0)
|
|
{
|
|
letztesDc.ZielName += " ";
|
|
}
|
|
|
|
letztesDc.ZielName += mZeile;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (anzahlPunkte > 0)
|
|
{
|
|
foreach (var mZeile in massnahmen)
|
|
{
|
|
if (letztesDc == null)
|
|
{
|
|
letztesDc = new HilfeplanImportZielDC();
|
|
letztesDc.DoImport = true;
|
|
letztesDc.ZielName = "";
|
|
if (index++ == zielIndex)
|
|
{
|
|
ziel.Massnahmen.Add(letztesDc);
|
|
}
|
|
}
|
|
if (mZeile.EndsWith("."))
|
|
{
|
|
if (letztesDc.ZielName.Length > 0)
|
|
{
|
|
letztesDc.ZielName += " ";
|
|
}
|
|
|
|
letztesDc.ZielName += mZeile;
|
|
|
|
letztesDc = null;
|
|
}
|
|
else
|
|
{
|
|
if (letztesDc.ZielName.Length > 0)
|
|
{
|
|
letztesDc.ZielName += " ";
|
|
}
|
|
|
|
letztesDc.ZielName += mZeile;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (var mZeile in massnahmen)
|
|
{
|
|
if (letztesDc == null)
|
|
{
|
|
letztesDc = new HilfeplanImportZielDC();
|
|
letztesDc.DoImport = true;
|
|
letztesDc.ZielName = "";
|
|
if (index++ == zielIndex)
|
|
{
|
|
ziel.Massnahmen.Add(letztesDc);
|
|
}
|
|
}
|
|
|
|
if (letztesDc.ZielName.Length > 0)
|
|
{
|
|
letztesDc.ZielName += " ";
|
|
}
|
|
|
|
letztesDc.ZielName += mZeile;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//foreach (var zeile in zeilen)
|
|
//{
|
|
// if (zeile != "Maßnahmeplanung" && zeile != "Maßnahme" && zeile != "Leistungsplanung" && !IgnoriereZeile(zeile))
|
|
// {
|
|
// if (massnahme.ZielName.Length > 0)
|
|
// {
|
|
// massnahme.ZielName += " ";
|
|
// }
|
|
// massnahme.ZielName += zeile.Trim();
|
|
// }
|
|
//}
|
|
}
|
|
}
|
|
|
|
private IList<BereichMitZielenUndMassnahmen> LeseBereicheMitZielenUndMassnahmen(PdfDocumentProcessor processor)
|
|
{
|
|
var bereiche = new List<BereichMitZielenUndMassnahmen>();
|
|
|
|
PdfDocumentArea letzterBereich = null;
|
|
letzterBereich = SucheText(processor, "Kapitel ", letzterBereich);
|
|
|
|
while (letzterBereich != null)
|
|
{
|
|
var bereich = LeseBereichMitZielenUndMassnahmen(processor, letzterBereich);
|
|
letzterBereich = null;
|
|
|
|
if (bereich != null)
|
|
{
|
|
bereiche.Add(bereich);
|
|
|
|
if (bereich.BereichEndeArea != null)
|
|
{
|
|
letzterBereich = SucheText(processor, "Kapitel ", bereich.BereichEndeArea);
|
|
}
|
|
}
|
|
}
|
|
//String gesamtText = "";
|
|
//int h = 10; //Lese Seite Zeilenweise mit Zeilenhöhe = 10 ein
|
|
|
|
//foreach (var page in processor.Document.Pages)
|
|
//{
|
|
|
|
// var left = page.CropBox.Left;
|
|
// var right = page.CropBox.Right;
|
|
// var top = page.CropBox.Top;
|
|
// var bottom = page.CropBox.Bottom;
|
|
|
|
// var opts = new PdfTextExtractionOptions();
|
|
// opts.ClipToCropBox = true;
|
|
|
|
// var abschnittTop = top;
|
|
// var abschnittBottom = top - h;
|
|
// IList<String> letzten2Zeilen = new List<String>();
|
|
// while (abschnittTop > 0)
|
|
// {
|
|
// var idx = page.GetPageIndex();
|
|
// var area = new PdfDocumentArea(idx + 1, new PdfRectangle(left, abschnittBottom, right, abschnittTop));
|
|
// String neueZeile = processor.GetText(area, opts);
|
|
|
|
// //String test0 = processor.GetText(new PdfDocumentArea(1, new PdfRectangle(left, 782, right, 792)), opts);
|
|
// //String test = processor.GetText(new PdfDocumentArea(1, new PdfRectangle(left, 772, right, 782)), opts);
|
|
// //String test2 = processor.GetText(new PdfDocumentArea(1, new PdfRectangle(left, 762, right, 772)), opts);
|
|
|
|
// var zeilen = neueZeile.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
// if (zeilen.Length > 2)
|
|
// {
|
|
// int sollteNichtSein = 0;
|
|
// }
|
|
// //Die erste Zeile wird manchmal doppelt gelesen
|
|
// foreach (var zeile in zeilen)
|
|
// {
|
|
// var zeileMitUmbruch = zeile + "\r\n";
|
|
// bool zeileVorhanden = false;
|
|
// foreach (var lz in letzten2Zeilen)
|
|
// {
|
|
// if (lz == zeileMitUmbruch)
|
|
// {
|
|
// zeileVorhanden = true;
|
|
// }
|
|
// }
|
|
|
|
// if (!zeileVorhanden)
|
|
// {
|
|
// gesamtText += zeileMitUmbruch;
|
|
|
|
// letzten2Zeilen.Add(zeileMitUmbruch);
|
|
// if (letzten2Zeilen.Count > 2)
|
|
// {
|
|
// letzten2Zeilen.RemoveAt(0);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
// abschnittTop -= (h + 1);
|
|
// abschnittBottom = abschnittTop - h;
|
|
// if (abschnittBottom < 0)
|
|
// {
|
|
// abschnittBottom = 0;
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
return bereiche;
|
|
}
|
|
|
|
private BereichMitZielenUndMassnahmen LeseBereichMitZielenUndMassnahmen(PdfDocumentProcessor processor, PdfDocumentArea kapitelStartArea)
|
|
{
|
|
var bereich = new BereichMitZielenUndMassnahmen();
|
|
bereich.Lebensbereich = processor.GetText(kapitelStartArea, DefaultExtractOptions);
|
|
var zielStartArea = SucheText(processor, "Handlungsziele", kapitelStartArea);
|
|
|
|
if (zielStartArea == null)
|
|
{
|
|
return null;
|
|
}
|
|
var massnahmenStartArea = SucheText(processor, "Maßnahmeplanung", zielStartArea);
|
|
|
|
if (massnahmenStartArea == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
var planungArea = SucheText(processor, "Leistungsplanung", massnahmenStartArea);
|
|
|
|
bereich.Ziele = LeseGesamtTextImBereich(processor, zielStartArea, massnahmenStartArea, 0, 0);
|
|
|
|
bereich.Massnahmenplanung = LeseGesamtTextImBereich(processor, massnahmenStartArea, planungArea, 0, 250);
|
|
|
|
bereich.BereichEndeArea = planungArea;
|
|
|
|
return bereich;
|
|
}
|
|
|
|
private string SucheMassnahmen(PdfDocumentProcessor processor, PdfDocumentArea zielStartArea, PdfDocumentArea massnahmenStartArea)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private string SucheZiele(PdfDocumentProcessor processor, PdfDocumentArea zielStartArea, PdfDocumentArea massnahmenStartArea)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private string LeseGesamtTextImBereich(PdfDocumentProcessor processor, PdfDocumentArea startArea, PdfDocumentArea endeArea, double left, double right)
|
|
{
|
|
int startSeite = 1;
|
|
int letzteSeite = processor.Document.Pages.Count;
|
|
|
|
if (startArea != null)
|
|
{
|
|
startSeite = startArea.PageNumber;
|
|
}
|
|
if (endeArea != null)
|
|
{
|
|
letzteSeite = endeArea.PageNumber;
|
|
}
|
|
String gesamtText = "";
|
|
for (int i = startSeite - 1; i < letzteSeite; i++)
|
|
{
|
|
var page = processor.Document.Pages[i];
|
|
|
|
double bottom = 0;
|
|
double top = page.CropBox.Top;
|
|
|
|
|
|
//Lese auf erster Seite ab StartArea Top
|
|
if (startArea != null && i == startArea.PageNumber - 1)
|
|
{
|
|
top = startArea.Area.Top;
|
|
}
|
|
//Lese auf letzter Seite bis EndeArea Bottom
|
|
if (endeArea != null && i == endeArea.PageNumber - 1)
|
|
{
|
|
bottom = endeArea.Area.Bottom;
|
|
}
|
|
var text = LeseTextAufSeite(processor, page, top, bottom, left, right);
|
|
gesamtText += text;
|
|
}
|
|
|
|
return gesamtText;
|
|
}
|
|
|
|
private PdfDocumentArea SucheText(PdfDocumentProcessor processor, String suchText, PdfDocumentArea startArea)
|
|
{
|
|
int h = 10; //Lese Seite Zeilenweise mit Zeilenhöhe = 10 ein
|
|
|
|
int startPage = 1;
|
|
if (startArea != null)
|
|
{
|
|
startPage = startArea.PageNumber;
|
|
}
|
|
for (int i = startPage - 1; i < processor.Document.Pages.Count; i++)
|
|
{
|
|
var page = processor.Document.Pages[i];
|
|
|
|
var left = page.CropBox.Left;
|
|
var right = page.CropBox.Right;
|
|
var top = page.CropBox.Top;
|
|
var bottom = page.CropBox.Bottom;
|
|
|
|
if (startArea != null && startArea.PageNumber == i + 1)
|
|
{
|
|
top = startArea.Area.Top;
|
|
}
|
|
|
|
var abschnittTop = top;
|
|
var abschnittBottom = top - h;
|
|
|
|
while (abschnittTop > 0)
|
|
{
|
|
var idx = page.GetPageIndex();
|
|
var area = new PdfDocumentArea(idx + 1, new PdfRectangle(left, abschnittBottom, right, abschnittTop));
|
|
String neueZeile = processor.GetText(area, DefaultExtractOptions);
|
|
|
|
if (neueZeile.StartsWith(suchText))
|
|
{
|
|
return area;
|
|
}
|
|
|
|
|
|
abschnittTop -= (h + 1);
|
|
abschnittBottom = abschnittTop - h;
|
|
if (abschnittBottom < 0)
|
|
{
|
|
abschnittBottom = 0;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private String LeseTextAufSeite(PdfDocumentProcessor processor, PdfPage page, double top, double bottom, double left, double right)
|
|
{
|
|
int h = 9; //Lese Seite Zeilenweise mit Zeilenhöhe = x ein
|
|
|
|
var abschnittTop = top;
|
|
var abschnittBottom = top - h;
|
|
|
|
String gesamtText = "";
|
|
|
|
String letzteZeile = "";
|
|
String letzterGesamtText = "";
|
|
|
|
var idx = page.GetPageIndex();
|
|
|
|
var pageText = processor.GetPageText(idx + 1, DefaultExtractOptions);
|
|
int anzahlPunkte = 0;
|
|
int pos = 0;
|
|
while (pageText.IndexOf("•", pos) > 0)
|
|
{
|
|
anzahlPunkte++;
|
|
pos = pageText.IndexOf("•", pos) + 1;
|
|
}
|
|
|
|
while (abschnittTop > bottom)
|
|
{
|
|
double r = right;
|
|
if (right == 0)
|
|
{
|
|
right = page.CropBox.Right;
|
|
}
|
|
|
|
var area = new PdfDocumentArea(idx + 1, new PdfRectangle(left, abschnittBottom, r, abschnittTop));
|
|
String neuerText = processor.GetText(area, DefaultExtractOptions);
|
|
|
|
|
|
if (idx == 22)
|
|
{
|
|
int test = 0;
|
|
}
|
|
//neuerText = ReplaceZielAufzaehlungszeichen(neuerText);
|
|
if (neuerText != letzterGesamtText)
|
|
{
|
|
var zeilen = neuerText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
int index = 0;
|
|
foreach (var zeile in zeilen)
|
|
{
|
|
//if (!gesamtText.EndsWith(zeile + "\r\n"))
|
|
//{
|
|
// gesamtText += zeile + "\r\n";
|
|
//}
|
|
//if (letzteZeile != zeile || (letzteZeile == "•" && zeile == "•" && zeilen.Length > 2 && index == 2))
|
|
if (letzteZeile != zeile)
|
|
{
|
|
gesamtText += zeile + "\r\n";
|
|
if (zeile.Contains("•"))
|
|
{
|
|
anzahlPunkte--;
|
|
}
|
|
// letzteZeile = "";
|
|
}
|
|
else if (letzteZeile == "•" && zeile == "•" && zeilen.Length > 2 && index == 2 && anzahlPunkte > 0)
|
|
{
|
|
//gesamtText += zeile + "\r\n";
|
|
anzahlPunkte--;
|
|
}
|
|
index++;
|
|
}
|
|
if (zeilen.Length > 0)
|
|
{
|
|
letzteZeile = zeilen[zeilen.Length - 1];
|
|
}
|
|
|
|
letzterGesamtText = neuerText;
|
|
}
|
|
else
|
|
{
|
|
int test = 0;
|
|
}
|
|
|
|
abschnittTop -= (h + 1);
|
|
abschnittBottom = abschnittTop - h;
|
|
if (abschnittBottom < bottom)
|
|
{
|
|
abschnittBottom = bottom;
|
|
}
|
|
}
|
|
|
|
return gesamtText;
|
|
}
|
|
|
|
private string ReplaceZielAufzaehlungszeichen(string neuerText)
|
|
{
|
|
//Versuche an den Stellen in dem das Aufzählungs "•" mitten im Text alleine enthalten ist, das Ziel zu erraten. Das passiert bei mehrzeiligen Zielen
|
|
var index = neuerText.IndexOf("•");
|
|
|
|
if (index > 0)
|
|
{
|
|
return "• " + neuerText.Replace("•", "").Trim();
|
|
}
|
|
|
|
return neuerText;
|
|
}
|
|
|
|
private void ErstelleMassnahmen(string pdfText, int endIndex, List<HilfeplanImportZielDC> ziele)
|
|
{
|
|
var zeilen = pdfText.ToString().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
foreach (var item in ziele)
|
|
{
|
|
item.Massnahmen = new List<HilfeplanImportZielDC>();
|
|
|
|
int zeilenIndex = 0;
|
|
foreach (var zeile in zeilen)
|
|
{
|
|
if (zeilenIndex < endIndex && zeile.StartsWith("Ziel "))
|
|
{
|
|
if (item.ZielName.StartsWith(zeile.Substring(5)))
|
|
{
|
|
int massnahmenStartIndex = -1;
|
|
var ta = TextAbschnittReader.LeseBisText(zeilen, zeilenIndex, "Beschreibung der Maßnahme", true, false, false);
|
|
if (ta.Success)
|
|
{
|
|
massnahmenStartIndex = ta.ZeilenIndex;
|
|
}
|
|
else
|
|
{
|
|
ta = TextAbschnittReader.LeseBisText(zeilen, ta.ZeilenIndex + 1, "Beschreibung der", true, false, false);
|
|
if (ta.Success)
|
|
{
|
|
var ta2 = TextAbschnittReader.LeseBisText(zeilen, ta.ZeilenIndex + 1, "Maßnahme", true, false, false);
|
|
if (ta2.Success && ta2.ZeilenIndex == ta.ZeilenIndex + 1)
|
|
{
|
|
massnahmenStartIndex = ta2.ZeilenIndex;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if (massnahmenStartIndex > 0)
|
|
{
|
|
ta = TextAbschnittReader.LeseBisText(zeilen, massnahmenStartIndex, "Wer soll das tun?", true, false, false);
|
|
|
|
if (ta.Success)
|
|
{
|
|
var text = ta.Text;
|
|
|
|
ErstelleMassnahmenFuerZiel(item, text);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
zeilenIndex++;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
public virtual void ErstelleMassnahmenFuerZiel(HilfeplanImportZielDC item, string text)
|
|
{
|
|
var zeilen = text.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
var sb = new StringBuilder();
|
|
|
|
//Entferne Zeilenumbrüche und unnötige Zeilen (wie Kopf und Fußzeilen)
|
|
//Letzte Zeile nicht mitnehmen, da steht drin "wer soll das tun?"
|
|
for (int i = 0; i < zeilen.Length - 1; i++)
|
|
{
|
|
String zeile = zeilen[i];
|
|
if (i == 0)
|
|
{
|
|
if (zeile.StartsWith("Beschreibung der Maßnahmen"))
|
|
{
|
|
zeile = zeile.Substring(26);
|
|
}
|
|
else if (zeile.StartsWith("Beschreibung der Maßnahme"))
|
|
{
|
|
zeile = zeile.Substring(25);
|
|
}
|
|
if (zeile.StartsWith("Maßnahmen"))
|
|
{
|
|
zeile = zeile.Substring(9);
|
|
}
|
|
else if (zeile.StartsWith("Maßnahme"))
|
|
{
|
|
zeile = zeile.Substring(8);
|
|
}
|
|
zeile = zeile.Trim();
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(zeile) && !IgnoriereZeile(zeile))
|
|
{
|
|
sb.Append(zeile);
|
|
sb.Append(" ");
|
|
}
|
|
}
|
|
|
|
item.Massnahmen = ErstelleMassnahmenDCs(sb.ToString());
|
|
}
|
|
|
|
public virtual IList<HilfeplanImportZielDC> ErstelleMassnahmenDCs(string text)
|
|
{
|
|
var result = new List<HilfeplanImportZielDC>();
|
|
|
|
//Finde Auflistung die mit einer Zahl und einem Punkt beginnen (1. erste Zeile, 2. zweite Zeile etc.)
|
|
if (!String.IsNullOrEmpty(text) && text.StartsWith("1. "))
|
|
{
|
|
string pattern = @"(\d+\.\s.*?)(?=\s*\d+\.\s|$)";
|
|
|
|
MatchCollection matches = Regex.Matches(text, pattern);
|
|
|
|
var sb = new StringBuilder();
|
|
foreach (var match in matches)
|
|
{
|
|
sb.AppendLine(match.ToString());
|
|
}
|
|
|
|
var massnahme = new HilfeplanImportZielDC();
|
|
massnahme.DoImport = true;
|
|
massnahme.ZielName = sb.ToString();
|
|
|
|
result.Add(massnahme);
|
|
}
|
|
if (result.Count == 0 && !String.IsNullOrEmpty(text))
|
|
{
|
|
var massnahme = new HilfeplanImportZielDC();
|
|
massnahme.DoImport = true;
|
|
massnahme.ZielName = text;
|
|
|
|
result.Add(massnahme);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
private IList<HilfeplanImportZielDC> ErstelleBereichMitZielen(string[] zeilen, TextAbschnitt ta)
|
|
{
|
|
var ziele = new List<HilfeplanImportZielDC>();
|
|
|
|
String bereich = zeilen[ta.ZeilenIndex];
|
|
int idxBereichStart = ta.ZeilenIndex + 1;
|
|
int idxBereichtEnde = zeilen.Length;
|
|
|
|
var taEnde = TextAbschnittReader.LeseBisText(zeilen, ta.ZeilenIndex + 1, "Lebensbereich ", true, false, false);
|
|
if (taEnde.Success)
|
|
{
|
|
idxBereichtEnde = taEnde.ZeilenIndex;
|
|
}
|
|
|
|
HilfeplanImportZielDC ziel = null;
|
|
for (int i = idxBereichStart; i < idxBereichtEnde; i++)
|
|
{
|
|
String zeile = zeilen[i];
|
|
if (zeile.StartsWith("Ziele • ") || zeile.StartsWith("• "))
|
|
{
|
|
ziel = new HilfeplanImportZielDC();
|
|
ziel.DoImport = true;
|
|
ziel.Bereich = bereich;
|
|
ziel.ZielName = zeile.Replace("Ziele • ", "").Replace("• ", "").Trim();
|
|
|
|
ziele.Add(ziel);
|
|
}
|
|
else if (ziel != null)
|
|
{
|
|
if (!IgnoriereZeile(zeile))
|
|
{
|
|
ziel.ZielName += " " + zeile.Trim();
|
|
ziel.ZielBeschreibung = "Beschreibung:\n" + zeile;
|
|
}
|
|
|
|
}
|
|
}
|
|
return ziele;
|
|
}
|
|
|
|
private bool IgnoriereZeile(string zeile)
|
|
{
|
|
if (zeile.StartsWith("(c) Landschaftsverband") || zeile.StartsWith("Gesprächsleitfaden - "))
|
|
{
|
|
return true;
|
|
}
|
|
if (zeile.StartsWith("V1") || zeile.StartsWith("V2") || zeile.StartsWith("V3"))
|
|
{
|
|
return true;
|
|
}
|
|
//Ignoriert das Aktenzeichen
|
|
if (StartetMitNZiffern(zeile, 10))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
//V3:
|
|
if ("Handlungsziele".Equals(zeile))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private bool StartetMitNZiffern(string zeile, int anzahlZiffern)
|
|
{
|
|
string pattern = String.Format("{0:0}", anzahlZiffern);
|
|
pattern = "\\d{" + pattern + "}";
|
|
MatchCollection matches = Regex.Matches(zeile, pattern);
|
|
|
|
if (matches.Count > 0 && matches[0].Index == 0)
|
|
{
|
|
return true;
|
|
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private HilfeplanImportItemDC ErstelleKlientenStammdatenGruppe(string pdfText)
|
|
{
|
|
if (pdfText.Contains("Individuelle Bedarfsermittlung - Element Basisdaten"))
|
|
{
|
|
var customerGruppe = new HilfeplanImportItemDC { Label = "Stammdaten", Items = new List<HilfeplanImportItemDC>() };
|
|
customerGruppe.Items = LeseKlientenStammdaten(pdfText);
|
|
|
|
return customerGruppe;
|
|
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private HilfeplanImportItemDC ErstelleGruppeMitNamenUndAktenzeichen(string pdfText)
|
|
{
|
|
String aktenzeichen = "";
|
|
String name = "";
|
|
String datum = "";
|
|
|
|
var zeilen = pdfText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
//Der Name sollte oben auf der ersten Seite stehen. Suche innerhalb der ersten 10 Zeilen danach:
|
|
var ta = TextAbschnittReader.LeseBisText(zeilen, 0, "Name ", true, false, false);
|
|
if (ta.Success && ta.ZeilenIndex <= 10)
|
|
{
|
|
|
|
var zeile = zeilen[ta.ZeilenIndex].Replace("Name ", "");
|
|
|
|
if (zeile.Contains("GP-Nr./Az. "))
|
|
{
|
|
aktenzeichen = zeile.Substring(zeile.IndexOf("GP-Nr./Az. ") + 10).Trim();
|
|
}
|
|
var pattern = @"\d{2}\.\d{2}\.\d{4}";
|
|
MatchCollection matches = Regex.Matches(zeile, pattern);
|
|
|
|
|
|
if (matches.Count > 0)
|
|
{
|
|
|
|
datum = matches[0].Value;
|
|
|
|
if (zeile.IndexOf(datum) > 0)
|
|
{
|
|
name = zeile.Substring(0, zeile.IndexOf(datum)).Trim();
|
|
}
|
|
}
|
|
}
|
|
|
|
if (String.IsNullOrEmpty(aktenzeichen))
|
|
{
|
|
var pattern = @"\d{10}";
|
|
MatchCollection matches = Regex.Matches(pdfText, pattern);
|
|
|
|
if (matches.Count > 0)
|
|
{
|
|
|
|
aktenzeichen = matches[0].Value;
|
|
}
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(aktenzeichen) || !String.IsNullOrEmpty(name) || !String.IsNullOrEmpty(datum))
|
|
{
|
|
var customerGruppe = new HilfeplanImportItemDC { Label = "Stammdaten", Items = new List<HilfeplanImportItemDC>() };
|
|
|
|
if (!String.IsNullOrEmpty(name))
|
|
{
|
|
customerGruppe.Items.Add(new HilfeplanImportItemDC { Label = "Name", FieldName = "LastnameFirstname", Content = name });
|
|
}
|
|
if (!String.IsNullOrEmpty(datum))
|
|
{
|
|
customerGruppe.Items.Add(new HilfeplanImportItemDC { Label = "Geburtsdatum", FieldName = "Birthdate", Content = datum });
|
|
}
|
|
if (!String.IsNullOrEmpty(aktenzeichen))
|
|
{
|
|
customerGruppe.Items.Add(new HilfeplanImportItemDC { Label = "GP-Nummer/Az", FieldName = "CustomerReferenceNumber", Content = aktenzeichen });
|
|
}
|
|
return customerGruppe;
|
|
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private List<HilfeplanImportItemDC> LeseKlientenStammdaten(string pdfText)
|
|
{
|
|
var liste = new List<HilfeplanImportItemDC>();
|
|
var zeilen = pdfText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
var ta = TextAbschnittReader.LeseBisText(zeilen, 0, "BEI_NRW für den Zeitraum vom ", true, false, false);
|
|
|
|
if (ta.Success)
|
|
{
|
|
var idx = ta.ZeilenIndex;
|
|
liste.Add(ErstelleStammdatenFeld("BEI_NRW für den Zeitraum vom", "ApprovalPeriod", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("GP-Nummer/Az", "CustomerReferenceNumber", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Name", "Lastname", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Vorname", "Firstname", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Titel", "Titel", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Geburtsdatum", "Birthdate", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Geschlecht", "Sex", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Nationalität", "Nationality", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Beruf", "Job", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Familienstand", "FamilyStatus", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Anzahl und Alter der Kinder", "Children", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("PLZ", "PostalCode", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Ort", "Town", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Straße", "Street", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Telefon", "Phone", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("Fax", "Fax", zeilen, idx, out idx));
|
|
liste.Add(ErstelleStammdatenFeld("E-Mail", "EMail", zeilen, idx, out idx));
|
|
}
|
|
|
|
|
|
|
|
return liste;
|
|
}
|
|
|
|
private HilfeplanImportItemDC ErstelleStammdatenFeld(string label, string fieldname, string[] zeilen, int startIndex, out int foundIdx)
|
|
{
|
|
var item = new HilfeplanImportItemDC { Label = label, FieldName = fieldname };
|
|
|
|
var ta = TextAbschnittReader.LeseBisText(zeilen, startIndex, label, true, false, false);
|
|
foundIdx = 0;
|
|
if (ta.Success)
|
|
{
|
|
item.Content = zeilen[ta.ZeilenIndex].Replace(label, "").Trim();
|
|
if (item.Label.Contains("_"))
|
|
{
|
|
item.Label = label.Replace("_", "__");
|
|
}
|
|
foundIdx = ta.ZeilenIndex;
|
|
}
|
|
return item;
|
|
}
|
|
|
|
|
|
private PdfTextExtractionOptions DefaultExtractOptions
|
|
{
|
|
get
|
|
{
|
|
var opts = new PdfTextExtractionOptions();
|
|
opts.ClipToCropBox = true;
|
|
|
|
return opts;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|