View previous topic :: View next topic |
Author |
Message |
abhayp
Joined: 24 Dec 2008 Posts: 1
|
Posted: Wed Dec 24, 2008 6:23 am Post subject: MigraDoc - Not able to include Image |
|
|
Hi
I have a asp.net web application with the structure as follows
Root
- Images
- App_Code
- Myclass.cs
mypage.aspx
In the app_code folder i have a class that creates the Migradoc object for createing the document and include the image in it
Table newTable = section.AddTable();
newTable.Style = "Table";
newTable.Borders.Color = tableBorder;
newTable.Borders.Bottom.Width = 0.6;
newTable.Borders.Left.Width = 0.0;
newTable.Borders.Right.Width = 0.0;
newTable.Borders.Top.Width = 0.0;
newTable.Rows.LeftIndent = 0;
Column column1 = newTable.AddColumn("3cm");
column1 = newTable.AddColumn("13cm");
Row newrow = newTable.AddRow();
newrow.Cells[0].AddImage("../images/logo.gif");
This always shows "image not found" in the pdf document created
Can someone please advice what's wrong in that ? |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Thu Jan 08, 2009 10:15 am Post subject: Re: MigraDoc - Not able to include Image |
|
|
Hi!
abhayp wrote: | Can someone please advice what's wrong in that ? |
Probably wrong working directory.
You can set the ImagePath at the Document.
IIRC the working directory is not the directory with the ASPX file. But there's a method that returns the physical address of the ASPX file. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Thu Jan 08, 2009 2:20 pm Post subject: Re: MigraDoc - Not able to include Image |
|
|
Thomas Hoevel wrote: | Hi!
abhayp wrote: | Can someone please advice what's wrong in that ? |
Probably wrong working directory.
You can set the ImagePath at the Document.
IIRC the working directory is not the directory with the ASPX file. But there's a method that returns the physical address of the ASPX file. |
Server.MapPath("../images/logo.gif") |
|
Back to top |
|
|
|