mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 01:35:32 +00:00
done
This commit is contained in:
@@ -4,7 +4,6 @@ namespace HamannPrinter
|
|||||||
{
|
{
|
||||||
public class Confix
|
public class Confix
|
||||||
{
|
{
|
||||||
public bool? LettersDocx { get; set; }
|
|
||||||
public bool? VolumeDocx { get; set; }
|
public bool? VolumeDocx { get; set; }
|
||||||
public bool? RegisterDocx { get; set; }
|
public bool? RegisterDocx { get; set; }
|
||||||
public string HamannXmlPath { get; set; }
|
public string HamannXmlPath { get; set; }
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ using DocumentFormat.OpenXml.Packaging;
|
|||||||
using DocumentFormat.OpenXml.Wordprocessing;
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
using HaDocument.Interfaces;
|
using HaDocument.Interfaces;
|
||||||
using HaDocument.Models;
|
using HaDocument.Models;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Diagnostics;
|
||||||
using static HamannPrinter.Parser;
|
using static HamannPrinter.Parser;
|
||||||
using Comment = HaDocument.Models.Comment;
|
using Comment = HaDocument.Models.Comment;
|
||||||
using static HamannPrinter.Helper;
|
using static HamannPrinter.Helper;
|
||||||
@@ -35,6 +37,7 @@ namespace HamannPrinter
|
|||||||
static public int MarginTop { get; set; }
|
static public int MarginTop { get; set; }
|
||||||
//rechter Rand
|
//rechter Rand
|
||||||
static public UInt32 MarginRight { get; set; }
|
static public UInt32 MarginRight { get; set; }
|
||||||
|
static public UInt32 MarginRightColumns { get; set; }
|
||||||
//unterer Rand
|
//unterer Rand
|
||||||
static public int MarginBottom { get; set; }
|
static public int MarginBottom { get; set; }
|
||||||
// linker Rand
|
// linker Rand
|
||||||
@@ -67,9 +70,6 @@ namespace HamannPrinter
|
|||||||
// Pfad für Ausgabe der Briefe
|
// Pfad für Ausgabe der Briefe
|
||||||
static public List<string> LetterPaths { get; set; }
|
static public List<string> LetterPaths { get; set; }
|
||||||
|
|
||||||
|
|
||||||
static bool firstone = false;
|
|
||||||
|
|
||||||
public Hamann2Word(ILibrary lib, DocOptions docxOptions)
|
public Hamann2Word(ILibrary lib, DocOptions docxOptions)
|
||||||
{
|
{
|
||||||
// erzeugt neue Instanz von Hamann2Word mit den Erforderlichen Werten aus den DocOptions
|
// erzeugt neue Instanz von Hamann2Word mit den Erforderlichen Werten aus den DocOptions
|
||||||
@@ -96,6 +96,7 @@ namespace HamannPrinter
|
|||||||
SuperValue = docxOptions.SuperValue;
|
SuperValue = docxOptions.SuperValue;
|
||||||
SubValue = docxOptions.SubValue;
|
SubValue = docxOptions.SubValue;
|
||||||
Diodone = docxOptions.Diodone;
|
Diodone = docxOptions.Diodone;
|
||||||
|
MarginRightColumns = docxOptions.MarginRightColumns;
|
||||||
RegisterPaths = new List<string>();
|
RegisterPaths = new List<string>();
|
||||||
YearPaths = new List<string>();
|
YearPaths = new List<string>();
|
||||||
LetterPaths = new List<string>();
|
LetterPaths = new List<string>();
|
||||||
@@ -145,6 +146,7 @@ namespace HamannPrinter
|
|||||||
public List<XElement> HandTags { get; set; }
|
public List<XElement> HandTags { get; set; }
|
||||||
//docx Datei des Briefes
|
//docx Datei des Briefes
|
||||||
public WordprocessingDocument WordDoc { get; set; }
|
public WordprocessingDocument WordDoc { get; set; }
|
||||||
|
public bool stateFirstLine { get; set; } = true;
|
||||||
|
|
||||||
public LetterObj(string index, XElement text, Meta meta, string key, string tempDir = null)
|
public LetterObj(string index, XElement text, Meta meta, string key, string tempDir = null)
|
||||||
{
|
{
|
||||||
@@ -172,7 +174,7 @@ namespace HamannPrinter
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void Letter2Docx(LetterObj letter, bool makeVolumes = false)
|
public static void Letter2Docx(LetterObj letter)
|
||||||
{
|
{
|
||||||
/*befüllt ein LetterObj.BriefDocx mit dem "geparsten" Inhalt (xml) des Briefes*/
|
/*befüllt ein LetterObj.BriefDocx mit dem "geparsten" Inhalt (xml) des Briefes*/
|
||||||
|
|
||||||
@@ -204,11 +206,11 @@ namespace HamannPrinter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Kommentare und Varianten anhängen
|
//Kommentare und Varianten anhängen
|
||||||
AddCommentsETC(letter, makeVolumes);
|
AddCommentsETC(letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void AddCommentsETC(LetterObj letter, bool makeVolumes)
|
public static void AddCommentsETC(LetterObj letter)
|
||||||
{
|
{
|
||||||
if (letter.Tradition != null)
|
if (letter.Tradition != null)
|
||||||
{
|
{
|
||||||
@@ -273,29 +275,18 @@ namespace HamannPrinter
|
|||||||
CreateColSection(letter.WordDoc, margSingle);
|
CreateColSection(letter.WordDoc, margSingle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (makeVolumes)
|
MakeFinalPageBreak(letter);
|
||||||
{
|
|
||||||
MakeFinalPageBreak(letter);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MakeSourceSection(letter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MakeSourceSection(LetterObj letter)
|
public static void MakeSourceSection(LetterObj letter)
|
||||||
{
|
{
|
||||||
string txt = "Johann Georg Hamann: Kommentierte Briefausgabe (HKB). Hrsg. von Leonard Keidel und Janina Reibold, auf Grundlage der Vorarbeiten Arthur Henkels, unter Mitarbeit von Gregor Babelotzky, Konrad Bucher, Christian Großmann, Carl Friedrich Haak, Luca Klopfer, Johannes Knüchel, Isabel Langkabel und Simon Martens. (Heidelberg 2020ff.) URL: ";
|
string txt = "Johann Georg Hamann: Kommentierte Briefausgabe (HKB). Hrsg. von Leonard Keidel und Janina Reibold, auf Grundlage der Vorarbeiten Arthur Henkels, unter Mitarbeit von Gregor Babelotzky, Konrad Bucher, Christian Großmann, Carl Friedrich Haak, Luca Klopfer, Johannes Knüchel, Isabel Langkabel und Simon Martens. (Heidelberg 2020ff.) URL: ";
|
||||||
//Hyperlink link = new Hyperlink(new Run(new Text("www.hamann-ausgabe.de"))) { Anchor = "Hamann-Ausgabe online", DocLocation = "https://www.hamann-ausgabe.de", Id= "https://www.hamann-ausgabe.de" };
|
|
||||||
var link = new Run(new Text("www.hamann-ausgabe.de"));
|
var link = new Run(new Text("www.hamann-ausgabe.de"));
|
||||||
var head = new Run(new Text("Quelle:"));
|
var head = new Run(new Text("Quelle:"));
|
||||||
var src = new Run(new Break(), new Text(txt) { Space = SpaceProcessingModeValues.Preserve });
|
var src = new Run(new Break(), new Text(txt) { Space = SpaceProcessingModeValues.Preserve });
|
||||||
var srcPara = new Paragraph(head, src, link, new Run(new Text(".")));
|
var srcPara = new Paragraph(head, src, link, new Run(new Text(".")));
|
||||||
/*SansSerifRun(src);
|
|
||||||
SansSerifRun(head);
|
|
||||||
BoldRun(head);*/
|
|
||||||
ApplyParaStyle(srcPara, "quelle");
|
ApplyParaStyle(srcPara, "quelle");
|
||||||
|
GetLastPara(letter.WordDoc).Remove();
|
||||||
GetLastPara(letter.WordDoc).InsertAfterSelf(srcPara);
|
GetLastPara(letter.WordDoc).InsertAfterSelf(srcPara);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,7 +722,7 @@ namespace HamannPrinter
|
|||||||
case "page":
|
case "page":
|
||||||
if (run != null)
|
if (run != null)
|
||||||
{
|
{
|
||||||
string pagenumber = xelem.Attribute("autopsic").Value.ToString();
|
string pagenumber = xelem.Attribute("index").Value.ToString();
|
||||||
run.AppendChild<Text>(new Text(" |" + pagenumber + "| ") { Space = SpaceProcessingModeValues.Preserve });
|
run.AppendChild<Text>(new Text(" |" + pagenumber + "| ") { Space = SpaceProcessingModeValues.Preserve });
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -829,11 +820,13 @@ namespace HamannPrinter
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "line":
|
case "line":
|
||||||
CheckLineTag(xelem, wordDoc);
|
CheckLineTag(xelem, wordDoc, letter);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "page":
|
case "page":
|
||||||
CheckPageTag(xelem, wordDoc);
|
if (!letter.stateFirstLine)
|
||||||
|
{
|
||||||
|
CheckPageTag(xelem, wordDoc);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "nr":
|
case "nr":
|
||||||
@@ -959,110 +952,73 @@ namespace HamannPrinter
|
|||||||
|
|
||||||
#region Vorbereitungen für Letterparsen
|
#region Vorbereitungen für Letterparsen
|
||||||
|
|
||||||
/*
|
|
||||||
//veraltete funktion, kann gelöscht werden
|
|
||||||
public void Coordinator(ILibrary lib, string[] vols, bool? letterDocs, bool? letterPdfs, bool? volDocs, bool? volPdf, bool? registerDocs, bool? registerPdf)
|
|
||||||
{
|
|
||||||
// koordiniert das Erstellen der einzelnen Dokumenttypen/-sorten
|
|
||||||
if (letterDocs == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle docx für einzelbriefe");
|
|
||||||
MakeLetterDocuments(lib, vols);
|
|
||||||
if (letterPdfs == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle PDF für einzelbriefe");
|
|
||||||
PdfPrinter.Print(LetterPaths);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (volDocs == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle docx für BandDateien");
|
|
||||||
MakeVolumeDocuments(lib, vols);
|
|
||||||
if (volPdf == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle PDF für BandDateien");
|
|
||||||
PdfPrinter.Print(VolumePaths);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (registerDocs == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle docx für Register");
|
|
||||||
MakeRegisterComms();
|
|
||||||
if (registerPdf == true)
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle PDF für Register");
|
|
||||||
PdfPrinter.Print(RegisterPaths);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.IO.File.WriteAllText(OutputDir + "logfile.txt", Logger.LogString.ToString());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void MakeLetterDocuments(ILibrary lib, (int, int) years)
|
|
||||||
{
|
|
||||||
/*Holt eine Liste von Briefobjekten der zu Parsenden Bände (vols), lässt deren dcox.
|
|
||||||
* Dokumente formatieren und befüllen. Schließt/Speichert die Dokumente.*/
|
|
||||||
|
|
||||||
List<LetterObj> letterList = Lib2List(lib, years);
|
|
||||||
//System.Threading.Tasks.Parallel.ForEach(letterList, MakeLetter);
|
|
||||||
foreach (LetterObj letter in letterList)
|
|
||||||
{
|
|
||||||
letter.WordDoc = CreateLetterDocx(letter.OutPutFile);
|
|
||||||
Logger.Out(letter.OutPutFile);
|
|
||||||
if (letter.WordDoc == null)
|
|
||||||
{
|
|
||||||
Logger.Out(letter.Autopsic + "\n hat kein worddoc!");
|
|
||||||
}
|
|
||||||
StyleLetterDocx(letter);
|
|
||||||
Letter2Docx(letter, false);
|
|
||||||
letter.WordDoc.Save();
|
|
||||||
letter.WordDoc.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void MakeYearDocuments(ILibrary lib, (int, int) years)
|
public void MakeYearDocuments(ILibrary lib, (int, int) years)
|
||||||
{
|
{
|
||||||
/*erzeugt temporäre Briefdateien und verbindet siezu einer Banddatei
|
Stopwatch sw = new Stopwatch();
|
||||||
die dauerhaften Brief.docx dateien können nicht gemergt werden, da sie die
|
sw.Start();
|
||||||
für Bände überflüssige source section am ende enthalten und alt chunks nicht
|
// Parallel.ForEach(Enumerable.Range(years.Item1, years.Item2 - years.Item1 + 1), i => {
|
||||||
verändert werden können*/
|
// Logger.Out("Dokument für Jahr " + i.ToString());
|
||||||
for (; years.Item1 < years.Item2; years.Item1++)
|
// var outputPaths = new List<(int, string)>();
|
||||||
{
|
// var letterList = Lib2List(lib, i);
|
||||||
Logger.Out("Dokument für Jahr " + years.Item1.ToString());
|
// if (letterList.Any())
|
||||||
string tempfolder = GetTemporaryDirectory();
|
// {
|
||||||
Logger.Out("tempfolder ist " + tempfolder);
|
// foreach (var letter in letterList.OrderBy(x => x.Meta.Sort).ThenBy(x => x.Meta.Order))
|
||||||
var outputPaths = new Dictionary<int, string>();
|
// {
|
||||||
var letterList = Lib2List(lib, years.Item1, tempfolder);
|
// letter.WordDoc = CreateLetterDocx(letter.OutPutFile);
|
||||||
foreach (var letter in letterList)
|
// StyleLetterDocx(letter);
|
||||||
|
// Letter2Docx(letter);
|
||||||
|
// outputPaths.Add((Int32.Parse(letter.Index), letter.OutPutFile));
|
||||||
|
// letter.WordDoc.Dispose();
|
||||||
|
// }
|
||||||
|
// MergeDocx(lib, i.ToString(), outputPaths, MakeVolumeDoc(i.ToString()), Editionsrichtlinien);
|
||||||
|
// }
|
||||||
|
// foreach(var letter in letterList)
|
||||||
|
// {
|
||||||
|
// Logger.Out("Nachbearbeitung Brief " + letter.Autopsic);
|
||||||
|
// letter.WordDoc = WordprocessingDocument.Open(letter.OutPutFile, true);
|
||||||
|
// MakeSourceSection(letter);
|
||||||
|
// letter.WordDoc.Dispose();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// sw.Stop();
|
||||||
|
// TimeSpan ts = sw.Elapsed;
|
||||||
|
// string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
|
// ts.Hours, ts.Minutes, ts.Seconds,
|
||||||
|
// ts.Milliseconds / 10);
|
||||||
|
// Logger.Out(elapsedTime);
|
||||||
|
// sw.Restart();
|
||||||
|
for (; years.Item1 <= years.Item2; years.Item1++)
|
||||||
{
|
{
|
||||||
letter.WordDoc = CreateLetterDocx(letter.OutPutFile);
|
Logger.Out("Dokument für Jahr " + years.Item1.ToString());
|
||||||
StyleLetterDocx(letter);
|
var outputPaths = new List<(int, string)>();
|
||||||
Letter2Docx(letter, true);
|
var letterList = Lib2List(lib, years.Item1);
|
||||||
letter.WordDoc.Save();
|
if (letterList.Any())
|
||||||
outputPaths.Add(Int32.Parse(letter.Index), letter.OutPutFile);
|
{
|
||||||
letter.WordDoc.Close();
|
foreach (var letter in letterList.OrderBy(x => x.Meta.Sort).ThenBy(x => x.Meta.Order))
|
||||||
|
{
|
||||||
|
letter.WordDoc = CreateLetterDocx(letter.OutPutFile);
|
||||||
|
StyleLetterDocx(letter);
|
||||||
|
Letter2Docx(letter);
|
||||||
|
outputPaths.Add((Int32.Parse(letter.Index), letter.OutPutFile));
|
||||||
|
letter.WordDoc.Dispose();
|
||||||
|
}
|
||||||
|
MergeDocx(lib, years.Item1.ToString(), outputPaths, MakeVolumeDoc(years.Item1.ToString()), Editionsrichtlinien);
|
||||||
|
}
|
||||||
|
Parallel.ForEach(letterList, letter => {
|
||||||
|
Logger.Out("Nachbearbeitung Brief " + letter.Autopsic);
|
||||||
|
letter.WordDoc = WordprocessingDocument.Open(letter.OutPutFile, true);
|
||||||
|
MakeSourceSection(letter);
|
||||||
|
letter.WordDoc.Dispose();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
outputPaths.Add(0, MakeVolumeDoc(years.Item1.ToString()));
|
sw.Stop();
|
||||||
outputPaths.Add(1000000000, Editionsrichtlinien);
|
var ts = sw.Elapsed;
|
||||||
MergeDocx(years.Item1.ToString(), outputPaths);
|
var elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||||
//temporären briefdateien löschen
|
ts.Hours, ts.Minutes, ts.Seconds,
|
||||||
RemoveTempFolderFiles(outputPaths, tempfolder);
|
ts.Milliseconds / 10);
|
||||||
}
|
Logger.Out("ELAPSED: " + elapsedTime);
|
||||||
}
|
|
||||||
|
|
||||||
private static void MakeLetter(LetterObj letter)
|
|
||||||
{
|
|
||||||
letter.WordDoc = CreateLetterDocx(letter.OutPutFile);
|
|
||||||
Logger.Out(letter.OutPutFile);
|
|
||||||
if (letter.WordDoc == null)
|
|
||||||
{
|
|
||||||
Logger.Out(letter.Autopsic + "\n hat kein worddoc!");
|
|
||||||
}
|
|
||||||
StyleLetterDocx(letter);
|
|
||||||
Letter2Docx(letter, false);
|
|
||||||
letter.WordDoc.Save();
|
|
||||||
letter.WordDoc.Close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void StyleLetterDocx(LetterObj letter)
|
public static void StyleLetterDocx(LetterObj letter)
|
||||||
@@ -1117,7 +1073,7 @@ namespace HamannPrinter
|
|||||||
return letterList;
|
return letterList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<LetterObj> Lib2List(ILibrary library, int year, string tempDir)
|
public static List<LetterObj> Lib2List(ILibrary library, int year)
|
||||||
{
|
{
|
||||||
/*Da die Erstellung von Volume.docx dateien über das Erstellen und mergen von Einzelbriefdokumenten funtkioniert,
|
/*Da die Erstellung von Volume.docx dateien über das Erstellen und mergen von Einzelbriefdokumenten funtkioniert,
|
||||||
* ist diese Überladung von Lib2List nötig.
|
* ist diese Überladung von Lib2List nötig.
|
||||||
@@ -1126,9 +1082,10 @@ namespace HamannPrinter
|
|||||||
List<LetterObj> letterList = new List<LetterObj>();
|
List<LetterObj> letterList = new List<LetterObj>();
|
||||||
foreach (var letter in library.Letters.Where(x => library.Metas[x.Key].ZH != null && library.Metas[x.Key].Sort.Year == year))
|
foreach (var letter in library.Letters.Where(x => library.Metas[x.Key].ZH != null && library.Metas[x.Key].Sort.Year == year))
|
||||||
{
|
{
|
||||||
var letterObj = CreateLetterObj(letter, library, tempDir);
|
var letterObj = CreateLetterObj(letter, library);
|
||||||
letterList.Add(letterObj);
|
letterList.Add(letterObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return letterList;
|
return letterList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1816,7 +1773,7 @@ namespace HamannPrinter
|
|||||||
props.SectionProperties.AppendChild(new Columns() { ColumnCount = 2, Space = ColumnDistance, EqualWidth = true });
|
props.SectionProperties.AppendChild(new Columns() { ColumnCount = 2, Space = ColumnDistance, EqualWidth = true });
|
||||||
}
|
}
|
||||||
props.SectionProperties.AppendChild<SectionType>(new SectionType() { Val = SectionMarkValues.Continuous });
|
props.SectionProperties.AppendChild<SectionType>(new SectionType() { Val = SectionMarkValues.Continuous });
|
||||||
PageMargin pageMargin = new PageMargin() { Top = MarginTop, Right = MarginRight, Bottom = MarginBottom, Left = MarginLeft, Footer = MarginFooter };
|
PageMargin pageMargin = new PageMargin() { Top = MarginTop, Right = MarginRightColumns, Bottom = MarginBottom, Left = MarginLeft, Footer = MarginFooter };
|
||||||
props.SectionProperties.PrependChild(pageMargin);
|
props.SectionProperties.PrependChild(pageMargin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2573,25 +2530,25 @@ namespace HamannPrinter
|
|||||||
|
|
||||||
XElement xLine = GetLineXisIn(hand);
|
XElement xLine = GetLineXisIn(hand);
|
||||||
firstPage = GetPageXisOn(xLine, letter);
|
firstPage = GetPageXisOn(xLine, letter);
|
||||||
if (!xLine.Attributes("autopsic").Any() || xLine.Attributes("fn").Any())
|
if (!xLine.Attributes("index").Any() || xLine.Attributes("fn").Any())
|
||||||
{
|
{
|
||||||
firstLine = isFN;
|
firstLine = isFN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
firstLine = xLine.Attribute("autopsic").Value;
|
firstLine = xLine.Attribute("index").Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastXPage = hand.Descendants().Where(x => !((x as XNode) is XText) && x?.Name?.LocalName == "page").LastOrDefault();
|
var lastXPage = hand.Descendants().Where(x => !((x as XNode) is XText) && x?.Name?.LocalName == "page").LastOrDefault();
|
||||||
if (lastXPage != null)
|
if (lastXPage != null)
|
||||||
{
|
{
|
||||||
lastPage = lastXPage.Attribute("autopsic").Value;
|
lastPage = lastXPage.Attribute("index").Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastXLine = hand.Descendants().Where(x => !((x as XNode) is XText) && x?.Name?.LocalName == "line").LastOrDefault();
|
var lastXLine = hand.Descendants().Where(x => !((x as XNode) is XText) && x?.Name?.LocalName == "line").LastOrDefault();
|
||||||
if (lastXLine != null && firstLine != isFN)
|
if (lastXLine != null && firstLine != isFN)
|
||||||
{
|
{
|
||||||
lastLine = lastXLine.Attribute("autopsic").Value;
|
lastLine = lastXLine.Attribute("index").Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastPage != "")
|
if (lastPage != "")
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ using System.Text.RegularExpressions;
|
|||||||
using DocumentFormat.OpenXml;
|
using DocumentFormat.OpenXml;
|
||||||
using DocumentFormat.OpenXml.Packaging;
|
using DocumentFormat.OpenXml.Packaging;
|
||||||
using DocumentFormat.OpenXml.Wordprocessing;
|
using DocumentFormat.OpenXml.Wordprocessing;
|
||||||
|
using HaDocument.Interfaces;
|
||||||
|
using HaDocument.Models;
|
||||||
using static HamannPrinter.Hamann2Word;
|
using static HamannPrinter.Hamann2Word;
|
||||||
using static HamannPrinter.Parser;
|
using static HamannPrinter.Parser;
|
||||||
using Comment = HaDocument.Models.Comment;
|
using Comment = HaDocument.Models.Comment;
|
||||||
@@ -19,10 +21,10 @@ namespace HamannPrinter
|
|||||||
|
|
||||||
public static void Warn(string message)
|
public static void Warn(string message)
|
||||||
{
|
{
|
||||||
MessageBox.Show(message,
|
MessageBox.Show(message,
|
||||||
"Confirmation",
|
"Confirmation",
|
||||||
MessageBoxButton.OK,
|
MessageBoxButton.OK,
|
||||||
MessageBoxImage.Exclamation);
|
MessageBoxImage.Exclamation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Ok(string message)
|
public static void Ok(string message)
|
||||||
@@ -69,7 +71,7 @@ namespace HamannPrinter
|
|||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WordprocessingDocument CreateOutputFile(string path)
|
public static WordprocessingDocument CreateOutputFile(string path)
|
||||||
@@ -155,11 +157,13 @@ namespace HamannPrinter
|
|||||||
return "VII";
|
return "VII";
|
||||||
default:
|
default:
|
||||||
var number = 0;
|
var number = 0;
|
||||||
if (!Int32.TryParse(index, out number)) {
|
if (!Int32.TryParse(index, out number))
|
||||||
|
{
|
||||||
Logger.Out("Kann BandZahl " + index + "nicht in römische Zahl auflösen.");
|
Logger.Out("Kann BandZahl " + index + "nicht in römische Zahl auflösen.");
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return ToRoman(number);
|
return ToRoman(number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -398,7 +402,7 @@ namespace HamannPrinter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckLineTag(XElement xelem, WordprocessingDocument wordDoc)
|
public static void CheckLineTag(XElement xelem, WordprocessingDocument wordDoc, LetterObj letter)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool isFootNote = false;
|
bool isFootNote = false;
|
||||||
@@ -409,7 +413,8 @@ namespace HamannPrinter
|
|||||||
isFootNote = true;
|
isFootNote = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xelem.Attribute("index") != null)
|
|
||||||
|
if (xelem.Attribute("index") != null && !letter.stateFirstLine)
|
||||||
{
|
{
|
||||||
//coutable: Zeile ist eine der zu zählenden 5er Zeilen
|
//coutable: Zeile ist eine der zu zählenden 5er Zeilen
|
||||||
bool isCountable = CheckIndex(xelem);
|
bool isCountable = CheckIndex(xelem);
|
||||||
@@ -437,6 +442,19 @@ namespace HamannPrinter
|
|||||||
newOne = lastParagraph.InsertAfterSelf<Paragraph>(new Paragraph());
|
newOne = lastParagraph.InsertAfterSelf<Paragraph>(new Paragraph());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (xelem.Attribute("index") != null && letter.stateFirstLine)
|
||||||
|
{
|
||||||
|
Paragraph counterParagraph = new Paragraph();
|
||||||
|
Run run = new Run(new Text("S. " + letter.Meta.ZH.Page + ", " + xelem.Attribute("index").Value));
|
||||||
|
counterParagraph.AppendChild<Run>(run);
|
||||||
|
SmallFont(run);
|
||||||
|
ApplyParaStyle(counterParagraph, "zeilenzählung");
|
||||||
|
Paragraph lastParagraph = GetLastPara(wordDoc);
|
||||||
|
lastParagraph.InsertAfterSelf<Paragraph>(counterParagraph);
|
||||||
|
FrameCounterParagraph(counterParagraph);
|
||||||
|
letter.stateFirstLine = false;
|
||||||
|
newOne = counterParagraph.InsertAfterSelf<Paragraph>(new Paragraph());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Paragraph lastParagraph = GetLastPara(wordDoc);
|
Paragraph lastParagraph = GetLastPara(wordDoc);
|
||||||
@@ -480,7 +498,7 @@ namespace HamannPrinter
|
|||||||
if (xelem.Attribute("index") != null)
|
if (xelem.Attribute("index") != null)
|
||||||
{
|
{
|
||||||
int number = 0;
|
int number = 0;
|
||||||
if (Int32.TryParse(xelem.Attribute("index").Value, out number))
|
if (Int32.TryParse(xelem.Attribute("index").Value, out number))
|
||||||
{
|
{
|
||||||
if (number % 5 == 0 && number != 0)
|
if (number % 5 == 0 && number != 0)
|
||||||
{
|
{
|
||||||
@@ -564,9 +582,9 @@ namespace HamannPrinter
|
|||||||
{
|
{
|
||||||
//erstellt Textboxen für die Seitenzählung
|
//erstellt Textboxen für die Seitenzählung
|
||||||
string pagenumber = "";
|
string pagenumber = "";
|
||||||
if (xelem.Attributes("autopsic").Any())
|
if (xelem.Attributes("index").Any())
|
||||||
pagenumber = xelem.Attribute("autopsic").Value.ToString();
|
pagenumber = xelem.Attribute("index").Value.ToString();
|
||||||
else if (xelem.Attributes("index").Any())
|
else if (xelem.Attributes("autopsic").Any())
|
||||||
pagenumber = xelem.Attribute("index").Value.ToString();
|
pagenumber = xelem.Attribute("index").Value.ToString();
|
||||||
Paragraph counterParagraph = new Paragraph();
|
Paragraph counterParagraph = new Paragraph();
|
||||||
ApplyParaStyle(counterParagraph, "seitenzählung");
|
ApplyParaStyle(counterParagraph, "seitenzählung");
|
||||||
@@ -582,7 +600,7 @@ namespace HamannPrinter
|
|||||||
public static Paragraph IfLine5(WordprocessingDocument wordDoc, XElement xelem, int numbr)
|
public static Paragraph IfLine5(WordprocessingDocument wordDoc, XElement xelem, int numbr)
|
||||||
{
|
{
|
||||||
Paragraph counterParagraph = new Paragraph();
|
Paragraph counterParagraph = new Paragraph();
|
||||||
Run run = new Run(new Text(xelem.Attribute("autopsic").Value));
|
Run run = new Run(new Text(xelem.Attribute("index").Value));
|
||||||
counterParagraph.AppendChild<Run>(run);
|
counterParagraph.AppendChild<Run>(run);
|
||||||
SmallFont(run);
|
SmallFont(run);
|
||||||
ApplyParaStyle(counterParagraph, "zeilenzählung");
|
ApplyParaStyle(counterParagraph, "zeilenzählung");
|
||||||
@@ -758,7 +776,7 @@ namespace HamannPrinter
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
Logger.Out("Diese URL ist im Eimer: " + url+ "\nObwohl ich sie lösche mag Word das Dokument danach nicht öffnen! Diese URL also bitte im XML korrigieren! \n"+exception.Message);
|
Logger.Out("Diese URL ist im Eimer: " + url + "\nObwohl ich sie lösche mag Word das Dokument danach nicht öffnen! Diese URL also bitte im XML korrigieren! \n" + exception.Message);
|
||||||
link.Remove();
|
link.Remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -787,13 +805,13 @@ namespace HamannPrinter
|
|||||||
return tempFolder;
|
return tempFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveTempFolderFiles(Dictionary<int, string> outputPaths, string tempfolder)
|
public static void RemoveTempFolderFiles(List<(int, string)> outputPaths, string tempfolder)
|
||||||
{
|
{
|
||||||
foreach (var path in outputPaths.Where(x => x.Key != 0 && x.Key != 1000000000))
|
foreach (var path in outputPaths)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.Delete(path.Value);
|
File.Delete(path.Item2);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -811,31 +829,43 @@ namespace HamannPrinter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MergeDocx(string year, Dictionary<int, string> outputPaths)
|
public static void MergeDocx(ILibrary lib, string year, List<(int, string)> outputPaths, string basepath, string additions)
|
||||||
{
|
{
|
||||||
/*verbindet die einzelnen temporären ZH Briefdateien zu einer Banddatei
|
/*verbindet die einzelnen temporären ZH Briefdateien zu einer Banddatei
|
||||||
die dauerhaften Brief.docx dateien können nicht gemergt werden, da sie die
|
die dauerhaften Brief.docx dateien können nicht gemergt werden, da sie die
|
||||||
für Bände überflüssige source section am ende enthalten und alt chunks nicht
|
für Bände überflüssige source section am ende enthalten und alt chunks nicht
|
||||||
verändert werden können*/
|
verändert werden können*/
|
||||||
Logger.Out("erstelle Jahr " + year);
|
Logger.Out("erstelle Jahr " + year);
|
||||||
var OrderedPathKeys = outputPaths.Keys.ToList();
|
using (WordprocessingDocument doc = WordprocessingDocument.Open(basepath, true))
|
||||||
OrderedPathKeys.Sort((a, b) => -1 * a.CompareTo(b));
|
|
||||||
foreach (var key in OrderedPathKeys.Where(k => k != 0))
|
|
||||||
{
|
{
|
||||||
using (WordprocessingDocument doc = WordprocessingDocument.Open(@outputPaths[0], true))
|
MainDocumentPart mainPart = doc.MainDocumentPart;
|
||||||
|
AltChunk altChunk = null;
|
||||||
|
var altChunkId = "AltChunkId" + "1000000000";
|
||||||
|
var chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML, altChunkId);
|
||||||
|
using (FileStream fileStream = File.Open(additions, FileMode.Open))
|
||||||
{
|
{
|
||||||
MainDocumentPart mainPart = doc.MainDocumentPart;
|
chunk.FeedData(fileStream);
|
||||||
string altChunkId = "AltChunkId" + key;
|
}
|
||||||
AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML, altChunkId);
|
altChunk = new AltChunk();
|
||||||
using (FileStream fileStream = File.Open(@outputPaths[key], FileMode.Open))
|
altChunk.Id = altChunkId;
|
||||||
|
mainPart.Document.Body.InsertAfter(altChunk, GetLastPara(doc));
|
||||||
|
mainPart.Document.Save();
|
||||||
|
|
||||||
|
|
||||||
|
outputPaths.Reverse();
|
||||||
|
foreach (var (key, value) in outputPaths)
|
||||||
|
{
|
||||||
|
altChunkId = "AltChunkId" + key;
|
||||||
|
chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML, altChunkId);
|
||||||
|
using (FileStream fileStream = File.Open(value, FileMode.Open))
|
||||||
{
|
{
|
||||||
chunk.FeedData(fileStream);
|
chunk.FeedData(fileStream);
|
||||||
}
|
}
|
||||||
AltChunk altChunk = new AltChunk();
|
altChunk = new AltChunk();
|
||||||
altChunk.Id = altChunkId;
|
altChunk.Id = altChunkId;
|
||||||
mainPart.Document.Body.InsertAfter(altChunk, GetLastPara(doc));
|
mainPart.Document.Body.InsertAfter(altChunk, GetLastPara(doc));
|
||||||
mainPart.Document.Save();
|
mainPart.Document.Save();
|
||||||
doc.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,29 +5,27 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:HamannPrinter"
|
xmlns:local="clr-namespace:HamannPrinter"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="HamannPrinter" Height="450" Width="800" WindowStartupLocation="CenterOwner" WindowState="Minimized">
|
Title="HamannPrinter" Height="227" Width="684" WindowStartupLocation="CenterOwner" WindowState="Minimized">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="377*"/>
|
<ColumnDefinition Width="377*"/>
|
||||||
<ColumnDefinition Width="423*"/>
|
<ColumnDefinition Width="423*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid Grid.ColumnSpan="2">
|
<Grid Grid.ColumnSpan="2">
|
||||||
<CheckBox x:Name="LetterDocs" Content="Brief.docx erzeugen" HorizontalAlignment="Left" Margin="40,34,0,0" VerticalAlignment="Top" Checked="SingleDocChanged" Unchecked="SingleDocChanged" IsChecked="True"/>
|
<CheckBox x:Name="VolumeDocs" Content="Docx für Briefe und Jahre erzeugen" HorizontalAlignment="Left" Margin="40,27,0,0" VerticalAlignment="Top" Checked="VolDocChanged" Unchecked="VolDocChanged" IsChecked="True"/>
|
||||||
<CheckBox x:Name="VolumeDocs" Content="Jahr.docx erzeugen" HorizontalAlignment="Left" Margin="40,59,0,0" VerticalAlignment="Top" Checked="VolDocChanged" Unchecked="VolDocChanged" IsChecked="True"/>
|
<CheckBox x:Name="RegisterDocs" Content="Docx für Kommentare erzeugen" HorizontalAlignment="Left" Margin="40,52,0,0" VerticalAlignment="Top" Unchecked="CommDocChanged" Checked="CommDocChanged" IsChecked="True"/>
|
||||||
<CheckBox x:Name="RegisterDocs" Content="Kommentar.docx erzeugen" HorizontalAlignment="Left" Margin="40,84,0,0" VerticalAlignment="Top" Unchecked="CommDocChanged" Checked="CommDocChanged" IsChecked="True"/>
|
<Label Content="Jahre" HorizontalAlignment="Left" Margin="44,80,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left"/>
|
||||||
<Label Content="Jahre" HorizontalAlignment="Left" Margin="40,133,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left"/>
|
<Label Content="Verzeichnis mit Hamann-XML-Teildateien:" HorizontalAlignment="Left" Margin="267,20,0,0" VerticalAlignment="Top"/>
|
||||||
<Label Content="Verzeichnis mit Hamann-XML-Teildateien:" HorizontalAlignment="Left" Margin="320,133,0,0" VerticalAlignment="Top"/>
|
<TextBox x:Name="XmlFileBox" HorizontalAlignment="Left" Margin="267,45,0,0" Text="" TextWrapping="NoWrap" VerticalAlignment="Top" Width="342"/>
|
||||||
<TextBox x:Name="XmlFileBox" HorizontalAlignment="Left" Margin="320,158,0,0" Text="" TextWrapping="NoWrap" VerticalAlignment="Top" Width="342" Grid.ColumnSpan="2"/>
|
<Button x:Name="XmlFileButton" Content="suchen" HorizontalAlignment="Left" Margin="627,45,0,0" VerticalAlignment="Top" Click="XmlFileButton_Click"/>
|
||||||
<Button x:Name="XmlFileButton" Content="suchen" Grid.Column="1" HorizontalAlignment="Left" Margin="680,158,0,0" VerticalAlignment="Top" Click="XmlFileButton_Click"/>
|
<Label Content="Ausgabeverzeichnis:" HorizontalAlignment="Left" Margin="267,70,0,0" VerticalAlignment="Top" Width="136"/>
|
||||||
<Label Content="Ausgabeverzeichnis:" HorizontalAlignment="Left" Margin="320,183,0,0" VerticalAlignment="Top" Width="136"/>
|
<TextBox x:Name="OutputDirBox" HorizontalAlignment="Left" Margin="267,95,0,0" Text="" TextWrapping="NoWrap" VerticalAlignment="Top" Width="342"/>
|
||||||
<TextBox x:Name="OutputDirBox" HorizontalAlignment="Left" Margin="320,208,0,0" Text="" TextWrapping="NoWrap" VerticalAlignment="Top" Width="342"/>
|
<Button x:Name="OutputDirButton" Content="suchen" HorizontalAlignment="Left" Margin="627,95,0,0" VerticalAlignment="Top" Click="OutputDirButton_Click"/>
|
||||||
<Button x:Name="OutputDirButton" Content="suchen" Grid.Column="1" HorizontalAlignment="Left" Margin="680,208,20,0" VerticalAlignment="Top" Click="OutputDirButton_Click"/>
|
<Button Content="Dokumente erzeugen" HorizontalAlignment="Left" Margin="550,0,0,19" VerticalAlignment="Bottom" Click="Button_Click"/>
|
||||||
<Button Content="Dokumente erzeugen" HorizontalAlignment="Left" Margin="603,0,0,45" VerticalAlignment="Bottom" Click="Button_Click"/>
|
<TextBox x:Name="StartYearTextBox" HorizontalAlignment="Left" Margin="106,105,0,0" Text="1751" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" TextInput="TextBox_TextInput"/>
|
||||||
<TextBlock HorizontalAlignment="Left" Margin="321,304,0,0" Text="Achtung! Auf keinen Fall sollte man während des Erstellens von PDF-Dateien Word öffnen oder geöffnet haben!" TextWrapping="Wrap" VerticalAlignment="Top" Width="364"/>
|
<TextBox x:Name="EndYearTextBox" HorizontalAlignment="Left" Margin="106,128,0,0" Text="1788" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" MaxLength="6" TextInput="EndYearTextBox_TextInput"/>
|
||||||
<TextBox x:Name="StartYearTextBox" HorizontalAlignment="Left" Margin="102,158,0,0" Text="1751" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" TextInput="TextBox_TextInput"/>
|
<Label Content="und" HorizontalAlignment="Left" Margin="44,124,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left"/>
|
||||||
<TextBox x:Name="EndYearTextBox" HorizontalAlignment="Left" Margin="102,181,0,0" Text="1788" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" MaxLength="6" TextInput="EndYearTextBox_TextInput"/>
|
<Label Content="zwischen" HorizontalAlignment="Left" Margin="44,102,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" RenderTransformOrigin="0.418,1.293"/>
|
||||||
<Label Content="und" HorizontalAlignment="Left" Margin="40,177,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left"/>
|
|
||||||
<Label Content="zwischen" HorizontalAlignment="Left" Margin="40,155,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" RenderTransformOrigin="0.418,1.293"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace HamannPrinter
|
|||||||
RegisterDocs.IsChecked = false;
|
RegisterDocs.IsChecked = false;
|
||||||
VolumeDocs.IsChecked = true;
|
VolumeDocs.IsChecked = true;
|
||||||
StartYearTextBox.Text = "1751";
|
StartYearTextBox.Text = "1751";
|
||||||
EndYearTextBox.Text = "1764";
|
EndYearTextBox.Text = "1788"; // DEV
|
||||||
XmlFileBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\XML"; // DEV
|
XmlFileBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\XML"; // DEV
|
||||||
OutputDirBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\Ausg"; // DEV
|
OutputDirBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\Ausg"; // DEV
|
||||||
Act(); // DEV
|
Act(); // DEV
|
||||||
@@ -108,7 +108,7 @@ namespace HamannPrinter
|
|||||||
|
|
||||||
private bool CheckInput()
|
private bool CheckInput()
|
||||||
{
|
{
|
||||||
if (LetterDocs.IsChecked == true || VolumeDocs.IsChecked == true)
|
if (VolumeDocs.IsChecked == true)
|
||||||
{
|
{
|
||||||
if (GetYears().Item1 <= GetYears().Item2)
|
if (GetYears().Item1 <= GetYears().Item2)
|
||||||
{
|
{
|
||||||
@@ -179,7 +179,6 @@ namespace HamannPrinter
|
|||||||
var confix = new Confix()
|
var confix = new Confix()
|
||||||
{
|
{
|
||||||
Editionsrichtlinien = CheckForEditionsRichtlinien(),
|
Editionsrichtlinien = CheckForEditionsRichtlinien(),
|
||||||
LettersDocx = LetterDocs.IsChecked,
|
|
||||||
VolumeDocx = VolumeDocs.IsChecked,
|
VolumeDocx = VolumeDocs.IsChecked,
|
||||||
RegisterDocx = RegisterDocs.IsChecked,
|
RegisterDocx = RegisterDocs.IsChecked,
|
||||||
HamannXmlPath = GetHAMANNxml(),
|
HamannXmlPath = GetHAMANNxml(),
|
||||||
|
|||||||
@@ -39,11 +39,12 @@ namespace HamannPrinter
|
|||||||
public string SmallFontSize { get; set; } = "12";
|
public string SmallFontSize { get; set; } = "12";
|
||||||
public string BigFontSize { get; set; } = "32";
|
public string BigFontSize { get; set; } = "32";
|
||||||
public int MarginTop { get; set; } = 1416;
|
public int MarginTop { get; set; } = 1416;
|
||||||
public UInt32 MarginRight { get; set; } = 2600U;
|
public UInt32 MarginRight { get; set; } = 2400U;
|
||||||
public int MarginBottom { get; set; } = 2132;
|
public int MarginBottom { get; set; } = 2132;
|
||||||
public UInt32 MarginLeft { get; set; } = 1984U;
|
public UInt32 MarginLeft { get; set; } = 1984U;
|
||||||
public UInt32 MarginFooter { get; set; } = 1417U;
|
public UInt32 MarginFooter { get; set; } = 1417U;
|
||||||
public string ColumnDistance { get; set; } = "560";
|
public string ColumnDistance { get; set; } = "560";
|
||||||
|
public UInt32 MarginRightColumns { get; set; } = 1900U;
|
||||||
public string FooterToText { get; set; } = "420";
|
public string FooterToText { get; set; } = "420";
|
||||||
public string NormalFont { get; set; } = "Linux Libertine G";
|
public string NormalFont { get; set; } = "Linux Libertine G";
|
||||||
public string SpecialFont { get; set; } = "Linux Biolinum";
|
public string SpecialFont { get; set; } = "Linux Biolinum";
|
||||||
@@ -77,7 +78,7 @@ namespace HamannPrinter
|
|||||||
var hamannDoc = Document.Create(new Options(confix.HamannXmlPath));
|
var hamannDoc = Document.Create(new Options(confix.HamannXmlPath));
|
||||||
DocOptions docOpt = new DocOptions(confix.Years, confix.OutputPath, confix.Editionsrichtlinien);
|
DocOptions docOpt = new DocOptions(confix.Years, confix.OutputPath, confix.Editionsrichtlinien);
|
||||||
CheckXML(confix, docOpt, hamannDoc);
|
CheckXML(confix, docOpt, hamannDoc);
|
||||||
Coordinator(docOpt, hamannDoc, hamannDoc, docOpt.Years, confix.LettersDocx, confix.VolumeDocx, confix.RegisterDocx);
|
Coordinator(docOpt, hamannDoc, hamannDoc, docOpt.Years, confix.VolumeDocx, confix.RegisterDocx);
|
||||||
// DEV Helper.Ok("Fertig!");
|
// DEV Helper.Ok("Fertig!");
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
@@ -306,17 +307,12 @@ namespace HamannPrinter
|
|||||||
System.IO.File.WriteAllText(docOpt.OutputDir + "errors.txt", errors.ToString());
|
System.IO.File.WriteAllText(docOpt.OutputDir + "errors.txt", errors.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Coordinator(DocOptions docOpt, ILibrary hamannDoc, ILibrary lib, (int, int) years, bool? letterDocs, bool? volDocs, bool? registerDocs)
|
public void Coordinator(DocOptions docOpt, ILibrary hamannDoc, ILibrary lib, (int, int) years, bool? volDocs, bool? registerDocs)
|
||||||
{
|
{
|
||||||
/* koordiniert das Erstellen der einzelnen Dokumenttypen/-sorten*/
|
/* koordiniert das Erstellen der einzelnen Dokumenttypen/-sorten*/
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
var h2w = new Hamann2Word(hamannDoc, docOpt);
|
var h2w = new Hamann2Word(hamannDoc, docOpt);
|
||||||
if (letterDocs == true || letterDocs == false) // DEV
|
|
||||||
{
|
|
||||||
Logger.Out("Erstelle docx für einzelbriefe");
|
|
||||||
h2w.MakeLetterDocuments(lib, years);
|
|
||||||
}
|
|
||||||
if (volDocs == true)
|
if (volDocs == true)
|
||||||
{
|
{
|
||||||
Logger.Out("Erstelle docx für BandDateien");
|
Logger.Out("Erstelle docx für BandDateien");
|
||||||
|
|||||||
Reference in New Issue
Block a user