c# - What's the best way to adding a user's signature to a PDF document online? -
I would add a PDF document online to a user's signature (like your signature on the credit card, for example). How can i What is the best practice for such actions?
You can use it to. This will work for you:
pdfReader pdfReader = null; Pdfstammer pdfstamp = faucet; // Open the PDF file to sign pdfReader = new PDF Reader (this.signFile.FullName); // To use Stripped PDF to output stream (filestream outstream = new flamestream (target filename, foilmod.creative)) {try {// a signature pdfstammer = PDF with new PDF format (pdf reader, outstream) Stammers to make tickets; // Load signature image iTextSharp.text.Image sigImg = iTextSharp.text.Image.GetInstance (SIGNATURE_IMAGE_PATH); // image scale to fit sigImg.ScaleToFit (MAX_WIDTH, MAX_HEIGHT); // Set the signature status on the page sigImg.SetAbsolutePosition (POS_X, POS_X); // Add signature to the desired page PdfContentByte = pdfStamper.GetOverContent (PAGE_NUM_TO_SIGN); Over.AddImage (sigImg); } Finally {// clean (pdfStamper! = Null) pdfStamper.Close (); If (pdfReader! = Null) pdfReader.Close (); }}
Comments
Post a Comment