Click here to Skip to main content
16,017,373 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Disabling all fields in new way?? using asp.net?? Pin
Ashfield23-Sep-08 1:41
Ashfield23-Sep-08 1:41 
AnswerRe: Disabling all fields in new way?? using asp.net?? Pin
N a v a n e e t h22-Sep-08 22:40
N a v a n e e t h22-Sep-08 22:40 
GeneralRe: Disabling all fields in new way?? using asp.net?? Pin
Karan_TN22-Sep-08 23:03
Karan_TN22-Sep-08 23:03 
GeneralRe: Disabling all fields in new way?? using asp.net?? Pin
N a v a n e e t h22-Sep-08 23:52
N a v a n e e t h22-Sep-08 23:52 
GeneralRe: Disabling all fields in new way?? using asp.net?? Pin
simsen23-Sep-08 3:41
simsen23-Sep-08 3:41 
GeneralRe: Disabling all fields in new way?? using asp.net?? Pin
Karan_TN25-Sep-08 18:27
Karan_TN25-Sep-08 18:27 
QuestionImages display problem in IE 8 Pin
Khawar Abbas122-Sep-08 21:18
Khawar Abbas122-Sep-08 21:18 
QuestionError while converting from ASP . NET to PDf Pin
kvsreedhar22-Sep-08 20:50
kvsreedhar22-Sep-08 20:50 
Anyone please help me

I have a program which converts a .txt file to PDF file . I am getting the following error while running the program
Error
'C:\Documents and Settings\........' is not a valid virtual path in ASP . NET
I give my Code below ...

code in button Click
---------------------------
String fileName = "";
String strText = "";
// create instance of the PDF manager
IPdfManager objPDF = new PdfManager();

// Create new document
IPdfDocument objDoc = objPDF.CreateDocument(Missing.Value);

// Add a page to document. Pages are intentionally small to demonstrate text spanning
IPdfPage objPage = objDoc.Pages.Add(300, 300, Missing.Value);

// use Arial font
IPdfFont objFont = objDoc.Fonts["Arial", Missing.Value];


fileName = Path.GetFullPath(fileUpload1.PostedFile.FileName);



try
{
strText = objPDF.LoadTextFromFile(Server.MapPath(fileName));
}
catch (Exception ex)
{
Response.Write("error is "+ex.Message);
}

// Parameters: X, Y of upper-left corner of text box, Height, Width
IPdfParam objParam = objPDF.CreateParam("x=10; y=290; width=280; height=280; html=true");

while (strText.Length > 0)
{
// DrawText returns the number of characters that fit in the box allocated.
int nCharsPrinted = objPage.Canvas.DrawText(strText, objParam, objFont);

// HTML tag generated by DrawText to reflect current font state
String strHtmlTag = objPage.Canvas.HtmlTag;

// The entire string printed? Exit loop.
if (nCharsPrinted == strText.Length)
break;

// Otherwise print remaining text on next page
objPage = objPage.NextPage;

strText = strHtmlTag + strText.Substring(nCharsPrinted);
}

// Save document, the Save method returns generated file name
String strFilename = objDoc.Save(Server.MapPath("mask.pdf"), false);

lblResult.Text = "Success! Download your PDF file <A HREF=" + strFilename + ">here</A>";
----------------------------

Rose | [Rose] Thanks in Advance Rose | [Rose]

Kovuru Sreedhar

AnswerRe: Error while converting from ASP . NET to PDf Pin
Ashfield22-Sep-08 21:15
Ashfield22-Sep-08 21:15 
GeneralRe: Error while converting from ASP . NET to PDf Pin
kvsreedhar22-Sep-08 21:26
kvsreedhar22-Sep-08 21:26 
GeneralRe: Error while converting from ASP . NET to PDf Pin
Tamer Oz22-Sep-08 21:29
Tamer Oz22-Sep-08 21:29 
QuestionCreating Folder at Server through client. Pin
Binod K22-Sep-08 20:25
Binod K22-Sep-08 20:25 
AnswerRe: Creating Folder at Server through client. Pin
Imran Khan Pathan22-Sep-08 20:39
Imran Khan Pathan22-Sep-08 20:39 
GeneralRe: Creating Folder at Server through client. Pin
Binod K22-Sep-08 21:25
Binod K22-Sep-08 21:25 
GeneralRe: Creating Folder at Server through client. Pin
Tamer Oz22-Sep-08 21:35
Tamer Oz22-Sep-08 21:35 
GeneralRe: Creating Folder at Server through client. Pin
Binod K22-Sep-08 21:54
Binod K22-Sep-08 21:54 
QuestionPOSTBACK PROBLEM Pin
kuwl_mark22-Sep-08 19:37
kuwl_mark22-Sep-08 19:37 
AnswerRe: POSTBACK PROBLEM Pin
N a v a n e e t h22-Sep-08 19:51
N a v a n e e t h22-Sep-08 19:51 
GeneralRe: POSTBACK PROBLEM Pin
Perspx22-Sep-08 20:17
Perspx22-Sep-08 20:17 
QuestionDoubt about List box Control Pin
pradees4u22-Sep-08 19:32
pradees4u22-Sep-08 19:32 
QuestionSession management problem Pin
krishnaveer22-Sep-08 18:45
krishnaveer22-Sep-08 18:45 
GeneralRe: Session management problem Pin
Krazy Programmer22-Sep-08 19:37
Krazy Programmer22-Sep-08 19:37 
GeneralRe: Session management problem Pin
krishnaveer22-Sep-08 19:54
krishnaveer22-Sep-08 19:54 
GeneralRe: Session management problem Pin
Tamer Oz22-Sep-08 20:55
Tamer Oz22-Sep-08 20:55 
QuestionAccessing properties of a control through Javascript Pin
Crazy Genius22-Sep-08 18:04
Crazy Genius22-Sep-08 18:04 

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.