Edit PDF in C#

Edit PDF documents in C# using Aspose.Slides for .NET.

Edit PDF Using Aspose.Slides

Aspose.Slides for .NET can import PDF pages into a presentation, update slide content, and save the result as a PDF document.

Edit PDF in C#

Using Aspose.Slides for .NET , you can update text imported from a PDF document with a few lines of C# code.

C# code for editing PDF

using var presentation = new Presentation();
presentation.Slides.RemoveAt(0);
presentation.Slides.AddFromPdf("document.pdf");

var slide = presentation.Slides[0];

if (slide.Shapes[0] is IAutoShape shape && shape.TextFrame is not null)
{
    shape.TextFrame.Text = "New text";
}

presentation.Save("document.pdf", SaveFormat.Pdf);

How to Edit PDF

  1. Install Aspose.Slides for .NET .

  2. Create a Presentation object.

  3. Load PDF content with AddFromPdf.

  4. Access the target slide and shape through variables.

  5. Update the text through TextFrame and save with SaveFormat.Pdf.

Edit other files

You can also edit files in other formats