update 20241210
This commit is contained in:
@@ -53,9 +53,10 @@ namespace DOCGEN.Klassen
|
||||
|
||||
public bool create_nativ(string property, string value, string base64, string originalfile, string destfile)
|
||||
{
|
||||
FileStream ms = new FileStream(originalfile, FileMode.Open, FileAccess.Read);
|
||||
//FileStream ms = new FileStream(@originalfile, FileMode.Open, FileAccess.Read);
|
||||
WordDocument document = new WordDocument();
|
||||
document.Open(ms, FormatType.Automatic);
|
||||
document.Open(@originalfile,FormatType.Automatic);
|
||||
//document.Open(ms, FormatType.Automatic);
|
||||
try {
|
||||
document.CustomDocumentProperties.Add(property, value);
|
||||
}
|
||||
@@ -66,16 +67,21 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
|
||||
TextSelection[] textSelections = document.FindAll("{" + property + "}", false, true);
|
||||
foreach (TextSelection textSelection in textSelections)
|
||||
try
|
||||
{
|
||||
//Gets the found text as single text range and sets highlight color
|
||||
WTextRange textRange = textSelection.GetAsOneRange();
|
||||
textRange.Text = value;
|
||||
foreach (TextSelection textSelection in textSelections)
|
||||
{
|
||||
//Gets the found text as single text range and sets highlight color
|
||||
WTextRange textRange = textSelection.GetAsOneRange();
|
||||
textRange.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
catch { }
|
||||
|
||||
Logging.Logging.Debug("Create Native: " + destfile, "Ondoc", "");
|
||||
document.UpdateDocumentFields();
|
||||
document.Save(destfile);
|
||||
ms.Close();
|
||||
//ms.Close();
|
||||
document.Dispose();
|
||||
return true;
|
||||
|
||||
@@ -612,7 +618,7 @@ namespace DOCGEN.Klassen
|
||||
case "0":
|
||||
//int rotation = 0;
|
||||
//if (docData.barcode_horizontal == 0) { rotation = 270; }
|
||||
barcodeimage = Barcode.Get_LinerBarcode(Barcoded.Symbology.I2of5, docData.Dokumentid.Substring(6, 16), docData.Dokumentid.Substring(6, 16)+docData.barcode_zusatz, docData.barcode_textposition, docData.barcode_font, Convert.ToInt32(docData.barcode_fontsize),0);
|
||||
barcodeimage = Barcode.Get_LinerBarcode(Barcoded.Symbology.I2of5, docData.Dokumentid.Substring(6, 16), docData.Dokumentid.Substring(6, 16)+docData.barcode_zusatz, docData.barcode_textposition, docData.Zusatz_Font, Convert.ToInt32(docData.Zusatz_FontSize),0);
|
||||
break;
|
||||
case "1":
|
||||
|
||||
@@ -676,47 +682,6 @@ namespace DOCGEN.Klassen
|
||||
Syncfusion.DocIO.DLS.IWParagraph paragraph = section.Body.LastParagraph;
|
||||
if (paragraph != null)
|
||||
paragraph.ChildEntities.Add(picture);
|
||||
//WPicture picture2 = new WPicture(document);
|
||||
//picture2.LoadImage(barcodeimage);
|
||||
//picture2.Height = docData.barcode_height;
|
||||
//picture2.Width = docData.barcode_width;
|
||||
|
||||
//picture2.VerticalPosition = docData.barcode_left;
|
||||
//picture2.HorizontalPosition = docData.barcode_top/2;
|
||||
//picture2.HorizontalOrigin = HorizontalOrigin.Page;
|
||||
//picture2.VerticalOrigin = VerticalOrigin.Margin;
|
||||
//picture2.TextWrappingStyle = TextWrappingStyle.Square;
|
||||
//if (docData.barcode_horizontal == 0)
|
||||
//{
|
||||
// picture2.Rotation = 270;
|
||||
// picture2.Height = docData.barcode_width - 10;
|
||||
// picture2.Width = docData.barcode_height - 40;
|
||||
// picture2.VerticalPosition = 650; ;
|
||||
// picture2.HorizontalPosition = -50;
|
||||
|
||||
// picture2.Height = docData.barcode_height;
|
||||
// picture2.Width = docData.barcode_width;
|
||||
// picture2.VerticalPosition = docData.barcode_top; ;
|
||||
// picture2.HorizontalPosition = docData.barcode_left;
|
||||
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// picture2.Rotation = 0;
|
||||
// //picture.Height = docData.barcode_height - 10;
|
||||
// //picture.Width = docData.barcode_width - 60;
|
||||
// //picture.VerticalPosition = docData.barcode_top+10; ;
|
||||
// //picture.HorizontalPosition = docData.barcode_left;
|
||||
// picture2.Height = docData.barcode_height;
|
||||
// picture2.Width = docData.barcode_width;
|
||||
// picture2.VerticalPosition = docData.barcode_top; ;
|
||||
// picture2.HorizontalPosition = docData.barcode_left;
|
||||
|
||||
//}
|
||||
//Insert image in Header and Footer of section
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user