Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**Ghostscript.NET** is the most completed managed wrapper library around the [Ghostscript](https://ghostscript.com) library - an interpreter for PDF and PostScript files.

### Features

- View PDF, EPS or multi-page PostScript files on the screen.
- Rasterize PDF, EPS or multi-page PostScript files to any common image format.
- An easy way to call a Ghostscript library with a custom arguments / switches.
- Allows you to rasterize files in memory without storing the output to disk.
- Supports zoom-in and zoom-out.
- Supports progressive update.
- Allows you to run multiple Ghostscript instances simultaneously within a single process.
- Compatible with 32-bit and 64-bit Ghostscript native library.
114 changes: 9 additions & 105 deletions Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<TargetFramework>net6.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3509F0F7-A7AD-4FEE-B388-AA817F3413E9}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ghostscript.NET.DisplayTest</RootNamespace>
<AssemblyName>Ghostscript.NET.DisplayTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
Expand All @@ -22,112 +11,27 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Callbacks\StdIOHandler.cs" />
<Compile Include="FMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FMain.Designer.cs">
<DependentUpon>FMain.cs</DependentUpon>
</Compile>
<Compile Include="FPreview.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FPreview.Designer.cs">
<DependentUpon>FPreview.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FMain.resx">
<DependentUpon>FMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FPreview.resx">
<DependentUpon>FPreview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ghostscript.NET\Ghostscript.NET.csproj">
<Project>{8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363}</Project>
<Name>Ghostscript.NET</Name>
</ProjectReference>
<ProjectReference Include="..\Ghostscript.NET\Ghostscript.NET.csproj" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="_res\ghostscript-dotnet.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 0 additions & 36 deletions Ghostscript.NET.DisplayTest/Properties/AssemblyInfo.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Ghostscript.NET.DisplayTest/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Ghostscript.NET.DisplayTest/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZUGFeRD-csharp" Version="14.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Ghostscript.net\Ghostscript.NET\Ghostscript.NET.csproj" />
<ProjectReference Include="..\Ghostscript.NET.PDFA3Converter\Ghostscript.NET.PDFA3Converter.csproj" />
<ProjectReference Include="..\Ghostscript.NET\Ghostscript.NET.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions Ghostscript.NET.PDFA3Converter.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Ghostscript.NET Samples");
Console.WriteLine("Ghostscript.NET PDFA3Converter.Samples");

if (!GhostscriptVersionInfo.IsGhostscriptInstalled)
{
Expand All @@ -45,7 +45,6 @@ static void Main(string[] args)
sample = new FacturXWithZUGFeRDcsharpSample();
sample.Start();


Console.ReadLine();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
using Ghostscript.NET.Processor;
using System.IO;
using Ghostscript.NET.PDFA3Converter;
using Ghostscript.NET.PDFA3Converter.Samples.ZUGFeRD;
using Ghostscript.NET.PDFA3Converter.ZUGFeRD;


namespace Ghostscript.NET.PDFA3Converter.Samples
{
public class FacturXWithMustangSample : ISample
{
public void Start()
{
{
Console.WriteLine(Environment.NewLine);
Console.WriteLine("Running FacturXWithMustangSample");
Invoice i = (new Invoice()).setDueDate(DateTime.Now).setIssueDate(DateTime.Now).setDeliveryDate(DateTime.Now).setSender((new TradeParty("Test company", "Test Street 1", "55232", "Test City", "DE")).addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "test@example.org")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX"))).setRecipient(new TradeParty("Franz Müller", "Test Steet 12", "55232", "Entenhausen", "DE")).setReferenceNumber("991-01484-64").setNumber("123").
addItem(new Item(new Product("Test product", "", "C62", 19m), 1.0m, 1.0m));

Expand All @@ -47,7 +49,11 @@ public void Start()
string outfilename = "factur-x.xml";
File.WriteAllBytes(outfilename, zf2p.getXML());

PDFA3Converter converter = new PDFA3Converter(@"d:\gs\gs9.56.1\bin\gsdll64.dll");
string gsFilePath = @"C:\Program Files\gs\gs10.05.0\bin\gsdll64.dll";
Console.WriteLine("Using Ghostscript filepath: " + gsFilePath);
Console.WriteLine("Ensure this is the filepath to your installed Ghostscript!");

PDFA3Converter converter = new PDFA3Converter(gsFilePath);

converter.SetZUGFeRDProfile(Profiles.getByName("EN16931").getXMPName());
converter.SetZUGFeRDVersion("2.3");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ public class FacturXWithZUGFeRDcsharpSample : ISample
{
public void Start()
{
Console.WriteLine(Environment.NewLine);
Console.WriteLine("Running FacturXWithZUGFeRDcsharpSample");
string outFilename = "factur-x.xml";
InvoiceDescriptor invoice = CreateInvoice();
invoice.Save(outFilename, ZUGFeRDVersion.Version22, s2industries.ZUGFeRD.Profile.Comfort);

PDFA3Converter converter = new PDFA3Converter(@"d:\gs\gs9.56.1\bin\gsdll64.dll");
string gsFilePath = @"C:\Program Files\gs\gs10.05.0\bin\gsdll64.dll";
Console.WriteLine("Using Ghostscript filepath: "+ gsFilePath);
Console.WriteLine("Ensure this is the filepath to your installed Ghostscript!");
PDFA3Converter converter = new PDFA3Converter(gsFilePath);
converter.SetZUGFeRDProfile("EN 16931");
converter.SetZUGFeRDVersion("2.3");
converter.SetEmbeddedXMLFile(outFilename);
Expand Down
Loading