PdfWriter.GetInstance(pdfDoc, System.Web.HttpContext.Current.Response.OutputStream); pdfDoc.Open(); //Set Font Properties for PDF File Font fnt = FontFactory.GetFont("Times New Roman", 14); PdfPTable PdfTable = new PdfPTable(1); PdfPCell PdfPCell = null;
//Retrieve content from design side string chk; chk = "address"; string adr1 = txtadr1.Text; PdfPCell = new PdfPCell(new Phrase(new Chunk(chk + adr1))); PdfTable.AddCell(PdfPCell);
I m try the below code,when i enter textbox values is text means they come output properly in PDF for ...that same time i inclued images on the text area they throw error.....(error:The URI prefix is not recognized)
Venkat S73 reputationPosted Jun 24, 2015, 4:18 AM EDT
0
I m try the below code,when i enter textbox values is text means they come output properly in PDF for ...that same time i inclued images on the text area they throw error.....(error:The URI prefix is not recognized)
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 24, 2015, 3:49 AM EDT
{
PdfWriter.GetInstance(pdfDoc, System.Web.HttpContext.Current.Response.OutputStream);
pdfDoc.Open();
//Set Font Properties for PDF File
Font fnt = FontFactory.GetFont("Times New Roman", 14);
PdfPTable PdfTable = new PdfPTable(1);
PdfPCell PdfPCell = null;
//Retrieve content from design side
string chk;
chk = "address";
string adr1 = txtadr1.Text;
PdfPCell = new PdfPCell(new Phrase(new Chunk(chk + adr1)));
PdfTable.AddCell(PdfPCell);
string adr2 = txtadr2.Text;
PdfPCell addrchk = new PdfPCell(new Phrase(new Chunk(adr2)));
PdfTable.AddCell(addrchk);
string adr3 = txtadr3.Text;
PdfPCell addrchk1 = new PdfPCell(new Phrase(new Chunk(adr3)));
PdfTable.AddCell(addrchk1);
string cty = txtcty.Text;
PdfPCell cty1 = new PdfPCell(new Phrase(new Chunk(cty)));
PdfTable.AddCell(cty1);
string stat = txtstat.Text;
PdfPCell stat1 = new PdfPCell(new Phrase(new Chunk(stat)));
PdfTable.AddCell(stat1);
string code = txtcode.Text;
PdfPCell code1 = new PdfPCell(new Phrase(new Chunk(code)));
PdfTable.AddCell(code1);
string cntry = txtcntry.Text;
PdfPCell cntry1 = new PdfPCell(new Phrase(new Chunk(cntry)));
PdfTable.AddCell(cntry1);
string mob = txtmbl.Text;
PdfPCell mob1 = new PdfPCell(new Phrase(new Chunk(mob)));
PdfTable.AddCell(mob1);
pdfDoc.Add(PdfTable);
pdfDoc.Close();
Response.ContentType = "application/pdf";
System.Web.HttpContext.Current.Response.Write(pdfDoc);
Response.Flush();
Response.End();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
Venkat S73 reputationPosted Jun 24, 2015, 4:07 AM EDT
You Entered:
Venkat S73 reputationPosted Jun 24, 2015, 4:18 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 24, 2015, 4:31 AM EDT
Jaipal ReddyRank #588 · 4.1K reputationPosted Jun 24, 2015, 6:14 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts