Upsdate 20240729
This commit is contained in:
37
OfficePrinter/Class1.cs
Normal file
37
OfficePrinter/Class1.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
|
||||
|
||||
namespace OfficePrinter
|
||||
{
|
||||
public class OnDocOffice
|
||||
|
||||
{
|
||||
//Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application();
|
||||
|
||||
public void PrintWordToPDF(string filename, string pdfname)
|
||||
{
|
||||
Application appWord = new Application();
|
||||
Microsoft.Office.Interop.Word.Document wordDocument = new Microsoft.Office.Interop.Word.Document();
|
||||
wordDocument = appWord.Documents.Open(filename);
|
||||
appWord.Visible = true;
|
||||
wordDocument.PrintOut(
|
||||
OutputFileName: pdfname,
|
||||
PrintToFile: true);
|
||||
wordDocument.Close();
|
||||
wordDocument = null;
|
||||
appWord.Quit(SaveChanges: false);
|
||||
appWord = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
71
OfficePrinter/OfficePrinter.csproj
Normal file
71
OfficePrinter/OfficePrinter.csproj
Normal file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E43884F0-A46F-4676-ADE8-10B196FAAE3B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OfficePrinter</RootNamespace>
|
||||
<AssemblyName>OfficePrinter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Office.Interop.Word, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Office.Interop.Word.15.0.4797.1004\lib\net20\Microsoft.Office.Interop.Word.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="NetOffice, Version=1.7.4.11, Culture=neutral, PublicKeyToken=7292cd2a8b1e0703, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NetOffice.Core.Net45.1.7.4.11\lib\net45\NetOffice.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="OfficeApi, Version=1.7.4.11, Culture=neutral, PublicKeyToken=7292cd2a8b1e0703, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NetOffice.Core.Net45.1.7.4.11\lib\net45\OfficeApi.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="VBIDEApi, Version=1.7.4.11, Culture=neutral, PublicKeyToken=7292cd2a8b1e0703, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NetOffice.Core.Net45.1.7.4.11\lib\net45\VBIDEApi.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="WordApi, Version=1.7.4.11, Culture=neutral, PublicKeyToken=7292cd2a8b1e0703, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NetOffice.Word.Net45.1.7.4.11\lib\net45\WordApi.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
OfficePrinter/Properties/AssemblyInfo.cs
Normal file
36
OfficePrinter/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("OfficePrinter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("HP Inc.")]
|
||||
[assembly: AssemblyProduct("OfficePrinter")]
|
||||
[assembly: AssemblyCopyright("Copyright © HP Inc. 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("e43884f0-a46f-4676-ade8-10b196faae3b")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
OfficePrinter/bin/Debug/NetOffice.dll
Normal file
BIN
OfficePrinter/bin/Debug/NetOffice.dll
Normal file
Binary file not shown.
2825
OfficePrinter/bin/Debug/NetOffice.xml
Normal file
2825
OfficePrinter/bin/Debug/NetOffice.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
OfficePrinter/bin/Debug/OfficeApi.dll
Normal file
BIN
OfficePrinter/bin/Debug/OfficeApi.dll
Normal file
Binary file not shown.
51670
OfficePrinter/bin/Debug/OfficeApi.xml
Normal file
51670
OfficePrinter/bin/Debug/OfficeApi.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
OfficePrinter/bin/Debug/OfficePrinter.dll
Normal file
BIN
OfficePrinter/bin/Debug/OfficePrinter.dll
Normal file
Binary file not shown.
BIN
OfficePrinter/bin/Debug/OfficePrinter.pdb
Normal file
BIN
OfficePrinter/bin/Debug/OfficePrinter.pdb
Normal file
Binary file not shown.
BIN
OfficePrinter/bin/Debug/VBIDEApi.dll
Normal file
BIN
OfficePrinter/bin/Debug/VBIDEApi.dll
Normal file
Binary file not shown.
4150
OfficePrinter/bin/Debug/VBIDEApi.xml
Normal file
4150
OfficePrinter/bin/Debug/VBIDEApi.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
OfficePrinter/bin/Debug/WordApi.dll
Normal file
BIN
OfficePrinter/bin/Debug/WordApi.dll
Normal file
Binary file not shown.
104695
OfficePrinter/bin/Debug/WordApi.xml
Normal file
104695
OfficePrinter/bin/Debug/WordApi.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
OfficePrinter/bin/Debug/stdole.dll
Normal file
BIN
OfficePrinter/bin/Debug/stdole.dll
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
|
||||
Binary file not shown.
0
OfficePrinter/obj/Debug/OfficePr.6C7E73FF.Up2Date
Normal file
0
OfficePrinter/obj/Debug/OfficePr.6C7E73FF.Up2Date
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
30768a099e59425466a56d40a7b91ea08d5e52c8fc5e327e255d3454ac70b34a
|
||||
@@ -0,0 +1,16 @@
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\OfficePrinter.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\OfficePrinter.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\NetOffice.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\OfficeApi.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\VBIDEApi.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\WordApi.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\stdole.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\NetOffice.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\OfficeApi.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\VBIDEApi.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\bin\Debug\WordApi.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\obj\Debug\OfficePrinter.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\obj\Debug\OfficePrinter.csproj.CoreCompileInputs.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\obj\Debug\OfficePr.6C7E73FF.Up2Date
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\obj\Debug\OfficePrinter.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\OfficePrinter\obj\Debug\OfficePrinter.pdb
|
||||
BIN
OfficePrinter/obj/Debug/OfficePrinter.dll
Normal file
BIN
OfficePrinter/obj/Debug/OfficePrinter.dll
Normal file
Binary file not shown.
BIN
OfficePrinter/obj/Debug/OfficePrinter.pdb
Normal file
BIN
OfficePrinter/obj/Debug/OfficePrinter.pdb
Normal file
Binary file not shown.
6
OfficePrinter/packages.config
Normal file
6
OfficePrinter/packages.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Office.Interop.Word" version="15.0.4797.1004" targetFramework="net481" />
|
||||
<package id="NetOffice.Core.Net45" version="1.7.4.11" targetFramework="net481" />
|
||||
<package id="NetOffice.Word.Net45" version="1.7.4.11" targetFramework="net481" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user