Quickly learn how to add image stamp in PDF with PDF extractor SDK in C# with this sample source code. ByteScout PDF Suite: the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript. It can add image stamp in PDF with PDF extractor SDK in C#.
The following code snippet for ByteScout PDF Suite works best when you need to quickly add image stamp in PDF with PDF extractor SDK in your C# application. Follow the instructions from scratch to work and copy the C# code. Further improvement of the code will make it more robust.
ByteScout provides the free trial version of ByteScout PDF Suite along with the documentation and source code samples.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System.Diagnostics; using System.Drawing; using Bytescout.PDFExtractor; namespace AddImageStampInPDF { class Program { static void Main(string[] args) { string inputFile = @".\Invoice.pdf"; string outputFile = @".\Invoice_Stamped.pdf"; string stampImageFile = @".\stamp_image.png"; using (Stamper stamper = new Stamper("demo", "demo")) { // Optionally make the image background transparent // stamper.MakeStampImageTransparent = true; using (Image image = Image.FromFile(stampImageFile)) { // Get image size in PDF units SizeF imageSizeInPoints = stamper.GetImageSizeInPoints(image); RectangleF rectangle = new RectangleF(440, 370, imageSizeInPoints.Width / 3, imageSizeInPoints.Height / 3); stamper.Stamp(inputFile, outputFile, image, rectangle, 0, -1); } } // Open first output file in default associated application (for demo purposes) ProcessStartInfo processStartInfo = new ProcessStartInfo(outputFile); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: