Click here to Skip to main content
15,902,923 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Getting error while running Workflow application. Pin
Abhijit Jana9-Jun-09 3:42
professionalAbhijit Jana9-Jun-09 3:42 
Questionlogin page Pin
sritha9-Jun-09 3:07
sritha9-Jun-09 3:07 
AnswerRe: login page Pin
Colin Angus Mackay9-Jun-09 3:21
Colin Angus Mackay9-Jun-09 3:21 
AnswerRe: login page Pin
saanj9-Jun-09 3:22
saanj9-Jun-09 3:22 
AnswerRe: login page Pin
Abhijit Jana9-Jun-09 3:38
professionalAbhijit Jana9-Jun-09 3:38 
QuestionProblem with linq to sql Pin
ais079-Jun-09 2:14
ais079-Jun-09 2:14 
AnswerRe: Problem with linq to sql Pin
Manas Bhardwaj9-Jun-09 2:29
professionalManas Bhardwaj9-Jun-09 2:29 
QuestionWrite HTML in PDF with iTextSharp Pin
vnsraj9-Jun-09 2:13
vnsraj9-Jun-09 2:13 
Hi All,

I need to create pdf file using iTextSharp. I can write simple text in my pdf file. But How can I add html content in pdf file.

I used string variable to hold html content. But when I use that variable my pdf file content not showing html format.

my Code given below :
private void createPDF()
{

//string newFile = @"N:\.NET\New Document.pdf";
string strContent = "";
StringWriter sw = new StringWriter();
string newFile = Server.MapPath("1.pdf");
Document doc = new Document();
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(newFile, FileMode.Create));
// Metadata
doc.AddCreator("PDF Printer by Joachim Tesznar");
doc.AddTitle("New PDF Document");

// Add content
doc.Open();
sw.Write(GetMailBodyOrderDetails().ToString());

doc.Add(new Paragraph(sw.ToString()));
doc.Close();
}

#region string GetMailBodyOrderDetails()
public string GetMailBodyOrderDetails()
{
StreamReader StmRdr1 = null;
FileInfo fi1 = null;
string strFileName1 = Request.PhysicalApplicationPath + "Registration.html";
fi1 = new FileInfo(strFileName1);
if (fi1.Exists)
{
StmRdr1 = File.OpenText(strFileName1);
StreamReaderStrLine1 = StmRdr1.ReadToEnd();
// StreamReaderStrLine1 = StreamReaderStrLine1.Replace("<TITLE>", ListingName).Replace("<PRICE>", Price.ToString()).Replace("<DESCRIPTION>", ListingDetail).Replace("<EMAIL>", Email).Replace("<COUNTRY>", Country).Replace("<STATE>", State).Replace("<SUBURB>", City).Replace("<TOPADS>", "No");
StreamReaderStrLine1 = StreamReaderStrLine1.Replace("\r\n", "");
StreamReaderStrLine1 = StreamReaderStrLine1.Replace("<!--body", ".body").Replace("}-->", "}").Replace("\t", "");
}
return StreamReaderStrLine1;
}
#endregion


please reply
Thanks
Raj
QuestionHow to read UNREAD mails from mail server through .netcode??? Pin
nkmkrishna9-Jun-09 2:02
nkmkrishna9-Jun-09 2:02 
AnswerRe: How to read UNREAD mails from mail server through .netcode??? Pin
saanj9-Jun-09 2:08
saanj9-Jun-09 2:08 
GeneralRe: How to read UNREAD mails from mail server through .netcode??? Pin
nkmkrishna9-Jun-09 2:24
nkmkrishna9-Jun-09 2:24 
GeneralRe: How to read UNREAD mails from mail server through .netcode??? Pin
saanj9-Jun-09 2:29
saanj9-Jun-09 2:29 
GeneralRe: How to read UNREAD mails from mail server through .netcode??? Pin
Abhijit Jana9-Jun-09 3:32
professionalAbhijit Jana9-Jun-09 3:32 
QuestionImporting Excel Sheet Which Have Dynamic Column Name And Dynamic Number Of Columns Pin
praveenkumar_mca9-Jun-09 1:24
praveenkumar_mca9-Jun-09 1:24 
Questionautorefresh Pin
naveen attri9-Jun-09 0:50
naveen attri9-Jun-09 0:50 
AnswerRe: autorefresh Pin
saanj9-Jun-09 0:58
saanj9-Jun-09 0:58 
AnswerRe: autorefresh Pin
Viral Upadhyay9-Jun-09 1:00
Viral Upadhyay9-Jun-09 1:00 
GeneralRe: autorefresh Pin
naveen attri12-Jun-09 2:22
naveen attri12-Jun-09 2:22 
GeneralRe: autorefresh Pin
Viral Upadhyay12-Jun-09 9:40
Viral Upadhyay12-Jun-09 9:40 
AnswerRe: autorefresh Pin
Christian Graus9-Jun-09 1:14
protectorChristian Graus9-Jun-09 1:14 
AnswerRe: autorefresh Pin
Baran M9-Jun-09 3:08
Baran M9-Jun-09 3:08 
Questionshow alert message when browser tab is closed Pin
ashok@techxygen9-Jun-09 0:24
ashok@techxygen9-Jun-09 0:24 
AnswerRe: show alert message when browser tab is closed Pin
saanj9-Jun-09 0:32
saanj9-Jun-09 0:32 
AnswerRe: show alert message when browser tab is closed Pin
satigar1238-Jul-09 9:22
satigar1238-Jul-09 9:22 
Questionshow alert message when browser is closed Pin
ashok@techxygen9-Jun-09 0:24
ashok@techxygen9-Jun-09 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.