Hi @Qamar, Mo ,
In the JavaScript function, use XmlHt tpRe quest to make an AJ AX call to the SetSe ssion WebMethod and send the values to the WebMethod.
The WebMethod then returns a string, which is displayed using a JavaSc ript al ert message box.
Here is the example.179622-345.txt
EDIT
179925-front.txt
code behind
public static void UploadImage(string imageData)
{
byte[] data = Convert.FromBase64String(imageData);
Document pdfDoc = new Document();
var output = new FileStream(HttpContext.Current.Server.MapPath("2.pdf"), FileMode.Create);
PdfWriter writer = PdfWriter.GetInstance(pdfDoc, output);
pdfDoc.Open();
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(data);
pdfDoc.Add(img);
pdfDoc.Close();
}
protected void Button1_Click1(object sender, EventArgs e)
{
Process.Start(Server.MapPath("2.pdf"));
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.