update 20241206

This commit is contained in:
Stefan Hutter
2024-12-06 21:38:12 +01:00
parent 9dccb8be8f
commit 8ade484063
187 changed files with 60608 additions and 705 deletions

View File

@@ -11,6 +11,10 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Office;
using System.Threading;
using System.Drawing;
using Font = System.Drawing.Font;
using System.Xml.Linq;
using BarcodeLib;
namespace OnDocOffice
{
@@ -367,21 +371,106 @@ namespace OnDocOffice
word.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekCurrentPageHeader;
}
}
private void Generate_Barcodes(ref clsDocData docdata)
public void Insert_Datamatrix(string filename)
{
object Form;
string strsel;
object strresult;
string s;
int dmposition;
// Selection.ShapeRange.Select
try
{
//object missing = System.Reflection.Missing.Value;
//object start1 = 0;
//object end1 = 0;
//Document adoc = word.Documents.Add(ref missing, ref missing, ref missing, ref missing);
//Microsoft.Office.Interop.Word.Range rng = adoc.Range(ref start1, ref missing);
string Zeichen;
Zeichen = " U";
int BarcodeFormatn = 0;
switch (BarcodeFormatn)
{
case 0:
{
word.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight;
word.Selection.HomeKey(Unit: Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend: Microsoft.Office.Interop.Word.WdMovementType.wdExtend);
word.Selection.Delete(Unit: Microsoft.Office.Interop.Word.WdUnits.wdCharacter, Count: 1);
word.Selection.InlineShapes.AddPicture(filename, LinkToFile: false, SaveWithDocument: true);
break;
}
case 1:
{
word.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
word.Selection.HomeKey(Unit: Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend: Microsoft.Office.Interop.Word.WdMovementType.wdExtend);
word.Selection.Delete(Unit: Microsoft.Office.Interop.Word.WdUnits.wdCharacter, Count: 1);
word.Selection.InlineShapes.AddPicture(filename, LinkToFile: false, SaveWithDocument: true);
break;
}
case 2:
{
word.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
word.Selection.HomeKey(Unit: Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend: Microsoft.Office.Interop.Word.WdMovementType.wdExtend);
word.Selection.Delete(Unit: Microsoft.Office.Interop.Word.WdUnits.wdCharacter, Count: 1);
word.Selection.InlineShapes.AddPicture(filename, LinkToFile: false, SaveWithDocument: true);
break;
}
case 3:
{
word.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft;
word.Selection.HomeKey(Unit: Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend: Microsoft.Office.Interop.Word.WdMovementType.wdExtend);
word.Selection.Delete(Unit: Microsoft.Office.Interop.Word.WdUnits.wdCharacter, Count: 1);
word.Selection.InlineShapes.AddPicture(filename, LinkToFile: false, SaveWithDocument: true);
break;
}
}
Form = null;
return;
}
catch (Exception ex)
{
}
}
private void Generate_Barcodes(ref clsDocData docdata)
{
float left = 360;
float top = 793;
float width = 200;
float width = 200;
float height = 33;
word.Selection.HomeKey(Unit: Microsoft.Office.Interop.Word.WdUnits.wdStory);
Microsoft.Office.Interop.Word.WdStatistic stat = Microsoft.Office.Interop.Word.WdStatistic.wdStatisticPages;
int pages = worddoc.ComputeStatistics(stat, null);
for (int i = 1; i < pages; i++)
for (int i = 1; i <= pages; i++)
{
string xname = i.ToString().Trim();
word.Selection.GoTo(What:Microsoft.Office.Interop.Word.WdGoToItem.wdGoToPage,xname);
HeaderFooterAnzeigen();
if (docdata.barcode_type == "1")
{
System.Drawing.Image barcodeimage;
BarcodeLib.Barcode Barcode = new BarcodeLib.Barcode();
barcodeimage = Barcode.Get_Datamatrix(DataMatrix.net.DmtxScheme.DmtxSchemeAscii, docdata.barcode_content, 6, 6, 0, "Right", docdata.barcode_text, docdata.Zusatz_Font, docdata.Zusatz_FontSize);
barcodeimage.Save(word.ActiveDocument.FullName + ".png");
Insert_Datamatrix(word.ActiveDocument.FullName + ".png");
System.IO.File.Delete(word.ActiveDocument.FullName + ".png");
return;
} else
{
//System.Drawing.Image barcodeimage;
//BarcodeLib.Barcode Barcode = new BarcodeLib.Barcode();
//barcodeimage = Barcode.Get_LinerBarcode(Barcoded.Symbology.I2of5, dokumentid.Substring(6, 16), dokumentid.Substring(6, 16) + docdata.barcode_zusatz, docdata.barcode_textposition, docdata.Zusatz_Font, Convert.ToInt32(docdata.Zusatz_FontSize), 0);
//barcodeimage.Save(word.ActiveDocument.FullName + ".png");
//Insert_Datamatrix(word.ActiveDocument.FullName + ".png");
//System.IO.File.Delete(word.ActiveDocument.FullName + ".png");
//return;
}
word.Selection.HeaderFooter.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, docdata.barcode_left, docdata.barcode_top, docdata.barcode_width, docdata.barcode_height).Select();
word.Selection.ShapeRange.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
@@ -392,7 +481,7 @@ namespace OnDocOffice
word.ActiveDocument.Tables.Add(Range:word.Selection.Range, NumRows:1, NumColumns:1);
if (docdata.barcode_horizontal == 1)
if (docdata.barcode_horizontal == 0)
{
word.Selection.Tables[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderLeft].LineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleNone;
word.Selection.Tables[1].Borders[Microsoft.Office.Interop.Word.WdBorderType.wdBorderRight].LineStyle = Microsoft.Office.Interop.Word.WdLineStyle.wdLineStyleNone;

View File

@@ -32,6 +32,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BarcodeLib">
<HintPath>..\BarcodeLib\bin\Debug\BarcodeLib.dll</HintPath>
</Reference>
<Reference Include="Database">
<HintPath>..\Database\bin\Debug\Database.dll</HintPath>
</Reference>
@@ -52,6 +55,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

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.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
bc7708f648e69cd550f5b020cdf167e710e9daadb94c6a4e4b1c79c6fc029194
ed512a5d9516bca1561ddb7e5e81933bd1ffd8af2db5eac838dc5742371bdc16

View File

@@ -20,3 +20,12 @@ E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\obj\Debug\OnDocOffice.pdb
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\VBFileManagement.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\VBFileManagement.pdb
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\VBFileManagement.xml
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\BarcodeLib.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\QRCoder.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.Compat.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.Bars.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.DataVisualization.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.Editor.dll
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\BarcodeLib.pdb
E:\Software-Projekte\OnDoc\OnDoc\OnDocOffice\bin\Debug\FastReport.xml