diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF.sln b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF.sln new file mode 100644 index 00000000..a5fb1c32 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-Excel-to-PDF", "Convert-Excel-to-PDF\Convert-Excel-to-PDF.csproj", "{3C0F53AF-5189-4A52-8CE4-C08FFF0D6190}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C0F53AF-5189-4A52-8CE4-C08FFF0D6190}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C0F53AF-5189-4A52-8CE4-C08FFF0D6190}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C0F53AF-5189-4A52-8CE4-C08FFF0D6190}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C0F53AF-5189-4A52-8CE4-C08FFF0D6190}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6E0207BB-0167-420A-853D-B02542FCF3CB} + EndGlobalSection +EndGlobal diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj new file mode 100644 index 00000000..c1406bd1 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.1 + Convert_Excel_to_PDF + Linux + + + + + + + + + diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user new file mode 100644 index 00000000..b759cb67 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user @@ -0,0 +1,9 @@ + + + + Docker + + + ProjectDebugger + + \ No newline at end of file diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx new file mode 100644 index 00000000..e94fa38b Binary files /dev/null and b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx differ diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile new file mode 100644 index 00000000..4d5f8a42 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile @@ -0,0 +1,22 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:3.1-alpine3.12 AS base +RUN apk update && apk upgrade && apk add fontconfig +RUN apk add --update ttf-dejavu fontconfig +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:3.1-alpine3.12 AS build +WORKDIR /src +COPY ["Convert-Excel-to-PDF.csproj", "."] +RUN dotnet restore "./Convert-Excel-to-PDF.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "Convert-Excel-to-PDF.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Convert-Excel-to-PDF.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Convert-Excel-to-PDF.dll"] \ No newline at end of file diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs new file mode 100644 index 00000000..6b516407 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs @@ -0,0 +1,32 @@ +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using System; +using System.IO; +using Syncfusion.XlsIORenderer; + +namespace Convert_Excel_to_PDF +{ + internal class Program + { + static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream excelStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(excelStream); + + //Initialize XlsIO renderer. + XlsIORenderer renderer = new XlsIORenderer(); + + //Convert Excel document into PDF document + PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); + + //Create the FileStream to save the converted PDF. + FileStream pdfStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite); + pdfDocument.Save(pdfStream); + } + } + } +} diff --git a/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json new file mode 100644 index 00000000..27d56843 --- /dev/null +++ b/Getting Started/Docker/Alpine/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "Convert-Excel-to-PDF": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF.sln b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF.sln new file mode 100644 index 00000000..a3f88f14 --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-Excel-to-PDF", "Convert-Excel-to-PDF\Convert-Excel-to-PDF.csproj", "{35079D1C-422A-48FE-B150-23BBAC13BB3D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {35079D1C-422A-48FE-B150-23BBAC13BB3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35079D1C-422A-48FE-B150-23BBAC13BB3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35079D1C-422A-48FE-B150-23BBAC13BB3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35079D1C-422A-48FE-B150-23BBAC13BB3D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {242C9AAD-E4C9-433F-B032-AF674C1AC1C1} + EndGlobalSection +EndGlobal diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj new file mode 100644 index 00000000..20f8d440 --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.1 + Convert_Excel_to_PDF + Linux + + + + + + + + + diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user new file mode 100644 index 00000000..e681dafe --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user @@ -0,0 +1,6 @@ + + + + Docker + + \ No newline at end of file diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx new file mode 100644 index 00000000..e94fa38b Binary files /dev/null and b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx differ diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile new file mode 100644 index 00000000..92f2d47d --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile @@ -0,0 +1,21 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:3.1-buster-slim AS base +RUN apt-get update -y && apt-get install fontconfig -y +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:3.1-buster-slim AS build +WORKDIR /src +COPY ["Convert-Excel-to-PDF.csproj", "."] +RUN dotnet restore "./Convert-Excel-to-PDF.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "Convert-Excel-to-PDF.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Convert-Excel-to-PDF.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Convert-Excel-to-PDF.dll"] \ No newline at end of file diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs new file mode 100644 index 00000000..73884210 --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs @@ -0,0 +1,33 @@ +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using System; +using System.IO; +using Syncfusion.XlsIORenderer; +using static System.Net.Mime.MediaTypeNames; + +namespace Convert_Excel_to_PDF +{ + internal class Program + { + static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream excelStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(excelStream); + + //Initialize XlsIO renderer. + XlsIORenderer renderer = new XlsIORenderer(); + + //Convert Excel document into PDF document + PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); + + //Create the FileStream to save the converted PDF. + FileStream pdfStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite); + pdfDocument.Save(pdfStream); + } + } + } +} diff --git a/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json new file mode 100644 index 00000000..27d56843 --- /dev/null +++ b/Getting Started/Docker/Debian/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "Convert-Excel-to-PDF": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF.sln b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF.sln new file mode 100644 index 00000000..a14cc7a9 --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-Excel-to-PDF", "Convert-Excel-to-PDF\Convert-Excel-to-PDF.csproj", "{AAEA8DE9-60DE-4C94-84C6-B326724AE0BD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AAEA8DE9-60DE-4C94-84C6-B326724AE0BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAEA8DE9-60DE-4C94-84C6-B326724AE0BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAEA8DE9-60DE-4C94-84C6-B326724AE0BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAEA8DE9-60DE-4C94-84C6-B326724AE0BD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BB0DECF5-AE91-4839-ADEC-E016FCB408D9} + EndGlobalSection +EndGlobal diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj new file mode 100644 index 00000000..20f8d440 --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.1 + Convert_Excel_to_PDF + Linux + + + + + + + + + diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user new file mode 100644 index 00000000..e681dafe --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user @@ -0,0 +1,6 @@ + + + + Docker + + \ No newline at end of file diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx new file mode 100644 index 00000000..e94fa38b Binary files /dev/null and b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx differ diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile new file mode 100644 index 00000000..91a5056c --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile @@ -0,0 +1,22 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM registry.access.redhat.com/ubi8/dotnet-31-runtime AS base +USER root +RUN yum -y install fontconfig --disablerepo=epel +WORKDIR / + +FROM registry.access.redhat.com/ubi8/dotnet-31 AS build +WORKDIR /src +COPY ["Convert-Excel-to-PDF.csproj", ""] +RUN dotnet restore "./Convert-Excel-to-PDF.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "Convert-Excel-to-PDF.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Convert-Excel-to-PDF.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Convert-Excel-to-PDF.dll"] \ No newline at end of file diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs new file mode 100644 index 00000000..73884210 --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs @@ -0,0 +1,33 @@ +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using System; +using System.IO; +using Syncfusion.XlsIORenderer; +using static System.Net.Mime.MediaTypeNames; + +namespace Convert_Excel_to_PDF +{ + internal class Program + { + static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream excelStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(excelStream); + + //Initialize XlsIO renderer. + XlsIORenderer renderer = new XlsIORenderer(); + + //Convert Excel document into PDF document + PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); + + //Create the FileStream to save the converted PDF. + FileStream pdfStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite); + pdfDocument.Save(pdfStream); + } + } + } +} diff --git a/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json new file mode 100644 index 00000000..27d56843 --- /dev/null +++ b/Getting Started/Docker/RHEL/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "Convert-Excel-to-PDF": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF.sln b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF.sln new file mode 100644 index 00000000..beb257b6 --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-Excel-to-PDF", "Convert-Excel-to-PDF\Convert-Excel-to-PDF.csproj", "{675724F6-6A41-4466-B452-5760018C4FEA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {675724F6-6A41-4466-B452-5760018C4FEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {675724F6-6A41-4466-B452-5760018C4FEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {675724F6-6A41-4466-B452-5760018C4FEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {675724F6-6A41-4466-B452-5760018C4FEA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {73025860-39DA-4DF6-8CC3-D9D7A29408E2} + EndGlobalSection +EndGlobal diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj new file mode 100644 index 00000000..20f8d440 --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.1 + Convert_Excel_to_PDF + Linux + + + + + + + + + diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user new file mode 100644 index 00000000..e681dafe --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Convert-Excel-to-PDF.csproj.user @@ -0,0 +1,6 @@ + + + + Docker + + \ No newline at end of file diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx new file mode 100644 index 00000000..e94fa38b Binary files /dev/null and b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Data/InputTemplate.xlsx differ diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile new file mode 100644 index 00000000..a24db493 --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Dockerfile @@ -0,0 +1,21 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/core/runtime:3.1-bionic AS base +RUN apt-get update -y && apt-get install fontconfig -y +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic AS build +WORKDIR /src +COPY ["Convert-Excel-to-PDF.csproj", ""] +RUN dotnet restore "./Convert-Excel-to-PDF.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "Convert-Excel-to-PDF.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Convert-Excel-to-PDF.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Convert-Excel-to-PDF.dll"] \ No newline at end of file diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs new file mode 100644 index 00000000..73884210 --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Program.cs @@ -0,0 +1,33 @@ +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using System; +using System.IO; +using Syncfusion.XlsIORenderer; +using static System.Net.Mime.MediaTypeNames; + +namespace Convert_Excel_to_PDF +{ + internal class Program + { + static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream excelStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(excelStream); + + //Initialize XlsIO renderer. + XlsIORenderer renderer = new XlsIORenderer(); + + //Convert Excel document into PDF document + PdfDocument pdfDocument = renderer.ConvertToPDF(workbook); + + //Create the FileStream to save the converted PDF. + FileStream pdfStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite); + pdfDocument.Save(pdfStream); + } + } + } +} diff --git a/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json new file mode 100644 index 00000000..27d56843 --- /dev/null +++ b/Getting Started/Docker/Ubuntu/Convert Excel to PDF/Convert-Excel-to-PDF/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "Convert-Excel-to-PDF": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file