string FileLocation = "D:\\pdftmp\\102\\09\\10209240001.pdf"; //PDF原始檔路徑 string WatermarkLocation = "D:\\www\\aspx\\cute\\water-4.png"; //浮水印圖檔路徑 Document document = new Document(); PdfReader pdfReader = new PdfReader(FileLocation); PdfStamper stamp = new PdfStamper(pdfReader, new FileStream(FileLocation.Replace(".pdf", "[temp][file].pdf"), FileMode.Create)); iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(WatermarkLocation); img.SetAbsolutePosition(560, 100); // 圖片位置 (560,0 = 距離 左方,下方 位置) img.ScalePercent(35f); //縮放比例 PdfContentByte waterMark; for (int page = 1; page <= pdfReader.NumberOfPages; page++) { waterMark = stamp.GetOverContent(page); waterMark.AddImage(img); } stamp.FormFlattening = true; stamp.Close(); File.Delete(FileLocation); File.Move(FileLocation.Replace(".pdf", "[temp][file].pdf"), FileLocation);