pdf文件加水印源代码
给pdf文件加水印。源代码有详解。主要代码: PdfReader pdfReader = new PdfReader(inputPath); int numberOfPages = pdfReader.NumberOfPages; FileStream outputStream = new FileStream(outputPath, FileMode.Create); PdfStamper pdfStamper = new PdfStamper(pdfReader, outputStream); PdfContentByte waterMarkContent; string watermarkimagepath = watermarkPath; iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(watermarkimagepath); image.SetAbsolutePosit ion(250, 675); image.ScaleAbsoluteHeight(50); image.ScaleAbsoluteWidth(50); waterMarkContent = pdfStamper.GetUnderContent(1); waterMarkContent.AddImage(image); pdfStamper.Close(); pdfReader.Close(); System.IO.File.Delete(inputPath); System.IO.File.Move(outputPath, inputPath); System.IO.File.Delete(outputPath);
用户评论
不好用啊,不能满足需求
也不是jar,只有个txt,内容也太不详细了,不建议下载
东西不错,正是需要的