Update 20260529
This commit is contained in:
@@ -3,52 +3,74 @@
|
||||
{
|
||||
"key": "Ondoc_Versandstrasse_Paket",
|
||||
"displayName": "Ondoc_Versandstrasse_Paket",
|
||||
"sqlList": "SELECT ID, erstellt_am as Name from Ondoc_Versandstrasse_Paket order by Id desc",
|
||||
"sqlList": "SELECT ID, convert(varchar(10),erstellt_am,104)+' '+' ' + convert(VARCHAR(8), erstellt_am, 14) as Erstellt_am, convert(varchar(10),versendet_am,104)+' '+' ' + convert(VARCHAR(8), versendet_am, 14) as Versendet_am, Ersteller, Aktiv, isnull(signed,1) as Signed from Ondoc_Versandstrasse_Paket [FILTER] order by Id desc",
|
||||
"sqlById": "SELECT paket as JsonData from Ondoc_Versandstrasse_Paket where id= @id ",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "JsonData",
|
||||
"Buttons": "Öffnen;PaketAnzeige",
|
||||
"AnzeigeDokument": "SELECT paket as JsonData from Ondoc_Versandstrasse_Paket where id= @id ",
|
||||
"FilterColumns": ""
|
||||
"AnzeigeDokument": "Select paket as JsonData from Ondoc_versandstrasse_paket where id=@id",
|
||||
"FilterColumns": "ID"
|
||||
},
|
||||
{
|
||||
"key": "NLOGApiDoc",
|
||||
"displayName": "APIDoc",
|
||||
"sqlList": "SELECT ID, CreatedOn, GUID from edoka_journale.dbo.nlogapidoc where message='Input JSON' and isnull(div,'')<>'' order by Id desc",
|
||||
"key": "APIDokumente",
|
||||
"displayName": "API-Dokumente/Pakete",
|
||||
"sqlList": "SELECT ID, Erstellt_am, GUID from edoka_journale.dbo.view_api_dokumente [FILTER] order by Id desc",
|
||||
"sqlById": "SELECT div as JsonData from edoka_journale.dbo.nlogapidoc where id= @id ",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "JsonData",
|
||||
"Buttons": "Öffnen;DokumenteAnzeigen",
|
||||
"Buttons": "Öffnen",
|
||||
"AnzeigeDokument": "SELECT EDOKA.dbo.BinaryToBase64(EDOKA.dbo.Doks.Dokument) FROM edoka_journale.dbo.NLOGApiDoc INNER JOIN EDOKA.dbo.Doks ON edoka_journale.dbo.NLOGApiDoc.Div COLLATE SQL_Latin1_General_CP1_CI_AS = EDOKA.dbo.Doks.DokumentID WHERE edoka_journale.dbo.NLOGApiDoc.GUID = @id AND edoka_journale.dbo.NLOGApiDoc.Div LIKE 'OFFEDK%'",
|
||||
"FilterColumns": "ID;GUID"
|
||||
},
|
||||
{
|
||||
"key": "APIArchivierung",
|
||||
"displayName": "API-Archivierung",
|
||||
"sqlList": "SELECT ID, Erstellt_am, GUID from edoka_journale.dbo.View_API_Archivierung [FILTER] order by Id desc",
|
||||
"sqlById": "SELECT div as JsonData from edoka_journale.dbo.nlogapidoc where id= @id ",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "JsonData",
|
||||
"Buttons": "Öffnen",
|
||||
"AnzeigeDokument": "",
|
||||
"FilterColumns": "id;GUID"
|
||||
|
||||
"FilterColumns": "ID;GUID"
|
||||
},
|
||||
{
|
||||
"key": "NLOGApiDoc",
|
||||
"displayName": "API-NLOGApiDoc - last 500",
|
||||
"sqlList": "SELECT top 500 [id],[Origin],[Message],[LogLevel],[CreatedOn],[UserID],case when len([Div])>30 then substring(div,1,27)+'...' else [div] end as DIV,[GUID] from edoka_journale.dbo.NLOGApiDoc [FILTER] order by id desc",
|
||||
"sqlById": "",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "JsonData",
|
||||
"Buttons": "",
|
||||
"AnzeigeDokument": "",
|
||||
"FilterColumns": "ID;GUID"
|
||||
},
|
||||
{
|
||||
"key": "CLMDokumente",
|
||||
"displayName": "CLM-Dokumente",
|
||||
"sqlList": "SELECT ID, clmdokumentid as CLM_ID, GUID, Erstellt_Am, Aktiv, Archivstatus, Archiviert from ondoc_clm_dokumente [FILTER] order by Id desc",
|
||||
"sqlList": "SELECT ID, clmdokumentid as CLM_ID, GUID, convert(varchar(10),erstellt_am,104)+' '+' ' + convert(VARCHAR(8), erstellt_am, 14) as Erstellt_am , Aktiv, Archivstatus, Archiviert from ondoc_clm_dokumente [FILTER] order by Id desc",
|
||||
"sqlById": "SELECT jsondata as JsonData from ondoc_clm_dokumente where id= @id ",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "JsonData",
|
||||
"Buttons": "Öffnen;Anzeigen",
|
||||
"AnzeigeDokument": "SELECT dbo.BinaryToBase64(dokument) FROM dbo.OnDoc_CLM_Dokumente INNER JOIN dbo.Doks ON dbo.OnDoc_CLM_Dokumente.dokumentid = dbo.Doks.DokumentID where dbo.ondoc_clm_dokumente.id=@id",
|
||||
"FilterColumns": "clmdokumentid;archivstatus"
|
||||
"FilterColumns": "clmdokumentid;guid;archivstatus"
|
||||
},
|
||||
{
|
||||
"key": "CLMJournal",
|
||||
"displayName": "CLM-Journal",
|
||||
"sqlList": "SELECT ID, clmdokumentid as CLM_ID, Dokumentid, GUID, Erstellt_Am, Aktiv, Archivstatus, Archiviert, Archiviert_am from ondoc_clm_dokumente [FILTER] order by Id desc",
|
||||
"sqlById": " ",
|
||||
"sqlList": "SELECT ID, clmdokumentid as CLM_ID, Dokumentid, GUID, convert(varchar(10),erstellt_am,104)+' '+' ' + convert(VARCHAR(8), erstellt_am, 14) as Erstellt_am, Aktiv, Archivstatus, Archiviert, isnull(convert(varchar(10),archiviert_am,104)+' '+ convert(VARCHAR(8), archiviert_am, 14) ,'') as Archiviert_am from ondoc_clm_dokumente [FILTER] order by Id desc",
|
||||
"sqlById": "",
|
||||
"idField": "ID",
|
||||
"displayField": "ID",
|
||||
"jsonField": "",
|
||||
"Buttons": "Anzeigen",
|
||||
"AnzeigeDokument": "SELECT dbo.BinaryToBase64(dokument) FROM dbo.OnDoc_CLM_Dokumente INNER JOIN dbo.Doks ON dbo.OnDoc_CLM_Dokumente.dokumentid = dbo.Doks.DokumentID where dbo.ondoc_clm_dokumente.id=@id",
|
||||
"FilterColumns": "clmdokumentid;archivstatus;dokumentid"
|
||||
"FilterColumns": "clmdokumentid;guid;archivstatus;dokumentid"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
function generateFromJson() {
|
||||
|
||||
var jsonText = editor.getValue();
|
||||
alert("Hallo");
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -323,15 +323,24 @@
|
||||
"Authorization": "Bearer " + "pZkuG6l6ORCEckqQimPK58PO1A9EnkMtL5oCgRX9WiWnD4xeH7ikGzhWnTBy/vk8J4Iiz8gCSx9uFHA4+DvITG0roO97sk82d/0BCjVlwLWINpXlJfGYEF3X96AdoCQvb3ruwv/tVqEHsSU5aNfyxBAe+EhLTHQ8t7ysgJZWh98="
|
||||
},
|
||||
success: function (response) {
|
||||
var pdfWindow = window.open("");
|
||||
pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + response.file + "'></iframe>");
|
||||
//alert("Server Response: " + response.file);
|
||||
|
||||
PageMethods.SaveTempFile(
|
||||
response.file,
|
||||
function (response) {
|
||||
window.open("/PDFViewer.aspx", "_blank").focus();
|
||||
var a = 1;
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
error: function (err) {
|
||||
alert("Error: " + err.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showDoc(tableKey, id) {
|
||||
@@ -339,15 +348,20 @@
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
var pdfWindow = window.open("");
|
||||
pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + result + "'></iframe>");
|
||||
PageMethods.SaveTempFile(
|
||||
result,
|
||||
function (result) {
|
||||
window.open("/PDFViewer.aspx", "_blank").focus();
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
|
||||
alert(err.get_message())
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
function loadJson(tableKey, id) {
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http.Results;
|
||||
@@ -203,10 +204,25 @@ namespace WebApp
|
||||
con.Open();
|
||||
string doc = cmd.ExecuteScalar()?.ToString();
|
||||
con.Close();
|
||||
System.IO.File.WriteAllBytes(@"d:\apps\ondoc\admintemp\vp.pdf", Convert.FromBase64String(doc));
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
[WebMethod]
|
||||
public static object SaveTempFile(string base64)
|
||||
{
|
||||
var ms = new MemoryStream(Convert.FromBase64String(base64));
|
||||
using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\vp.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
{
|
||||
byte[] bytes = new byte[ms.Length];
|
||||
ms.Read(bytes, 0, (int)ms.Length);
|
||||
file.Write(bytes, 0, bytes.Length);
|
||||
ms.Close();
|
||||
}
|
||||
return "OK";
|
||||
|
||||
}
|
||||
[WebMethod]
|
||||
public static object GetJson(string table, string id)
|
||||
{
|
||||
var config = TableConfigProvider.LoadConfig();
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<script src="/Scripts/ace/ext-searchbox.js"></script>
|
||||
<link href="/Content/bootstrap.min.css" ref="stylesheet" />
|
||||
<link href="/Scripts/bootstrap532.min.js" rel="stylesheet" />
|
||||
<%--<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />--%>
|
||||
<%--<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />--%>
|
||||
<%--<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>--%>
|
||||
<%--<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.23.4/ace.js"></script>--%>
|
||||
<%--<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.23.4/ace.js"></script>--%>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
@@ -159,7 +159,7 @@ padding-bottom:20px;
|
||||
|
||||
<!-- TITEL LINKS -->
|
||||
<span class="navbar-brand">OnDoc-JSON-Viewer
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
||||
<div class="ms-auto d-flex gap-2">
|
||||
@@ -169,7 +169,7 @@ padding-bottom:20px;
|
||||
Generieren
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -279,55 +279,55 @@ padding-bottom:20px;
|
||||
"Authorization": "Bearer " + "pZkuG6l6ORCEckqQimPK58PO1A9EnkMtL5oCgRX9WiWnD4xeH7ikGzhWnTBy/vk8J4Iiz8gCSx9uFHA4+DvITG0roO97sk82d/0BCjVlwLWINpXlJfGYEF3X96AdoCQvb3ruwv/tVqEHsSU5aNfyxBAe+EhLTHQ8t7ysgJZWh98="
|
||||
},
|
||||
success: function (response) {
|
||||
var pdfWindow = window.open("");
|
||||
pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + response.file + "'></iframe>");
|
||||
|
||||
},
|
||||
|
||||
PageMethods.SaveTempFile(
|
||||
response.file,
|
||||
function (response) {
|
||||
window.open("/PDFViewer.aspx", "_blank").focus();
|
||||
var a = 1;
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
error: function (err) {
|
||||
alert("Error: " + err.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showDoc(tableKey, id) {
|
||||
PageMethods.GetDoc(
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
var pdfWindow = window.open("");
|
||||
pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + result + "'></iframe>");
|
||||
},
|
||||
function (err) {
|
||||
PageMethods.GetDoc(
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
PageMethods.SaveTempFile(
|
||||
result,
|
||||
function (result) {
|
||||
window.open("/PDFViewer.aspx", "_blank").focus();
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
alert(err.get_message())
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
function showAPIDocs(tableKey, id) {
|
||||
PageMethods.gwrAPIDocs(
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
var pdfWindow = window.open("");
|
||||
pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + result + "'></iframe>");
|
||||
},
|
||||
function (err) {
|
||||
|
||||
alert(err.get_message())
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
function showPacDoc(tableKey, id) {
|
||||
PageMethods.GetPacDoc(
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
window.open("\PDFViewer.aspx", '_blank').focus();
|
||||
//var pdfWindow = window.open("");
|
||||
//pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64," + result + "'></iframe>");
|
||||
window.open("\PDFViewer.aspx", '_blank').focus();
|
||||
|
||||
},
|
||||
function (err) {
|
||||
|
||||
@@ -336,6 +336,26 @@ padding-bottom:20px;
|
||||
);
|
||||
|
||||
}
|
||||
function showPacDoc(tableKey, id) {
|
||||
PageMethods.GetPacDoc(
|
||||
tableKey,
|
||||
id,
|
||||
function (result) {
|
||||
PageMethods.SaveTempFile(
|
||||
result,
|
||||
function (result) {
|
||||
window.open("/PDFViewer.aspx", "_blank").focus();
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
alert(err.get_message());
|
||||
}
|
||||
);
|
||||
}
|
||||
function loadJson(tableKey, id) {
|
||||
|
||||
editor.setValue("// lade JSON ...", -1);
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace WebApp
|
||||
string doc = cmd.ExecuteScalar()?.ToString();
|
||||
con.Close();
|
||||
var ms1 = new MemoryStream(Convert.FromBase64String(doc));
|
||||
using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\" + prefix + dr[2].ToString() + ".pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\vp.pdf" , System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
{
|
||||
byte[] bytes = new byte[ms1.Length];
|
||||
ms1.Read(bytes, 0, (int)ms1.Length);
|
||||
@@ -295,21 +295,35 @@ namespace WebApp
|
||||
|
||||
Versandpaket vp = JsonConvert.DeserializeObject<Versandpaket>(dt.Rows[0][0].ToString());
|
||||
var b64 = vp.finaldoc;
|
||||
var ms = new MemoryStream(Convert.FromBase64String(b64));
|
||||
using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\vp.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
{
|
||||
byte[] bytes = new byte[ms.Length];
|
||||
ms.Read(bytes, 0, (int)ms.Length);
|
||||
file.Write(bytes, 0, bytes.Length);
|
||||
ms.Close();
|
||||
}
|
||||
//var ms = new MemoryStream(Convert.FromBase64String(b64));
|
||||
//using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\vp.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
//{
|
||||
// byte[] bytes = new byte[ms.Length];
|
||||
// ms.Read(bytes, 0, (int)ms.Length);
|
||||
// file.Write(bytes, 0, bytes.Length);
|
||||
// ms.Close();
|
||||
//}
|
||||
//System.Diagnostics.Process.Start(@"d:\apps\ondoc\admintemp\vp.pdf");
|
||||
//System.IO.File.Delete("d:\\ondoc\\temp\\vp.pdf");
|
||||
|
||||
return "";
|
||||
return b64;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public static object SaveTempFile(string base64)
|
||||
{
|
||||
var ms = new MemoryStream(Convert.FromBase64String(base64));
|
||||
using (System.IO.FileStream file = new System.IO.FileStream(@"d:\apps\ondoc\admintemp\vp.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write))
|
||||
{
|
||||
byte[] bytes = new byte[ms.Length];
|
||||
ms.Read(bytes, 0, (int)ms.Length);
|
||||
file.Write(bytes, 0, bytes.Length);
|
||||
ms.Close();
|
||||
}
|
||||
return "OK";
|
||||
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public static object GetDoc(string table, string id)
|
||||
{
|
||||
@@ -323,7 +337,7 @@ namespace WebApp
|
||||
con.Open();
|
||||
string doc = cmd.ExecuteScalar()?.ToString();
|
||||
con.Close();
|
||||
|
||||
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -283,7 +283,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABm
|
||||
DgAAAk1TRnQBSQFMAgEBCAEAAdABAQHQAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
DgAAAk1TRnQBSQFMAgEBCAEAAdgBAQHYAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,6 +49,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
|
||||
|
||||
@@ -1011,7 +1012,14 @@ namespace DOCGEN.Klassen
|
||||
return dest;// bmp.Save(outputPath, jpgEncoder, encParams);
|
||||
}
|
||||
}
|
||||
|
||||
public static System.Drawing.Image resizeImage1(System.Drawing.Image image, int new_height, int new_width)
|
||||
{
|
||||
Bitmap new_image = new Bitmap(new_width, new_height);
|
||||
Graphics g = Graphics.FromImage((System.Drawing.Image)new_image);
|
||||
g.InterpolationMode = InterpolationMode.High;
|
||||
g.DrawImage(image, 0, 0, new_width, new_height);
|
||||
return new_image;
|
||||
}
|
||||
private void Insert_CLMImages(CLMDocItem item, ref WordDocument document, Boolean inline = false)
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
@@ -1032,15 +1040,31 @@ namespace DOCGEN.Klassen
|
||||
dt = (DataTable)JsonConvert.DeserializeObject(item.itemvalue, (typeof(DataTable)));
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(dr[0].ToString()));
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
if (Convert.ToInt32(item.width) != 0 || Convert.ToInt32(item.height) != 0)
|
||||
{
|
||||
// img = Resize(img, Convert.ToInt32(item.width), Convert.ToInt32(item.width)), true, true);
|
||||
img = Resize1(img, "", Convert.ToInt32(item.width), Convert.ToInt32(item.height));
|
||||
}
|
||||
|
||||
paragraph.AppendPicture(img);
|
||||
MemoryStream mssign = new MemoryStream(Convert.FromBase64String(dr[0].ToString()));
|
||||
|
||||
|
||||
System.Drawing.Image img = System.Drawing.Image.FromStream(mssign);
|
||||
WPicture picture = paragraph.AppendPicture(img) as WPicture;
|
||||
IWSection section = document.Sections[0];
|
||||
|
||||
float clientWidth = section.PageSetup.ClientWidth;
|
||||
float clientHeight = section.PageSetup.PageSize.Height - section.PageSetup.Margins.Top - section.PageSetup.Margins.Bottom;
|
||||
float scalePer = 0;
|
||||
if (Convert.ToInt32(item.width)>0) { clientWidth = Convert.ToInt32(item.width); }
|
||||
if (picture.Width > clientWidth)
|
||||
{
|
||||
scalePer = clientWidth / img.Width * 100;
|
||||
}
|
||||
else if (picture.Height > clientHeight)
|
||||
{
|
||||
scalePer = clientHeight / img.Height * 100;
|
||||
}
|
||||
|
||||
picture.WidthScale = scalePer;
|
||||
picture.HeightScale = scalePer;
|
||||
|
||||
|
||||
mssign = null;
|
||||
img = null;
|
||||
}
|
||||
@@ -1048,6 +1072,7 @@ namespace DOCGEN.Klassen
|
||||
paragraph = null;
|
||||
bookmarkNavigator = null;
|
||||
dt = null;
|
||||
//document.Save(@"x:\doc.docx");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1112,6 +1137,37 @@ namespace DOCGEN.Klassen
|
||||
mssign = null;
|
||||
signature = null;
|
||||
}
|
||||
|
||||
public System.Drawing.Image ResizeImageG(System.Drawing.Image inputimg, int targetWidth, int targetHeight, long jpegQuality = 85L)
|
||||
{
|
||||
// 1. Ursprungsbild laden
|
||||
using (System.Drawing.Image originalImage = inputimg)
|
||||
{
|
||||
// 2. Ziel-Bitmap mit den neuen Maßen erstellen
|
||||
using (Bitmap destImage = new Bitmap(targetWidth, targetHeight))
|
||||
{
|
||||
// Auflösung beibehalten (wichtig für die Druckqualität)
|
||||
destImage.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
|
||||
|
||||
// 3. Graphics-Objekt für höchste Qualität konfigurieren
|
||||
using (Graphics graphics = Graphics.FromImage(destImage))
|
||||
{
|
||||
graphics.CompositingMode = CompositingMode.SourceCopy;
|
||||
graphics.CompositingQuality = CompositingQuality.HighQuality;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.SmoothingMode = SmoothingMode.HighQuality;
|
||||
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
// Bild auf das neue Graphics-Objekt zeichnen
|
||||
graphics.DrawImage(originalImage, new Rectangle(0, 0, targetWidth, targetHeight),
|
||||
new Rectangle(0, 0, originalImage.Width, originalImage.Height),
|
||||
GraphicsUnit.Pixel);
|
||||
return destImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private void Insert_CLMImage(CLMDocItem item, ref WordDocument document, Boolean inline = false, Boolean multiimages = false)
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user