Update 20250618
This commit is contained in:
@@ -194,7 +194,7 @@ namespace DOCGEN.Klassen
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void insert_signature(string bookmark, string unterschrift, ref WordDocument document)
|
||||
{
|
||||
@@ -204,14 +204,14 @@ namespace DOCGEN.Klassen
|
||||
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(unterschrift));
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
|
||||
Shape signature = bm.BookmarkStart.OwnerParagraph.AppendShape(Syncfusion.DocIO.DLS.AutoShapeType.Rectangle,135,55);
|
||||
Shape signature = bm.BookmarkStart.OwnerParagraph.AppendShape(Syncfusion.DocIO.DLS.AutoShapeType.Rectangle, 135, 55);
|
||||
//IWParagraph p = bm.BookmarkStart.OwnerParagraph;
|
||||
//IWPicture u = p.AppendPicture(img);
|
||||
IWParagraph sigparagraph = signature.TextBody.AddParagraph();
|
||||
signature.WrapFormat.TextWrappingStyle = TextWrappingStyle.Behind;
|
||||
signature.LineFormat.DashStyle = LineDashing.Solid;
|
||||
signature.LineFormat.Color= Color.White;
|
||||
|
||||
signature.LineFormat.Color = Color.White;
|
||||
|
||||
signature.WrapFormat.AllowOverlap = true;
|
||||
signature.VerticalPosition = signature.VerticalPosition - 54;
|
||||
signature.WrapFormat.TextWrappingStyle = TextWrappingStyle.Behind;
|
||||
@@ -221,12 +221,12 @@ namespace DOCGEN.Klassen
|
||||
p.Width = 120;
|
||||
p.Height = 50;
|
||||
signature.Name = "Unterschrift_" + bookmark;
|
||||
|
||||
|
||||
// signature.OwnerParagraph.AppendPicture(img);
|
||||
|
||||
|
||||
// signature.OwnerParagraph.AppendPicture(img);
|
||||
mssign = null;
|
||||
}
|
||||
public string Generate_Word(string base64, clsDocData docdata, string img_UL = "", string img_UR = "", string img_faktura = "", bool serienbrief=false, bool editdoc=false)
|
||||
public string Generate_Word(string base64, clsDocData docdata, string img_UL = "", string img_UR = "", string img_faktura = "", bool serienbrief = false, bool editdoc = false)
|
||||
{
|
||||
string formattype = "";
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
|
||||
@@ -271,12 +271,12 @@ namespace DOCGEN.Klassen
|
||||
string ppimg = "";
|
||||
string ppimg64 = "";
|
||||
|
||||
|
||||
|
||||
|
||||
if (docdata.Barcode == true)
|
||||
{
|
||||
//20250531 - Barcode nicht beim Serienbrief
|
||||
if (!serienbrief && !editdoc) Insert_Barcode(document, docdata);
|
||||
if (!serienbrief) Insert_Barcode(document, docdata);
|
||||
}
|
||||
if (docdata.PrintLogo == true)
|
||||
{
|
||||
@@ -354,10 +354,10 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
}
|
||||
|
||||
if (dv.TMBeginn.ToString() == "TGEDKTagesdatumB99" || dv.TMBeginn.ToString().Contains("Inhaber"))
|
||||
if (dv.TMBeginn.ToString() == "TGEDKTagesdatumB99" || dv.TMBeginn.ToString().Contains("Inhaber"))
|
||||
{
|
||||
int a = 1;
|
||||
|
||||
|
||||
}
|
||||
if (dv.TMBeginn.ToString() != "" && dv.TMEnd.ToString() == "")
|
||||
{
|
||||
@@ -365,7 +365,7 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
// if ((dv.TMBeginn.ToString() == "TGEDKVornameNameLinksB99" || dv.TMBeginn.ToString() == "TGEDKVornameNameRechtsB99") && docdata.As_Faksimile == "True")
|
||||
if ((dv.TMBeginn.ToString().Contains("VornameNameLinks") || dv.TMBeginn.ToString().Contains("VornameNameRechts")) && docdata.As_Faksimile == "True" && (docdata.sign == true || serienbrief==true))
|
||||
if ((dv.TMBeginn.ToString().Contains("VornameNameLinks") || dv.TMBeginn.ToString().Contains("VornameNameRechts")) && docdata.As_Faksimile == "True" && (docdata.sign == true || serienbrief == true))
|
||||
{
|
||||
|
||||
if (dv.TMBeginn.ToString().Contains("VornameNameLinks"))
|
||||
@@ -377,7 +377,7 @@ namespace DOCGEN.Klassen
|
||||
unterschrift = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(get_unterschrift(docdata.Unterschrift_Links));
|
||||
}
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(),true);
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
if (docdata.Unterschrift_Links != "-1")
|
||||
{
|
||||
insert_signature(dv.TMBeginn.ToLower(), unterschrift, ref document);
|
||||
@@ -393,7 +393,7 @@ namespace DOCGEN.Klassen
|
||||
unterschrift = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(get_unterschrift(docdata.Unterschrift_Rechts));
|
||||
}
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(),true);
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
if (docdata.Unterschrift_Rechts != "-1")
|
||||
{
|
||||
insert_signature(dv.TMBeginn.ToLower(), unterschrift, ref document);
|
||||
@@ -403,38 +403,23 @@ namespace DOCGEN.Klassen
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dv.TMBeginn.ToString() == "TGEDKZustellungB99")
|
||||
if (dv.TMBeginn.ToString() == "TGEDKZustellungB99")
|
||||
{
|
||||
if (img_faktura != "")
|
||||
|
||||
{
|
||||
if (img_faktura != "")
|
||||
|
||||
{
|
||||
|
||||
insert_ppfaktura(document, img_faktura);
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
insert_ppfaktura(document, img_faktura);
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
|
||||
|
||||
//bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!dv.TMBeginn.ToString().Contains("TGEDKCursor"))
|
||||
{
|
||||
if (dv.TMBeginn.ToString().Contains("VornameName"))
|
||||
{
|
||||
int a = 1;
|
||||
}
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
//bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
}
|
||||
}
|
||||
|
||||
//bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -444,13 +429,28 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
int a = 1;
|
||||
}
|
||||
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
//bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!dv.TMBeginn.ToString().Contains("TGEDKCursor"))
|
||||
{
|
||||
if (dv.TMBeginn.ToString().Contains("VornameName"))
|
||||
{
|
||||
int a = 1;
|
||||
}
|
||||
|
||||
bookmarkNavigator.MoveToBookmark(dv.TMBeginn.ToString());
|
||||
//bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(dv.Value.ToString(), true);
|
||||
}
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
@@ -463,8 +463,8 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
if (!dv.TMBeginn.ToString().Contains("TGEDKCursor"))
|
||||
{
|
||||
|
||||
ReplaceBookmarkContent(ref document, dv.TMBeginn.ToString(), dv.TMEnd.ToString(), dv.Value.ToString(),serienbrief);
|
||||
|
||||
ReplaceBookmarkContent(ref document, dv.TMBeginn.ToString(), dv.TMEnd.ToString(), dv.Value.ToString(), serienbrief);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -551,9 +551,10 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
string phrase = dm.BookMark;
|
||||
string[] parts = phrase.Split(':');
|
||||
variable= parts[0];
|
||||
inhalt= parts[1];
|
||||
} else { }
|
||||
variable = parts[0];
|
||||
inhalt = parts[1];
|
||||
}
|
||||
else { }
|
||||
|
||||
|
||||
if (document.ProtectionType == ProtectionType.NoProtection)
|
||||
@@ -680,7 +681,7 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void ReplaceBookmarkContent(ref WordDocument document, String bookmark1, String bookmark2, String replacementContent, bool serienbrief)
|
||||
{
|
||||
@@ -689,7 +690,7 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
BookmarksNavigator bmn = new BookmarksNavigator(document);
|
||||
bmn.MoveToBookmark(bookmark1);
|
||||
bmn.InsertText(replacementContent+" "); return;
|
||||
bmn.InsertText(replacementContent + " "); return;
|
||||
|
||||
}
|
||||
|
||||
@@ -701,7 +702,7 @@ namespace DOCGEN.Klassen
|
||||
//Get the bookmark instance by using FindByName method of BookmarkCollection with bookmark name.
|
||||
Bookmark firstBookmark = document.Bookmarks.FindByName(bookmark1);
|
||||
//Access the bookmark end’s owner paragraph by using bookmark.
|
||||
|
||||
|
||||
//BookmarksNavigator bmn = new BookmarksNavigator(document);
|
||||
//bmn.MoveToBookmark(bookmark1);
|
||||
//TextBodyPart tbp = bmn.GetBookmarkContent();
|
||||
@@ -957,7 +958,7 @@ namespace DOCGEN.Klassen
|
||||
System.Drawing.Image barcodeimage2;
|
||||
barcodeimage2 = barcodeimage;
|
||||
|
||||
|
||||
|
||||
|
||||
WPicture picture = new WPicture(document);
|
||||
WPicture picture2 = new WPicture(document);
|
||||
@@ -1010,15 +1011,21 @@ namespace DOCGEN.Klassen
|
||||
//foreach (IWSection section in document.Sections)
|
||||
//{
|
||||
IWSection section = document.Sections[0];
|
||||
if (section.PageSetup.DifferentFirstPage == true)
|
||||
if (section.PageSetup.DifferentFirstPage == true)
|
||||
{
|
||||
|
||||
WParagraph FirstfooterPar = new WParagraph(document);
|
||||
FirstfooterPar.ChildEntities.Add(picture);
|
||||
if (section.HeadersFooters.FirstPageFooter.Paragraphs.Count > 0)
|
||||
{
|
||||
WParagraph FirstfooterPar = new WParagraph(document);
|
||||
FirstfooterPar.ChildEntities.Add(picture);
|
||||
section.HeadersFooters.FirstPageFooter.Paragraphs.Add(FirstfooterPar);
|
||||
section.HeadersFooters.FirstPageFooter.Paragraphs.RemoveAt(section.HeadersFooters.FirstPageFooter.Paragraphs.Count - 1);
|
||||
}
|
||||
WParagraph footerPar = new WParagraph(document);
|
||||
footerPar.ChildEntities.Add(picture2);
|
||||
section.HeadersFooters.Footer.Paragraphs.Add(footerPar);
|
||||
section.HeadersFooters.FirstPageFooter.Paragraphs.Add(FirstfooterPar);
|
||||
}
|
||||
WParagraph footerPar = new WParagraph(document);
|
||||
footerPar.ChildEntities.Add(picture2);
|
||||
if (section.HeadersFooters.Footer.Count > 0) { section.HeadersFooters.Footer.Paragraphs.RemoveAt(section.HeadersFooters.Footer.Paragraphs.Count-1); }
|
||||
section.HeadersFooters.Footer.Paragraphs.Add(footerPar);
|
||||
//}
|
||||
}
|
||||
public void xInsert_Barcode(WordDocument document, clsDocData docData)
|
||||
@@ -1041,7 +1048,7 @@ namespace DOCGEN.Klassen
|
||||
|
||||
if (docData.barcode_horizontal == 0)
|
||||
{
|
||||
barcodeimage = barbarcode.GetBarI25(Color.Black, Color.White, docData.Dokumentid.Substring(6, 16), "Bar 25i c HR", 66, 600, 100, docData.barcode_zusatz, "Futur Book", 16,0);
|
||||
barcodeimage = barbarcode.GetBarI25(Color.Black, Color.White, docData.Dokumentid.Substring(6, 16), "Bar 25i c HR", 66, 600, 100, docData.barcode_zusatz, "Futur Book", 16, 0);
|
||||
//barcodeimage = barbarcode.GetBarI25(Color.Black, Color.White, docData.Dokumentid.Substring(6, 16), "Bar 25i c HR", 33, 429, 52, docData.barcode_zusatz, "Futur Book", 8, 270);
|
||||
|
||||
}
|
||||
@@ -1083,7 +1090,7 @@ namespace DOCGEN.Klassen
|
||||
|
||||
WPicture picture = new WPicture(document);
|
||||
picture.LoadImage(barcodeimage);
|
||||
|
||||
|
||||
//picture.Height = docData.barcode_height;
|
||||
|
||||
//picture.Width = docData.barcode_width;
|
||||
@@ -1121,8 +1128,8 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
if (docData.barcode_type == "0")
|
||||
{
|
||||
// picture.Width = docData.barcode_width;
|
||||
// picture.Height = docData.barcode_height;
|
||||
// picture.Width = docData.barcode_width;
|
||||
// picture.Height = docData.barcode_height;
|
||||
|
||||
}
|
||||
WPicture picture2 = new WPicture(document);
|
||||
|
||||
Reference in New Issue
Block a user