Update 20260514
This commit is contained in:
@@ -247,11 +247,13 @@ namespace DOCGEN.Klassen
|
||||
case "8":
|
||||
case "9":
|
||||
case "10":
|
||||
|
||||
case "13":
|
||||
case "14":
|
||||
case "15":
|
||||
case "16":
|
||||
case "18":
|
||||
case "20":
|
||||
try
|
||||
{
|
||||
if (item.itemvalue == "x") { item.itemvalue = "X"; }
|
||||
@@ -1052,6 +1054,63 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Insert_Image(ref WordDocument document, string bookmark, string image, string ileft="", string itop="", string iwidth="", string iheight="")
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
Syncfusion.DocIO.DLS.Bookmark bm = document.Bookmarks[bookmark];
|
||||
|
||||
|
||||
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(image));
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
if (ileft == "") {ileft = "0";}
|
||||
if (itop=="") { itop="0";}
|
||||
if (iwidth == "") { iwidth = img.Width.ToString(); }
|
||||
if (iheight == "") { iheight = img.Height.ToString(); }
|
||||
System.Drawing.Image img1 = Resize(img, Convert.ToInt32(iwidth), Convert.ToInt32(iheight), true, true);
|
||||
|
||||
int iitop = Convert.ToInt32(itop) * -1;
|
||||
|
||||
int top = Convert.ToInt32(Convert.ToInt32(iitop) + Convert.ToInt32(img1.Height));
|
||||
|
||||
top = Convert.ToInt32(Convert.ToInt32(itop));
|
||||
int height = Convert.ToInt32(Convert.ToInt32(img1.Height));
|
||||
|
||||
|
||||
int left = Convert.ToInt32(Convert.ToInt32(ileft));
|
||||
int width = Convert.ToInt32(Convert.ToInt32(img1.Width));
|
||||
|
||||
Shape signature = bm.BookmarkStart.OwnerParagraph.AppendShape(Syncfusion.DocIO.DLS.AutoShapeType.Rectangle, Convert.ToInt32(img1.Width), Convert.ToInt32(img1.Height));
|
||||
signature.TextFrame.InternalMargin.Top = 0;
|
||||
signature.TextFrame.InternalMargin.Left = 0;
|
||||
signature.TextFrame.InternalMargin.Bottom = 0;
|
||||
signature.TextFrame.InternalMargin.Right = 0;
|
||||
|
||||
|
||||
//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.WrapFormat.AllowOverlap = true;
|
||||
signature.WrapFormat.TextWrappingStyle = TextWrappingStyle.Behind;
|
||||
signature.HorizontalPosition = signature.HorizontalPosition + left;
|
||||
signature.VerticalPosition = signature.VerticalPosition - top;
|
||||
|
||||
IWPicture p = sigparagraph.AppendPicture(img);
|
||||
p.Width = Convert.ToInt32(img1.Width);
|
||||
p.Height = Convert.ToInt32(img1.Height); ;
|
||||
//signature.Name = "Unterschrift_" + bookmark;
|
||||
img = null;
|
||||
img1 = null;
|
||||
bm = null;
|
||||
mssign = null;
|
||||
signature = null;
|
||||
}
|
||||
private void Insert_CLMImage(CLMDocItem item, ref WordDocument document, Boolean inline = false, Boolean multiimages = false)
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
@@ -1560,7 +1619,7 @@ namespace DOCGEN.Klassen
|
||||
|
||||
}
|
||||
}
|
||||
if (apivalue.Type == "Absatz")
|
||||
if (apivalue.Type == "Absatz" || apivalue.Type=="Image")
|
||||
{
|
||||
if (apivalue.Value != "Ja")
|
||||
{
|
||||
@@ -1572,6 +1631,20 @@ namespace DOCGEN.Klassen
|
||||
document.Bookmarks.Remove(bookmark);
|
||||
|
||||
}
|
||||
if (apivalue.Type == "Image")
|
||||
{
|
||||
try
|
||||
{
|
||||
// string[] imagesize = apivalue.ImageSize.Split(',');
|
||||
// Insert_Image(ref document, apivalue.Tag, apivalue.Value, imagesize[0], imagesize[1], imagesize[2], imagesize[3]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Insert_Image(ref document, apivalue.Tag, apivalue.Value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1596,6 +1669,7 @@ namespace DOCGEN.Klassen
|
||||
if (!apivalue.Value.Contains("<pdel;"))
|
||||
{
|
||||
apivalue.Value=apivalue.Value.Replace("\n", Environment.NewLine);
|
||||
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
bookmarkNavigator.MoveToBookmark(apivalue.Tag);
|
||||
bookmarkNavigator.ReplaceBookmarkContent(apivalue.Value, true);
|
||||
|
||||
Reference in New Issue
Block a user