├── .github └── workflows │ └── gitleaks.yaml ├── AWS-Lambda ├── Console-App-.NET-Core │ ├── Console-App-.NET-Core.sln │ └── Console-App-.NET-Core │ │ ├── App.config │ │ ├── Console-App-.NET-Core.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── packages.config └── MyLamdaProject │ ├── MyLamdaProject.sln │ └── MyLamdaProject │ ├── Data │ ├── Adventure.docx │ ├── arial.ttf │ ├── calibri.ttf │ └── times.ttf │ ├── Function.cs │ ├── MyLamdaProject.csproj │ ├── Properties │ └── launchSettings.json │ ├── Readme.md │ └── aws-lambda-tools-defaults.json ├── Linux Docker ├── Alpine │ └── WordToPDFDockerSample │ │ ├── .dockerignore │ │ ├── Adventure.docx │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WordToPDFDockerSample.csproj │ │ └── WordToPDFDockerSample.sln ├── CentOS │ └── WordToPDFDockerSample │ │ ├── .dockerignore │ │ ├── Adventure.docx │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WordToPDFDockerSample.csproj │ │ └── WordToPDFDockerSample.sln ├── Debian │ └── WordToPDFDockerSample │ │ ├── .dockerignore │ │ ├── Adventure.docx │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WordToPDFDockerSample.csproj │ │ └── WordToPDFDockerSample.sln ├── Fedora │ └── WordToPDFDockerSample │ │ ├── .dockerignore │ │ ├── Adventure.docx │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WordToPDFDockerSample.csproj │ │ └── WordToPDFDockerSample.sln ├── RHEL │ └── WordToPDFDockerSample │ │ ├── .dockerignore │ │ ├── Adventure.docx │ │ ├── Dockerfile │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── WordToPDFDockerSample.csproj │ │ └── WordToPDFDockerSample.sln └── Ubuntu │ └── WordToPDFDockerSample │ ├── .dockerignore │ ├── Adventure.docx │ ├── Dockerfile │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WordToPDFDockerSample.csproj │ └── WordToPDFDockerSample.sln └── README.md /.github/workflows/gitleaks.yaml: -------------------------------------------------------------------------------- 1 | name: Secret Value found!! 2 | on: 3 | push: 4 | public: 5 | jobs: 6 | scan: 7 | name: gitleaks 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | - name: Install the gitleaks 13 | run: wget https://github.com/zricethezav/gitleaks/releases/download/v8.15.2/gitleaks_8.15.2_linux_x64.tar.gz 14 | shell: pwsh 15 | - name: Extract the tar file 16 | run: tar xzvf gitleaks_8.15.2_linux_x64.tar.gz 17 | - name: Generate the report 18 | id: gitleaks 19 | run: $GITHUB_WORKSPACE/gitleaks detect -s $GITHUB_WORKSPACE -f json -r $GITHUB_WORKSPACE/leaksreport.json 20 | shell: bash 21 | continue-on-error: true 22 | - name: Setup NuGet.exe 23 | if: steps.gitleaks.outcome != 'success' 24 | uses: nuget/setup-nuget@v1 25 | with: 26 | nuget-version: latest 27 | - name: Install the dotnet 28 | if: steps.gitleaks.outcome != 'success' 29 | uses: actions/setup-dotnet@v3 30 | with: 31 | dotnet-version: '3.1.x' 32 | - name: Install the report tool packages 33 | if: steps.gitleaks.outcome != 'success' 34 | run: | 35 | nuget install "Syncfusion.Email" -source ${{ secrets.NexusFeedLink }} -ExcludeVersion 36 | dir $GITHUB_WORKSPACE/Syncfusion.Email/lib/netcoreapp3.1 37 | dotnet $GITHUB_WORKSPACE/Syncfusion.Email/lib/netcoreapp3.1/GitleaksReportMail.dll ${{ secrets.CITEAMCREDENTIALS }} "$GITHUB_REF_NAME" ${{ secrets.NETWORKCREDENTIALS }} ${{ secrets.NETWORKKEY }} "$GITHUB_WORKSPACE" ${{ secrets.ORGANIZATIONNAME }} 38 | exit 1 -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.572 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console-App-.NET-Core", "Console-App-.NET-Core\Console-App-.NET-Core.csproj", "{7B672A0C-AE57-40C7-B701-6388674F45A6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7B672A0C-AE57-40C7-B701-6388674F45A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7B672A0C-AE57-40C7-B701-6388674F45A6}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7B672A0C-AE57-40C7-B701-6388674F45A6}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7B672A0C-AE57-40C7-B701-6388674F45A6}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {105952A9-AC75-4AF7-967C-2CE53523850C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core/Console-App-.NET-Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7B672A0C-AE57-40C7-B701-6388674F45A6} 8 | Exe 9 | Console-App-.NET-Core 10 | Console-App-.NET-Core 11 | v4.6.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\AWSSDK.Core.3.3.103.7\lib\net45\AWSSDK.Core.dll 39 | 40 | 41 | ..\packages\AWSSDK.Lambda.3.3.102.25\lib\net45\AWSSDK.Lambda.dll 42 | 43 | 44 | ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core/Program.cs: -------------------------------------------------------------------------------- 1 | using Amazon; 2 | using Amazon.Lambda; 3 | using Amazon.Lambda.Model; 4 | using Newtonsoft.Json; 5 | using System; 6 | using System.IO; 7 | 8 | namespace Console_App_.NET_Core 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Create a new AmazonLambdaClient 15 | AmazonLambdaClient client = new AmazonLambdaClient("awsaccessKeyID", "awsSecreteAccessKey", RegionEndpoint.USEast2); 16 | 17 | //Create new InvokeRequest with published function name. 18 | InvokeRequest invoke = new InvokeRequest 19 | { 20 | FunctionName = "MyNewFunction", 21 | InvocationType = InvocationType.RequestResponse, 22 | Payload = "\"Test\"" 23 | }; 24 | 25 | //Get the InvokeResponse from client InvokeRequest. 26 | InvokeResponse response = client.Invoke(invoke); 27 | 28 | //Read the response stream 29 | var stream = new StreamReader(response.Payload); 30 | JsonReader reader = new JsonTextReader(stream); 31 | var serilizer = new JsonSerializer(); 32 | var responseText = serilizer.Deserialize(reader); 33 | 34 | //Convert Base64String into PDF document 35 | byte[] bytes = Convert.FromBase64String(responseText.ToString()); 36 | FileStream fileStream = new FileStream("Sample.pdf", FileMode.Create); 37 | BinaryWriter writer = new BinaryWriter(fileStream); 38 | writer.Write(bytes, 0, bytes.Length); 39 | writer.Close(); 40 | System.Diagnostics.Process.Start("Sample.pdf"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7b672a0c-ae57-40c7-b701-6388674f45a6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AWS-Lambda/Console-App-.NET-Core/Console-App-.NET-Core/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyLamdaProject", "MyLamdaProject\MyLamdaProject.csproj", "{495064C3-AA42-4C69-B2D2-A9EC39C0B873}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {495064C3-AA42-4C69-B2D2-A9EC39C0B873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {495064C3-AA42-4C69-B2D2-A9EC39C0B873}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {495064C3-AA42-4C69-B2D2-A9EC39C0B873}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {495064C3-AA42-4C69-B2D2-A9EC39C0B873}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {711F2595-94D0-44BB-BB06-632739557EBC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/Adventure.docx -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/arial.ttf -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/calibri.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/calibri.ttf -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/times.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/AWS-Lambda/MyLamdaProject/MyLamdaProject/Data/times.ttf -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Function.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.IO; 6 | using Syncfusion.DocIO; 7 | using Syncfusion.DocIO.DLS; 8 | using Syncfusion.DocIORenderer; 9 | using Syncfusion.Pdf; 10 | using Syncfusion.Drawing; 11 | 12 | using Amazon.Lambda.Core; 13 | 14 | // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. 15 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] 16 | 17 | namespace MyLamdaProject 18 | { 19 | public class Function 20 | { 21 | 22 | /// 23 | /// A simple function that takes a string and does a ToUpper 24 | /// 25 | /// 26 | /// 27 | /// 28 | public string FunctionHandler(string input, ILambdaContext context) 29 | { 30 | //Path to the original library file. 31 | string originalLibraryPath = "/lib64/libdl.so.2"; 32 | 33 | //Path to the symbolic link where the library will be copied. 34 | string symlinkLibraryPath = "/tmp/libdl.so"; 35 | 36 | //Check if the original library file exists. 37 | if (File.Exists(originalLibraryPath)) 38 | { 39 | //Copy the original library file to the symbolic link path, overwriting if it already exists. 40 | File.Copy(originalLibraryPath, symlinkLibraryPath, true); 41 | } 42 | 43 | string filePath = Path.GetFullPath(@"Data/Adventure.docx"); 44 | 45 | //Load the file from the disk 46 | FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); 47 | 48 | WordDocument document = new WordDocument(fileStream, FormatType.Docx); 49 | 50 | //Hooks the font substitution event 51 | document.FontSettings.SubstituteFont += FontSettings_SubstituteFont; 52 | 53 | DocIORenderer render = new DocIORenderer(); 54 | 55 | PdfDocument pdf = render.ConvertToPDF(document); 56 | 57 | //Unhooks the font substitution event after converting to PDF 58 | document.FontSettings.SubstituteFont -= FontSettings_SubstituteFont; 59 | 60 | //Save the document into stream 61 | MemoryStream stream = new MemoryStream(); 62 | 63 | //Save the PDF document 64 | pdf.Save(stream); 65 | //Releases all resources used by the Word document and DocIO Renderer objects 66 | document.Close(); 67 | render.Dispose(); 68 | //Closes the PDF document 69 | pdf.Close(); 70 | return Convert.ToBase64String(stream.ToArray()); 71 | } 72 | /// 73 | /// Sets the alternate font when a specified font is not installed in the production environment 74 | /// 75 | /// 76 | /// 77 | private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args) 78 | { 79 | if (args.OriginalFontName == "Calibri") 80 | args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/calibri.ttf"), FileMode.Open, FileAccess.Read); 81 | else if (args.OriginalFontName == "Arial") 82 | args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/arial.ttf"), FileMode.Open, FileAccess.Read); 83 | else 84 | args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/times.ttf"), FileMode.Open, FileAccess.Read); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/MyLamdaProject.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net8.0 4 | true 5 | Lambda 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | 20 | 21 | PreserveNewest 22 | 23 | 24 | PreserveNewest 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Mock Lambda Test Tool": { 4 | "commandName": "Executable", 5 | "commandLineArgs": "--port 5050", 6 | "workingDirectory": ".\\bin\\$(Configuration)\\net8.0", 7 | "executablePath": "%USERPROFILE%\\.dotnet\\tools\\dotnet-lambda-test-tool-8.0.exe" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/Readme.md: -------------------------------------------------------------------------------- 1 | # AWS Lambda Empty Function Project 2 | 3 | This starter project consists of: 4 | * Function.cs - class file containing a class with a single function handler method 5 | * aws-lambda-tools-defaults.json - default argument settings for use with Visual Studio and command line deployment tools for AWS 6 | 7 | You may also have a test project depending on the options selected. 8 | 9 | The generated function handler is a simple method accepting a string argument that returns the uppercase equivalent of the input string. Replace the body of this method, and parameters, to suit your needs. 10 | 11 | ## Here are some steps to follow from Visual Studio: 12 | 13 | To deploy your function to AWS Lambda, right click the project in Solution Explorer and select *Publish to AWS Lambda*. 14 | 15 | To view your deployed function open its Function View window by double-clicking the function name shown beneath the AWS Lambda node in the AWS Explorer tree. 16 | 17 | To perform testing against your deployed function use the Test Invoke tab in the opened Function View window. 18 | 19 | To configure event sources for your deployed function, for example to have your function invoked when an object is created in an Amazon S3 bucket, use the Event Sources tab in the opened Function View window. 20 | 21 | To update the runtime configuration of your deployed function use the Configuration tab in the opened Function View window. 22 | 23 | To view execution logs of invocations of your function use the Logs tab in the opened Function View window. 24 | 25 | ## Here are some steps to follow to get started from the command line: 26 | 27 | Once you have edited your template and code you can deploy your application using the [Amazon.Lambda.Tools Global Tool](https://github.com/aws/aws-extensions-for-dotnet-cli#aws-lambda-amazonlambdatools) from the command line. 28 | 29 | Install Amazon.Lambda.Tools Global Tools if not already installed. 30 | ``` 31 | dotnet tool install -g Amazon.Lambda.Tools 32 | ``` 33 | 34 | If already installed check if new version is available. 35 | ``` 36 | dotnet tool update -g Amazon.Lambda.Tools 37 | ``` 38 | 39 | Execute unit tests 40 | ``` 41 | cd "MyLamdaProject/test/MyLamdaProject.Tests" 42 | dotnet test 43 | ``` 44 | 45 | Deploy function to AWS Lambda 46 | ``` 47 | cd "MyLamdaProject/src/MyLamdaProject" 48 | dotnet lambda deploy-function 49 | ``` 50 | -------------------------------------------------------------------------------- /AWS-Lambda/MyLamdaProject/MyLamdaProject/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "Information" : [ 4 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 5 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 6 | "dotnet lambda help", 7 | "All the command line options for the Lambda command can be specified in this file." 8 | ], 9 | "profile" : "AWSLAMBDA", 10 | "region" : "us-east-1", 11 | "configuration" : "Release", 12 | "framework" : "net8.0", 13 | "function-runtime" : "dotnet8", 14 | "function-memory-size" : 512, 15 | "function-timeout" : 30, 16 | "function-handler" : "MyLamdaProject::MyLamdaProject.Function::FunctionHandler", 17 | "function-name" : "MyNewFunction", 18 | "function-role" : "arn:aws:iam::142887710098:role/ck_lambda_basic_execution", 19 | "tracing-mode" : "PassThrough", 20 | "environment-variables" : "\"LD_LIBRARY_PATH\"=\"/var/task:/tmp:/lib64:/usr/lib64\"", 21 | "function-description" : "", 22 | "package-type" : "Zip", 23 | "function-architecture" : "x86_64", 24 | "function-subnets" : "", 25 | "function-security-groups" : "", 26 | "image-tag" : "" 27 | } -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/Alpine/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base 4 | RUN apk update && apk upgrade && apk add fontconfig 5 | RUN apk add --update ttf-dejavu fontconfig 6 | WORKDIR /app 7 | 8 | FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build 9 | WORKDIR /src 10 | COPY ["WordToPDFDockerSample.csproj", "."] 11 | RUN dotnet restore "./WordToPDFDockerSample.csproj" 12 | COPY . . 13 | WORKDIR "/src/." 14 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 15 | 16 | FROM build AS publish 17 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish 18 | 19 | FROM base AS final 20 | WORKDIR /app 21 | COPY --from=publish /app/publish . 22 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/Alpine/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/CentOS/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use the official .NET 8.0 SDK image from Microsoft for building the application 2 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 3 | RUN apt-get update -y && apt-get install libfontconfig -y 4 | WORKDIR /src 5 | 6 | # Copy the project file and restore dependencies 7 | COPY ["WordToPDFDockerSample.csproj", "."] 8 | RUN dotnet restore "WordToPDFDockerSample.csproj" 9 | 10 | # Copy the rest of the application code and build the application 11 | COPY . . 12 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 13 | 14 | # Publish the application 15 | FROM build AS publish 16 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish /p:UseAppHost=false 17 | 18 | # Use CentOS 8 as the base image for the final runtime 19 | FROM centos:8 20 | 21 | # Install .NET 8.0 runtime 22 | RUN dnf install -y https://packages.microsoft.com/config/centos/8/prod.repo \ 23 | && dnf install -y dotnet-runtime-8.0 \ 24 | && dnf clean all 25 | 26 | # Install fontconfig for fonts 27 | RUN dnf install -y fontconfig 28 | 29 | # Set the working directory 30 | WORKDIR /app 31 | 32 | # Copy the published application from the previous stage 33 | COPY --from=publish /app/publish . 34 | 35 | # Set the entry point for the container 36 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] 37 | -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/CentOS/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/Debian/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-buster-slim AS base 4 | RUN apt-get update -y && apt-get install fontconfig -y 5 | WORKDIR /app 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:8.0-buster-slim AS build 8 | WORKDIR /src 9 | COPY ["WordToPDFDockerSample.csproj", "."] 10 | RUN dotnet restore "./WordToPDFDockerSample.csproj" 11 | COPY . . 12 | WORKDIR "/src/." 13 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/Debian/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/Fedora/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM fedora:latest 4 | 5 | # Install .NET 8.0 SDK and runtime 6 | Run dnf install dotnet-sdk-8.0 -y 7 | RUN dnf install dotnet-runtime-8.0 -y 8 | 9 | # Install fontconfig for font support 10 | RUN dnf install fontconfig -y 11 | 12 | # Set the working directory 13 | WORKDIR /app 14 | 15 | # Copy the application files 16 | COPY ["WordToPDFDockerSample.csproj", "."] 17 | RUN dotnet restore "WordToPDFDockerSample.csproj" 18 | COPY . . 19 | 20 | # Build the application 21 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 22 | 23 | # Publish the application 24 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish 25 | 26 | # Set the final stage to use the runtime image 27 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] 28 | -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/Fedora/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/RHEL/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM registry.access.redhat.com/ubi8/dotnet-80-runtime AS base 4 | USER root 5 | RUN microdnf install -y fontconfig \ 6 | && microdnf clean all 7 | WORKDIR /app 8 | 9 | # Use Red Hat Universal Base Image (UBI) 8 with .NET 8.0 SDK for building the application 10 | FROM registry.access.redhat.com/ubi8/dotnet-80 AS build 11 | WORKDIR /src 12 | COPY ["WordToPDFDockerSample.csproj", ""] 13 | RUN dotnet restore "./WordToPDFDockerSample.csproj" 14 | COPY . . 15 | WORKDIR "/src/." 16 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 17 | 18 | # Publish the application 19 | FROM build AS publish 20 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish 21 | 22 | # Use the .NET 8.0 runtime to run the application 23 | FROM base AS final 24 | WORKDIR /app 25 | COPY --from=publish /app/publish . 26 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] 27 | -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/RHEL/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/bin 16 | **/charts 17 | **/docker-compose* 18 | **/Dockerfile* 19 | **/node_modules 20 | **/npm-debug.log 21 | **/obj 22 | **/secrets.dev.yaml 23 | **/values.dev.yaml 24 | LICENSE 25 | README.md -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/Adventure.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncfusionExamples/Word-To-PDF-Examples/b79daa6991abd4f990bdff8eba1dd18ad640b3b8/Linux Docker/Ubuntu/WordToPDFDockerSample/Adventure.docx -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/Dockerfile: -------------------------------------------------------------------------------- 1 | #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 | 3 | FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS base 4 | RUN apt-get update -y && apt-get install fontconfig -y 5 | WORKDIR /app 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build 8 | WORKDIR /src 9 | COPY ["WordToPDFDockerSample.csproj", "."] 10 | RUN dotnet restore "./WordToPDFDockerSample.csproj" 11 | COPY . . 12 | WORKDIR "/src/." 13 | RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build 14 | 15 | FROM build AS publish 16 | RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish 17 | 18 | FROM base AS final 19 | WORKDIR /app 20 | COPY --from=publish /app/publish . 21 | ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"] -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Syncfusion.DocIO; 4 | using Syncfusion.DocIO.DLS; 5 | using Syncfusion.DocIORenderer; 6 | using Syncfusion.Pdf; 7 | 8 | namespace WordToPDFDockerSample 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | //Open the file as Stream 15 | FileStream docStream = new FileStream(@"Adventure.docx", FileMode.Open, FileAccess.Read); 16 | //Loads file stream into Word document 17 | WordDocument wordDocument = new WordDocument(docStream, Syncfusion.DocIO.FormatType.Automatic); 18 | docStream.Dispose(); 19 | //Instantiation of DocIORenderer for Word to PDF conversion 20 | DocIORenderer render = new DocIORenderer(); 21 | //Converts Word document into PDF document 22 | PdfDocument pdfDocument = render.ConvertToPDF(wordDocument); 23 | //Releases all resources used by the Word document and DocIO Renderer objects 24 | render.Dispose(); 25 | wordDocument.Dispose(); 26 | //Saves the PDF file 27 | FileStream outputStream = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); 28 | pdfDocument.Save(outputStream); 29 | //Closes the instance of PDF document object 30 | pdfDocument.Close(); 31 | outputStream.Dispose(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WordToPDFDockerSample": { 4 | "commandName": "Project" 5 | }, 6 | "Docker": { 7 | "commandName": "Docker" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/WordToPDFDockerSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | Linux 7 | . 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Linux Docker/Ubuntu/WordToPDFDockerSample/WordToPDFDockerSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WordToPDFDockerSample", "WordToPDFDockerSample.csproj", "{E233EA39-3496-4CDB-A8B1-90779722AE70}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E233EA39-3496-4CDB-A8B1-90779722AE70}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {257DD3A5-A234-4E31-92C3-E010FEDB8CC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Word to PDF examples 2 | 3 | This repository contains examples that illustrates how to convert Word documents to PDF in C# and VB.NET using [Syncfusion® Word to PDF converter](https://www.syncfusion.com/document-processing/word-framework/net/word-to-pdf-conversion?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) without Microsoft Word or Office interop dependencies. 4 | 5 | ## Syncfusion® .NET Word Library 6 | The Syncfusion® DocIO is a [.NET Word library](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) allows you to add advanced Word document processing functionalities to any .NET application and does not require Microsoft Word application to be installed in the machine. It is a non-UI component that provides a full-fledged document instance model similar to the Microsoft Office COM libraries to iterate with the document elements explicitly and perform necessary manipulation. 7 | 8 | Take a moment to peruse the [documentation](https://help.syncfusion.com/file-formats/docio/getting-started?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), where you can find basic Word document processing options along with the features like [mail merge](https://help.syncfusion.com/file-formats/docio/working-with-mail-merge?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [merge](https://help.syncfusion.com/file-formats/docio/word-document/merging-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [split](https://help.syncfusion.com/file-formats/docio/word-document/split-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) and [compare documents](https://help.syncfusion.com/file-formats/docio/word-document/compare-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [find and replace](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) text in the Word document, [protect](https://help.syncfusion.com/file-formats/docio/working-with-security?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) the Word documents, and most importantly, the [PDF](https://help.syncfusion.com/file-formats/docio/word-to-pdf?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) and [Image](https://help.syncfusion.com/file-formats/docio/word-to-image?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) conversions with code examples. 9 | 10 | Compatible Microsoft Word Versions 11 | ---------------------------------- 12 | 13 | * Microsoft Word 97-2003 14 | * Microsoft Word 2007 15 | * Microsoft Word 2010 16 | * Microsoft Word 2013 17 | * Microsoft Word 2016 18 | * Microsoft Word 2019 19 | * Microsoft 365 20 | 21 | Supported File Formats 22 | ---------------------- 23 | 24 | * Creates, reads, and edits popular text file formats like [DOC](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples#doc-to-docx-and-docx-to-doc), DOT, [DOCM](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples#macros), DOTM, [DOCX](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples#doc-to-docx-and-docx-to-doc), [DOTX](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples#templates), [HTML](https://help.syncfusion.com/file-formats/docio/html?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [RTF](https://help.syncfusion.com/file-formats/docio/rtf?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [TXT](https://help.syncfusion.com/file-formats/docio/text?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), and [XML (WordML)](https://help.syncfusion.com/file-formats/docio/word-file-formats#word-processing-xml-xml?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples). 25 | * Converts Word documents also to [PDF](https://help.syncfusion.com/file-formats/docio/word-to-pdf?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), [Image](https://help.syncfusion.com/file-formats/docio/word-to-image?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples), and [ODT](https://help.syncfusion.com/file-formats/docio/word-to-odt?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) files. 26 | 27 | ## How to run the examples 28 | - Download this project to a location in your disk. 29 | - Open the solution file using Visual Studio. 30 | - Rebuild the solution to install the required NuGet packages. 31 | - Run the application. 32 | 33 | ## Resources 34 | 35 | - **Product page:** [Syncfusion® Word Framework](https://www.syncfusion.com/document-processing/word-framework/net?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) 36 | - **Documentation:** [Convert Word to PDF using Syncfusion® Word library](https://help.syncfusion.com/file-formats/docio/word-to-pdf?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) 37 | - **GitHub Examples:** [Syncfusion® Word library examples](https://github.com/SyncfusionExamples/DocIO-Examples?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) 38 | - **Online demo:** [Syncfusion® Word library - Online demos](https://ej2.syncfusion.com/aspnetcore/DocIO/SalesInvoice?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) 39 | 40 | ## Support and feedback 41 | For any other queries, reach our [Syncfusion® support team](https://support.syncfusion.com/?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) or post the queries through the [community forums](https://www.syncfusion.com/forums?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples). 42 | 43 | Request new feature through [Syncfusion® feedback portal](https://www.syncfusion.com/feedback?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples). 44 | 45 | ## License 46 | This is a commercial product and requires a paid license for possession or use. Syncfusion's licensed software, including this component, is subject to the terms and conditions of [Syncfusion's EULA](https://www.syncfusion.com/license/studio/22.2.5/syncfusion_essential_studio_eula.pdf?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples). You can purchase a licnense [here](https://www.syncfusion.com/sales/products?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples) or start a free 30-day trial [here](https://www.syncfusion.com/account/manage-trials/start-trials?utm_source=github&utm_medium=listing&utm_campaign=github-github-docio-examples). 47 | --------------------------------------------------------------------------------