Blazor PDF Editing with PDFsharp
This repository contains a Blazor Server application demonstrating the capabilities of editing PDF documents using the PDFsharp library. It offers a basic implementation of how to modify an existing PDF file by adding text, serving as a starting point for more complex PDF manipulation tasks in Blazor applications.
- Basic PDF editing using PDFsharp.
- Adding text to an existing PDF document.
- Simple Blazor UI for triggering the PDF editing process.
These instructions will help you get the project up and running on your local machine for development and testing purposes.
- .NET 7.0 SDK or later
- Visual Studio 2022 or a compatible IDE
- Clone the repository:
git clone https://github.com/PSPDFKit-labs/pdf-editing-blazor.git
- Open the solution file in Visual Studio.
- Build the solution by selecting
Build -> Build Solution
. - Run the application by selecting
Debug -> Start Debugging
. - Once the application is running, navigate to the main page.
- Use the provided button to edit the specified PDF file.
The application demonstrates basic PDF editing:
- A predefined PDF file (wwwroot/document.pdf) is edited when the user clicks the 'Edit PDF' button.
- The
PdfEditor
class adds specified text to the first page of the PDF. - Feel free to modify the PDF path and the editing logic in the
PdfEditor
class to explore further functionalities of PDFsharp.
Contributions are welcome! Please feel free to fork the repository and submit pull requests. Please ensure you have signed our CLA so that we can accept your contributions.