PPTX DOCX XLSX PDF ODP
Aspose.PDF  for Python for .NET
PDF

Add Image Stamp PDF via Python

Create Image Stamp with Aspose.PDF using Python APIs.

How to add Image Stamps to PDF Using Python for .NET Library

In order to work with image stamp into PDF file, we’ll use Aspose.PDF for .NET API which is a feature-rich, powerful and easy to use document manipulation API for python-net platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.

Add Image Stamp to PDF Document Python

You need Aspose.PDF for Python to try the code in your environment.

  1. Load the PDF with an instance of Document.
  2. Open a PDF document using Document object.
  3. Create a Image Stamp and define its properties.
  4. Add the Stamp to Page using AddStamp method

System Requirements

Just make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, and PHP, VBScript, Delphi, C++ via COM Interop.
  • Development environment like Microsoft Visual Studio.
  • Aspose.PDF for .NET DLL referenced in your project.
 

Add Image Stamp to PDF - Python.

    # Open document
    pdfDocument = Document(dataDir+ "AddImageStamp.pdf")

    # Create image stamp
    imageStamp = ImageStamp(dataDir + "aspose-logo.jpg")
    imageStamp.Background = true
    imageStamp.XIndent = 100
    imageStamp.YIndent = 100
    imageStamp.Height = 300
    imageStamp.Width = 300
    imageStamp.Rotate = Rotation.on270
    imageStamp.Opacity = 0.5

    # Add stamp to particular page
    pdfDocument.Pages[1].AddStamp(imageStamp)

    dataDir = dataDir + "AddImageStamp_out.pdf"
    # Save output document
    pdfDocument.Save(dataDir)
 

About Aspose.PDF for Python API

Aspose.PDF API can be used for PDF document manipulation and parsing within applications. One can create, modify, compress, secure, print or save PDF to TXT, HTML, PCL, XFA, XML, XPS, EPUB, TEX, Images and more formats. Aspose.PDF is a standalone API and it does not depend on any software including Adobe Acrobat.