{"id":19756880,"url":"https://github.com/compdfkit/compdfkit-pdf-sdk-netcore","last_synced_at":"2026-02-23T02:09:44.639Z","repository":{"id":242032999,"uuid":"808507612","full_name":"ComPDFKit/compdfkit-pdf-sdk-netcore","owner":"ComPDFKit","description":"A powerful .NET Core PDF library for server-side applications. Quickly integrate advanced PDF features into your .NET projects with ComPDF.","archived":false,"fork":false,"pushed_at":"2025-04-10T09:42:58.000Z","size":27798,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T09:43:22.920Z","etag":null,"topics":["csharp","dotnet","dotnet-core","net-core","pdf","pdf-editor","pdf-library","pdf-sdk","pdf-viewer","server"],"latest_commit_sha":null,"homepage":"https://www.compdf.com/pdf-library/dotnet","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ComPDFKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-31T08:04:16.000Z","updated_at":"2025-05-14T08:42:23.000Z","dependencies_parsed_at":"2025-05-12T17:24:23.707Z","dependency_job_id":null,"html_url":"https://github.com/ComPDFKit/compdfkit-pdf-sdk-netcore","commit_stats":null,"previous_names":["compdfkit/compdfkit-pdf-sdk-netcore"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ComPDFKit/compdfkit-pdf-sdk-netcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-pdf-sdk-netcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-pdf-sdk-netcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-pdf-sdk-netcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-pdf-sdk-netcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ComPDFKit","download_url":"https://codeload.github.com/ComPDFKit/compdfkit-pdf-sdk-netcore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-pdf-sdk-netcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273105953,"owners_count":25046950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnet-core","net-core","pdf","pdf-editor","pdf-library","pdf-sdk","pdf-viewer","server"],"created_at":"2024-11-12T03:17:18.243Z","updated_at":"2026-02-23T02:09:39.590Z","avatar_url":"https://github.com/ComPDFKit.png","language":"C#","readme":"# Introduction\n\n[ComPDFKit PDF SDK](https://www.compdf.com) is a robust PDF library, which offers comprehensive functions for quickly viewing, annotating, editing, and signing PDFs. It is feature-rich and battle-tested, making PDF files process and manipulation easier and faster.\n\n# Related\n\n- [ComPDFKit API Library for .Net](https://github.com/ComPDFKit/compdfkit-api-.net)\n- Download [ComPDFKit PDF SDK for .NET Core](https://www.nuget.org/packages/ComPDFKit.NetCore) in Nuget \n- [How to Build a Windows PDF Viewer or Editor](https://www.compdf.com/blog/build-a-windows-pdf-viewer-or-editor)\n- [Brief Introduction to ComPDFKit for Windows](https://www.compdf.com/blog/compdfkit-for-windows)\n\n# Get Started for Windows\n\n\n## Requirements\n\n- Visual Studio\n\n  Make sure that the `.NET Core cross-platform development` workload and `MSBUILD` are part of your installation.\n\n  This guide will use Visual Studio 2022. If you would like to use the NuGet integration for Windows x64 please make sure you have Visual Studio 2017 or later.\n\n  **Note:** ComPDFKit PDF SDK is multi-targeting. Target Frameworks: .NET Core 2.1+, .NET Standard 2.0, .NET 5, .NET 6, .NET 7, .NET 8.\n\n- ComPDFKit 's .NET Core PDF Library for Windows:\n\n  Please [contact us]( https://www.compdf.com/contact-sales ) to get the ComPDFKit PDF SDK for .NET Core.\n\n- ComPDFKit PDF SDK license\n\n  Commercial license keys are required for use in production environments. If you do not have a valid license key, please [contact us]( https://www.compdf.com/contact-sales) to obtain the license key.\n\n  License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).\n\n## Run the Samples\n\n1. Open the solution file 'Example. sln' in Visual Studio.\n2. Select a sample project in Solution Explorer and set it as the startup project. CS and VB examples are currently available.\n3. Build and run the example.\n\nOr you can open the command line tool in the project folder and run the example through the command:\n\n```bash\ndotnet run\n```\n\n## Integrate into Your Application\n\n#### Integrate Manually\n\n1. Open a new instance of Visual Studio 2022and create a new .NET Core console application project (`File \u003e New \u003e Project...` ). You can find this under the Visual C# menu.\n\n   Click on OK and allow the IDE to create the project.\n\n   \n\n2. Find the Solution Explorer on the right side of the screen. Select the project and press `Alt + Enter`. This will open the properties tab.\n\n   Alternatively, you can right click on the project and find the properties option.\n\n   Select **.NET Core 2.1 (or above)** as the target framework for your application.\n\n   If you are using a Windows x64 machine for your .NET Core development, you can use NuGet package manager to get the ComPDFKit PDF SDK. Otherwise, please integrate the SDK manually.\n\n3. Right-click \"Dependencies\" and click \"Add Project Reference\", which will open the \"Reference Manager\" dialog box. Click the option at the bottom of the dialog box, find the corresponding \"ComPDFKit.NET.dll\", select it and click Add.\n\n4. In the Solution Explorer, select the project and press `Shift + Alt + A`. With this you can Add an Existing Item.\n\n   Alternatively, you can right click on the project and find the `Add an existing item...` option under the `Add` submenu.\n\n   Navigate to the library location again, select the file type as `All Files (*.*)` and select `ComPDFKitNative.dll`. Click Add.\n\n5. Select  ComPDFKit.NET.dll  in the solution explorer. A properties window should appear below. In it, change the Build Action setting to `Content` and the Copy to Output Directory setting to `Copy always`. To avoid errors, use the drop-down menus available for those fields.\n\n#### Integrate with NuGet\n\n1. Perform the first 2 steps of integrating manually.\n\n2. Right click on project Dependencies and click on `Manage NuGet Packages...`. This will open the NuGet Package Manager\n\n3. Click on the `Browse` tab near the top of the package manager. In the search bar enter:\n\n   ```\n   ComPDFKit.NetCore\n   ```\n\n4. Select the `ComPDFKit.NetCore` package by PDF Tecnologies Inc. and click on the `Install` button in the panel with the package information. If you're prompted or an external dialog is opened for confirmation, click on `Ok`.\n\n   After installation, you will see the reference to the package under Dependencies in Solution Explorer.\n\n#### Create PDF Document\n\nWe have completed all the preparation steps. Now let's use the ComPDFKit PDF SDK to create a PDF file with a blank page, and replace your Program. cs file with the following code. Note that you need to replace your license in the 'LicenseVerify()' method.\n\n```csharp\nusing ComPDFKit.NativeMethod;\nusing ComPDFKit.PDFDocument;\nusing Microsoft.Win32;\nusing System.Reflection.Metadata;\nusing System.Windows;\n\nnamespace ComPDFKit_Demo\n{\n    public class Program\n    {\n        private static bool LicenseVerify()\n        {\n            if (!CPDFSDKVerifier.LoadNativeLibrary())\n                return false;\n            LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(\"Input your license here\");\n            return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);\n        }\n        \n        public static void Main()\n        { \n            LicenseVerify();\n            CPDFDocument document = CPDFDocument.CreateDocument();\n             // Insert to the first page\n\t\t\tint pageIndex = 0;\n\t\t\tint pageWidth = 595;\n\t\t\tint pageHeight = 842;\n\t\t\t//The InsertPage method can specify an image path. When the image path is empty, a blank page will be inserted.\n\t\t\tdocument.InsertPage(pageIndex, pageWidth, pageHeight, \"\");\n\t\t\tdocument.WriteToFilePath(\"new_file.pdf\");// Save the entire document object to the current path.\n            Console.WriteLine(\"Done. Results saved in new_file.pdf\");\n        }\n    }\n}\n```\n\nAfter running the program, please check the output file generated by the program. You will find that a PDF file with blank pages has been generated, and by default, it should be in the bin/Debug directory where your project files are located.\n\n# Get Started for Linux\n\n## Requirements\n\n- NET Core SDK\n  **Note:** ComPDFKit PDF SDK is multi-targeting. Target Frameworks : .NET Core 2.1+, .NET Standard 2.0, .NET 5, .NET 6, .NET 7, .NET 8。\n\n- ComPDFKit 's .NET Core PDF Library for Linux:\n  Please [contact us ](https://www.compdf.com/contact-sales )to obtain the ComPDFKit PDF SDK for NET Core.\n\n- ComPDFKit PDF SDK license\n\n  Commercial license keys are required for use in production environments. If you do not have a valid license key, please [contact us]( https://www.compdf.com/contact-sales) to obtain the license key.\n\n  License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).\n\n## Run the Samples\n\nEnter the sample folder and run the example from the command line:\n\n- Input/ Run. sh all to run all examples.\n- Input/ Run. sh\u003csamplename\u003eRun a specific example. For example/ Run. sh BatesTest.\n\nIf you receive an error message bash:/ Test. sh: Permission denied, you need to enter the following command:\n\n```shell\nchmod+x run .sh\n```\n\n## Integrate into Your Application\n\nYou can follow the manual or nuget integration described below for operation. This section will help you build your first ComPDFKit application. If you can open, save, and close PDFDoc, you can easily integrate the rest of the ComPDFKit PDF SDK.\n\n### Integrate Manually\n\n1. Create a new project named ComPDFKit Demo_ through the console:\n\n   ```shell\n   mkdir ComPDFKitDemo\n   cd ComPDFKitDemo\n   dotnet new console -o \"ComPDFKit Demo\"\n   ```\n\n2. Copy the ComPDFKitNative.so file and ComPDFKit Copy the NET.dll file to the project folder.\n\n3. Add the following code to the. csproj file:\n\n   ```xml\n   \u003cItemGroup\u003e\n    \u003cReference Include=\"ComPDFKit.NET.dll\"\u003e\n      \u003cHintPath\u003eComPDFKit.NET.dll\u003c/HintPath\u003e\n    \u003c/Reference\u003e\n   \u003c/ItemGroup\u003e\n   \n   \u003cItemGroup\u003e\n       \u003cContent Include=\"ComPDFKitNative.so\"\u003e\n           \u003cCopyToOutputDirectory\u003ePreserveNewest\u003c/CopyToOutputDirectory\u003e\n       \u003c/Content\u003e\n   \u003c/ItemGroup\u003e\n   ```\n\n   Your final ComPDFKit Demo.csproj file should look like this:\n\n   ```xml\n   \u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n   \n       \u003cPropertyGroup\u003e\n           \u003cOutputType\u003eExe\u003c/OutputType\u003e\n           \u003cTargetFramework\u003enet6.0\u003c/TargetFramework\u003e\n       \u003c/PropertyGroup\u003e\n   \n       \u003cItemGroup\u003e\n           \u003cReference Include=\"ComPDFKit.NET.dll\"\u003e\n               \u003cHintPath\u003eComPDFKit.NET.dll\u003c/HintPath\u003e\n           \u003c/Reference\u003e\n       \u003c/ItemGroup\u003e\n   \n       \u003cItemGroup\u003e\n           \u003cContent Include=\"ComPDFKitNative.so\"\u003e\n               \u003cCopyToOutputDirectory\u003ePreserveNewest\u003c/CopyToOutputDirectory\u003e\n           \u003c/Content\u003e\n       \u003c/ItemGroup\u003e\n   \n   \u003c/Project\u003e\n   ```\n\n### Integrate with NuGet\n\n1. Create a new project named ComPDFKit Demo_ through the console:\n\n   ```shell\n   mkdir ComPDFKitDemo\n   cd ComPDFKitDemo\n   dotnet new console -o \"ComPDFKit Demo\"\n   ```\n\n2. Enter the project folder and install ComPDFKit Core NuGet package:\n\n   ```bash\n   dotnet add package ComPDFKit.NetCore\n   ```\n\n### Create PDF Document\n\nWe have completed all the preparation steps. Now let's use the ComPDFKit PDF SDK to create a PDF file with a blank page, and replace your Program. cs file with the following code. Note that you need to replace your license in the 'LicenseVerify()' method.\n\n```csharp\nusing ComPDFKit.NativeMethod;\nusing ComPDFKit.PDFDocument;\nusing System.Reflection.Metadata;\n\nnamespace ComPDFKit_Demo\n{\n    public class Program\n    {\n        private static bool LicenseVerify()\n        {\n            if (!CPDFSDKVerifier.LoadNativeLibrary())\n                return false;\n            LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(\"Input your license here\");\n            return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);\n        }\n        \n        public static void Main()\n        { \n            LicenseVerify();\n            CPDFDocument document = CPDFDocument.CreateDocument();\n\t\t\tint pageIndex = 0;\n\t\t\tint pageWidth = 595;\n\t\t\tint pageHeight = 842;\n\t\t\tdocument.InsertPage(pageIndex, pageWidth, pageHeight, \"\");\n\t\t\tdocument.WriteToFilePath(\"new_file.pdf\");\n            Console.WriteLine(\"Done. Results saved in new_file.pdf\");\n        }\n    }\n}\n```\n\nNow you can run the program from the command line:\n\n```bash\ndotnet run\n```\n\nNow you will find the 'new_file. pdf' file in the program output directory, which is a PDF file with a blank page.\n\n# Get Started for macOS\n\n## Requirements\n\n- .NET Core SDK\n\n  **Note:** ComPDFKit PDF SDK is multi-targeting. Target Frameworks : .NET Core 2.1+, .NET Standard 2.0, .NET 5, .NET 6, .NET 7, .NET 8。\n\n- ComPDFKit 's .NET Core PDF Library for macOS:\n  Please [contact us ](https://www.compdf.com/contact-sales )to obtain the ComPDFKit PDF SDK for NET Core.\n\n- ComPDFKit PDF SDK license\n\n  Commercial license keys are required for use in production environments. If you do not have a valid license key, please [contact us]( https://www.compdf.com/contact-sales) to obtain the license key.\n\n  License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).\n\n## Run the Samples\n\nEnter the sample folder and run the example from the command line:\n\n- Input/ Run. sh all to run all examples.\n- Input/ Run. sh\u003csamplename\u003eRun a specific example. For example/ Run. sh BatesTest.\n\nIf you receive an error message bash:/ Test. sh: Permission denied, you need to enter the following command:\n\n```\nchmod +x run.sh\n```\n\n## Integrate into your Application\n\nYou can follow the manual or nuget integration described below for operation. This section will help you build your first ComPDFKit application. If you can open, save, and close PDFDoc, you can easily integrate the rest of the ComPDFKit PDF SDK.\n\n### Integrate Manually\n\n1. Create a new project named ComPDFKit Demo_ through the console\n\n   ```\n   mkdir ComPDFKitDemo\n   cd ComPDFKitDemo\n   dotnet new console -o \"ComPDFKit Demo\"\n   ```\n\n2. Copy the libComPDFKit.dylib file and the ComPDFKit.Desk.Core.dll file to the project folder.\n\n3. Add the following code to the .csproj file:\n\n   ```xml\n   \u003cItemGroup\u003e\n       \u003cReference Include=\"ComPDFKit.NET.dll\"\u003e\n           \u003cHintPath\u003eComPDFKit.Desk.Core.dll\u003c/HintPath\u003e\n       \u003c/Reference\u003e\n   \u003c/ItemGroup\u003e\n   \n   \u003cItemGroup\u003e\n       \u003cContent Include=\"libComPDFKit.dylib\"\u003e\n           \u003cCopyToOutputDirectory\u003ePreserveNewest\u003c/CopyToOutputDirectory\u003e\n       \u003c/Content\u003e\n   \u003c/ItemGroup\u003e\n   ```\n\n   Your final ComPDFKit Demo.csproj file should look like this:\n\n   ```xml\n   \u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n   \n       \u003cPropertyGroup\u003e\n           \u003cOutputType\u003eExe\u003c/OutputType\u003e\n           \u003cTargetFramework\u003enet6.0\u003c/TargetFramework\u003e\n       \u003c/PropertyGroup\u003e\n   \n       \u003cItemGroup\u003e\n           \u003cReference Include=\"ComPDFKit.Desk.Core.dll\"\u003e\n               \u003cHintPath\u003eComPDFKit.Desk.Core.dll\u003c/HintPath\u003e\n           \u003c/Reference\u003e\n       \u003c/ItemGroup\u003e\n   \n       \u003cItemGroup\u003e\n           \u003cContent Include=\"libComPDFKit.dylib\"\u003e\n               \u003cCopyToOutputDirectory\u003ePreserveNewest\u003c/CopyToOutputDirectory\u003e\n           \u003c/Content\u003e\n       \u003c/ItemGroup\u003e\n   \n   \u003c/Project\u003e\n   ```\n\n### Integrate with NuGet\n\n1. Create a new project named ComPDFKit Demo in the console:\n\n   ```shell\n   mkdir ComPDFKitDemo\n   cd ComPDFKitDemo\n   dotnet new console -o \"ComPDFKit Demo\"\n   ```\n\n2. Go to the project folder and install the ComPDFKit.Core NuGet package:\n\n   ```bash\n   dotnet add package ComPDFKit.NetCore\n   ```\n\n### Create PDF Document\n\nWe have completed all the preparation steps. Now let us use ComPDFKit PDF SDK to create a PDF file with a blank page. Replace your Program.cs file with the following code. Note: You need to replace your license into the `LicenseVerify()` method.\n\n```csharp\nusing ComPDFKit.NativeMethod;\nusing ComPDFKit.PDFDocument;\nusing System.Reflection.Metadata;\n\nnamespace ComPDFKit_Demo\n{\n    public class Program\n    {\n        private static bool LicenseVerify()\n        {\n            if (!CPDFSDKVerifier.LoadNativeLibrary())\n                return false;\n            LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(\"Input your license here\");\n            return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);\n        }\n        \n        public static void Main()\n        { \n            LicenseVerify();\n            CPDFDocument document = CPDFDocument.CreateDocument(); \n\t\t\tint pageIndex = 0;\n\t\t\tint pageWidth = 595;\n\t\t\tint pageHeight = 842; \n\t\t\tdocument.InsertPage(pageIndex, pageWidth, pageHeight, \"\");\n\t\t\tdocument.WriteToFilePath(\"new_file.pdf\");\n            Console.WriteLine(\"Done. Results saved in new_file.pdf\");\n        }\n    }\n}\n```\n\nNow you can run the program from the command line:\n\n```shell\ndotnet run\n```\n\nYou will now find the `new_file.pdf` file in the program output directory, which is a PDF file with a blank page.\n\n# Support\n\n[ComPDFKit]((https://www.compdf.com)) has a professional R\u0026D team that produces comprehensive technical documentation and guides to help developers. Also, you can get an immediate response when reporting your problems to our support team.\n\n- For detailed information, please visit our [Guides](https://www.compdf.com/guides/pdf-sdk/windows/overview) page.\n\n- Stay updated with the latest improvements through our [Changelog](https://www.compdf.com/pdf-sdk/changelog-windows).\n\n- For technical assistance, please reach out to our [Technical Support](https://www.compdf.com/support).\n\n- To get more details and an accurate quote, please contact our [Sales Team](https://compdf.com/contact-us).\n\n\n\n\n# License\n\nComPDFKit PDF SDK supports flexible licensing options, please contact [our sales team](mailto:support@compdf.com) to know more. Each license is only valid for one application ID in development mode.  However, any documents, sample code, or source code distribution from the released package of ComPDFKit PDF SDK to any third party is prohibited.\n\n\n\n# Note\n\nWe are glad to announce that you can register a ComPDFKit API account for a [free trial](https://api.compdf.com/api/pricing) to process 1000 documents per month for free.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompdfkit%2Fcompdfkit-pdf-sdk-netcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompdfkit%2Fcompdfkit-pdf-sdk-netcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompdfkit%2Fcompdfkit-pdf-sdk-netcore/lists"}