PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 1:37 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Dec 24, 2008 6:23 am 
Offline

Joined: Wed Dec 24, 2008 6:15 am
Posts: 1
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 ?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 08, 2009 10:15 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 08, 2009 2:20 pm 
Offline
User avatar

Joined: Tue Oct 14, 2008 6:15 pm
Posts: 32
Location: USA
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")


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 13, 2012 7:36 pm 
Offline

Joined: Mon Feb 13, 2012 7:30 pm
Posts: 1
I would appreciate some more explanation on this solution.
I am using Migradoc on a webpage.
The class is in the subdirectory appcode and the images are in the subdirectory images.
I can't find the way to show the images in the output page.
Similar code works fine as a console application (but there it i easy to find the images)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group