Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The following code snippet also work with Aspose.PDF.Drawing library.
The Images collection’s Replace method allows you to replace an image in an existing PDF file.
The Images collection can be found in a page’s Resources collection. To replace an image:
The following code snippet shows you how to replace an image in a PDF file.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ReplaceImageInPDF()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "ReplaceImage.pdf"))
    {
        // Replace a particular image in the document
        using (var imageStream = new FileStream(dataDir + "NewImage.jpg", FileMode.Open))
        {
            document.Pages[1].Resources.Images.Replace(1, imageStream);
        }
        // Save PDF document
        document.Save(dataDir + "ReplaceImage_out.pdf");
    }
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.