How to add watermark to PDF file in Python
Build your own Python apps to watermarking PDF files using server-side APIs.
How to Watermark PSD File Using Python
In order to add watermark PDF file, Aspose.PDF for .NET
API which is a feature-rich, powerful and easy to use PDF manipulation and conversion API for Python platform. Even one can also generates password-protected PDF files. Create requirements.txt
with this content.
pip==21.3.1
pycparser==2.21
pythonnet==2.5.2
setuptools==60.1.0
PowerShell Console
pip install -r requirements.txt
Steps to Add Watermark to PSD via Python
You need the aspose.pdf.dll to try the following workflow in your own environment.
- Load PDF file with an instance of Document
- Create an instance of WatermarkArtifact
- Set properties of WatermarkArtifact object
- Add watermark using method Add of Aspose.Pdf.Page.Artifacts collection class
- Save PDF file
System Requirements
Aspose.PDF for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.
- Microsoft Windows or a compatible Linux OS with .NET Framework, .NET Core.
- Development environment like Microsoft Visual Studio Code or JetBrains PyCharm.
- Aspose.PDF for .NET DLL referenced in your project.
Add Watermark to PSD - Python
Document document = new Document(_dataDir + "text.pdf");
WatermarkArtifact artifact = new WatermarkArtifact();
artifact.SetTextAndState(
"WATERMARK",
new TextState()
{
FontSize = 72,
ForegroundColor = Color.Blue,
Font = FontRepository.FindFont("Courier")
});
artifact.ArtifactHorizontalAlignment = HorizontalAlignment.Center;
artifact.ArtifactVerticalAlignment = VerticalAlignment.Center;
artifact.Rotation = 45;
artifact.Opacity = 0.5;
artifact.IsBackground = true;
document.Pages[1].Artifacts.Add(artifact);
document.Save(_dataDir + "watermark.pdf");
About Aspose.PDF for .NET 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.Watermark PSD via Online App
Add watermark to PSD documents by visiting our Live Demos website. The live demo has the following benefits
PSD What is PSD File Format
PSD, Photoshop Document, represents Adobe Photoshop's native file format used for graphics designing and development. PSD files may include image layers, adjustment layers, layer masks, annotations, file information, keywords and other Photoshop-specific elements. Photoshop files have default extension as .PSD and has a maximum height and width of 30,000 pixels, and a length limit of two gigabytes.
Read More