Click here to Skip to main content
16,010,022 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Login as different user in asp.net as in sharepoint slightly off topic Pin
Richard MacCutchan16-Nov-09 0:48
mveRichard MacCutchan16-Nov-09 0:48 
GeneralRe: Login as different user in asp.net as in sharepoint Pin
Christian Graus16-Nov-09 0:01
protectorChristian Graus16-Nov-09 0:01 
GeneralRe: Login as different user in asp.net as in sharepoint Pin
Abhishek Sur16-Nov-09 9:28
professionalAbhishek Sur16-Nov-09 9:28 
Questioncustomize crystal report records Pin
vikas shukla15-Nov-09 20:31
vikas shukla15-Nov-09 20:31 
AnswerRe: customize crystal report records Pin
Abhishek Sur15-Nov-09 21:20
professionalAbhishek Sur15-Nov-09 21:20 
Questioncrystal report toolbar button is not working Pin
vikas shukla15-Nov-09 20:19
vikas shukla15-Nov-09 20:19 
AnswerRe: crystal report toolbar button is not working Pin
Abhishek Sur15-Nov-09 21:25
professionalAbhishek Sur15-Nov-09 21:25 
QuestionPDFSharp Not Working Pin
nccs123415-Nov-09 18:51
nccs123415-Nov-09 18:51 
Hellow Expert,
I am using PDFSharp for Create PDF file in my Application It works fine and Generate the PDF file and save it in the specified location in Local host but when i upload this in WEB Server it is not working nor throwing any error please suggest me



My code is
----------


if (main_id > 0)
{
dtInvdata = BLObjectTrans.selectInvoiceMasterfromInvNO(invNO, main_id);

}

string filename1 = "invoice.pdf";
File.Copy(Path.Combine(Server.MapPath("template_bank_debit_pdf/"), filename1),
Path.Combine(Directory.GetCurrentDirectory(), filename1), true);

//open pdf document
filename1 = Path.Combine(Server.MapPath("template_bank_debit_pdf/"), filename1);

PdfDocument inputDocument1 = PdfReader.Open(filename1, PdfDocumentOpenMode.Import);


PdfDocument OutPutDoc = new PdfDocument();
int count = inputDocument1.PageCount;
if (count > 0)
{
PdfPage pageOut = OutPutDoc.AddPage(inputDocument1.Pages[0]);
XGraphics gfx = XGraphics.FromPdfPage(pageOut);
XTextFormatter tf = new XTextFormatter(gfx);


XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);
XFont font = new XFont("Times New Roman", 9, XFontStyle.Italic, options);
XFont font1 = new XFont("Times New Roman", 9, XFontStyle.Regular, options);
XFont font2 = new XFont("Times New Roman", 10, XFontStyle.Regular, options);
XFont font3 = new XFont("Times New Roman", 10, XFontStyle.Bold, options);
XFont font4 = new XFont("Times New Roman", 20, XFontStyle.Underline, options);


gfx.DrawString("SUBSCRIPTION INVOICE NUMBER:" + dtInvdata.Rows[0]["inv_no"].ToString(), font4, XBrushes.Black, new XRect(0, 175, pageOut.Width, pageOut.Height), XStringFormats.TopCenter);
gfx.DrawString("MEMBERSHIP NUMBER:", font3, XBrushes.Black, new XRect(57, 320, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString("DATE:", font3, XBrushes.Black, new XRect(57, 300, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString("MEMBERSHIP TYPE:", font3, XBrushes.Black, new XRect(80, 320, pageOut.Width, pageOut.Height), XStringFormats.TopCenter);
gfx.DrawString("SUBSCRIPTION AMOUNT:", font3, XBrushes.Black, new XRect(57, 335, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString("Dear " + RugbyCommon.IsNull(dtInvdata.Rows[0]["first_name"].ToString()) + ",", font2, XBrushes.Black, new XRect(57, 400, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString("Your membership subscription for the season" + RugbyCommon.IsNull(dtInvdata.Rows[0]["season"].ToString()) + "is " + RugbyCommon.ToStrCurrency(dtInvdata.Rows[0]["balance"].ToString()), font2, XBrushes.Black, new XRect(57, 450, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString("SUBSCRIPTION DUE", font3, XBrushes.Black, new XRect(57, 500, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(RugbyCommon.ToStrCurrency(dtInvdata.Rows[0]["balance"].ToString()), font3, XBrushes.Black, new XRect(170, 500, pageOut.Width, pageOut.Height), XStringFormats.TopCenter);
string maintext = dtInvdata.Rows[0]["bddremarks"].ToString();
string[] Split = maintext.Split(new Char[] { '.'});

string text1=(Convert.ToString(Split[0]));
string text2=(Convert.ToString(Split[1]));

gfx.DrawString(text1, font1, XBrushes.Black, new XRect(57, 600, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(text2, font1, XBrushes.Black, new XRect(57, 615, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
//gfx.DrawString(dtInvdata.Rows[0]["bddremarks"].ToString(), font1, XBrushes.Black, new XRect(57, 600,pageOut.Width,pageOut.Height), XStringFormats.TopLeft);

gfx.DrawString("THIS INVOICE IS PAID BY DIRECT DEBIT", font, XBrushes.Black, new XRect(0, -80, pageOut.Width, pageOut.Height), XStringFormats.BottomCenter);
gfx.DrawString(RugbyCommon.ToStrCurrency(dtInvdata.Rows[0]["balance"].ToString()), font2, XBrushes.Black, new XRect(190, 335, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(dtInvdata.Rows[0]["membership_no"].ToString(), font2, XBrushes.Black, new XRect(177, 320, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);

gfx.DrawString(dtInvdata.Rows[0]["invdate"].ToString(), font2, XBrushes.Black, new XRect(90, 300, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(dtInvdata.Rows[0]["membership_name"].ToString(), font2, XBrushes.Black, new XRect(150, 320, pageOut.Width, pageOut.Height), XStringFormats.TopCenter);
gfx.DrawString(RugbyCommon.IsNull(dtInvdata.Rows[0]["name"].ToString()), font2, XBrushes.Black, new XRect(57, 220, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(RugbyCommon.IsNull(dtInvdata.Rows[0]["address_1"].ToString()), font2, XBrushes.Black, new XRect(57, 230, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(RugbyCommon.IsNull(dtInvdata.Rows[0]["city"].ToString()), font2, XBrushes.Black, new XRect(57, 240, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);
gfx.DrawString(RugbyCommon.IsNull(dtInvdata.Rows[0]["county"].ToString()), font2, XBrushes.Black, new XRect(57, 250, pageOut.Width, pageOut.Height), XStringFormats.TopLeft);


string invoice = "Invoice" + ".pdf";
OutPutDoc.Save(Server.MapPath("pdfInvoice/") + invoice);
Process.Start(Server.MapPath("pdfInvoice/" + invoice));
OutPutDoc.Close();

--------
thanks
AnswerRe: PDFSharp Not Working Pin
Christian Graus15-Nov-09 19:09
protectorChristian Graus15-Nov-09 19:09 
QuestionMySql with ASP.net Pin
tanukochhar15-Nov-09 18:51
tanukochhar15-Nov-09 18:51 
AnswerRe: MySql with ASP.net Pin
Christian Graus15-Nov-09 19:35
protectorChristian Graus15-Nov-09 19:35 
AnswerRe: MySql with ASP.net Pin
Abhijit Jana15-Nov-09 20:13
professionalAbhijit Jana15-Nov-09 20:13 
QuestionTimesheet System... Pin
Illegal Operation15-Nov-09 18:50
Illegal Operation15-Nov-09 18:50 
AnswerRe: Timesheet System... Pin
_Damian S_15-Nov-09 19:24
professional_Damian S_15-Nov-09 19:24 
AnswerRe: Timesheet System... Pin
Christian Graus15-Nov-09 19:36
protectorChristian Graus15-Nov-09 19:36 
AnswerRe: Timesheet System... Pin
David Mujica16-Nov-09 4:23
David Mujica16-Nov-09 4:23 
QuestionIdea About documentation. Pin
lrsalunkhe15-Nov-09 18:38
lrsalunkhe15-Nov-09 18:38 
AnswerRe: Idea About documentation. Pin
Christian Graus15-Nov-09 19:50
protectorChristian Graus15-Nov-09 19:50 
Questioncommon practice for development 3 tiered application Pin
uglyeyes15-Nov-09 17:26
uglyeyes15-Nov-09 17:26 
AnswerRe: common practice for development 3 tiered application Pin
Christian Graus15-Nov-09 17:27
protectorChristian Graus15-Nov-09 17:27 
GeneralRe: common practice for development 3 tiered application [modified] Pin
uglyeyes15-Nov-09 17:45
uglyeyes15-Nov-09 17:45 
GeneralRe: common practice for development 3 tiered application Pin
Christian Graus15-Nov-09 19:37
protectorChristian Graus15-Nov-09 19:37 
GeneralRe: common practice for development 3 tiered application Pin
uglyeyes15-Nov-09 22:03
uglyeyes15-Nov-09 22:03 
GeneralRe: common practice for development 3 tiered application Pin
uglyeyes15-Nov-09 22:16
uglyeyes15-Nov-09 22:16 
QuestionI want to create paging by Datalist language VB.net [modified] Pin
sunshinesnow15-Nov-09 16:13
sunshinesnow15-Nov-09 16:13 

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.