views:

33

answers:

2

my application builds a pdf with images

in the solution explorer i added a folder called pics and dropped all the images there

when i run the program from my computer, there are no problems, but when i had a different user install the application they get this error:

alt text

here's how i am including the image:

Dim jpeg2 As Image = Image.GetInstance(Application.StartupPath & "\pics\1.jpg")

i am using the itextsharp library

why is the user having this problem?

+1  A: 

I would recommend Path.Combine(Application.StartupPath, "pics\1.jpg") after making sure that 1.jpg is present in the pics sub-folder relative to the executable of your application.

Darin Dimitrov
+3  A: 

In a comment to another (apparently) related question, you said that the build action for the file(s) was 'None'. Also, it appears that you are deploying the application via ClickOnce. Assuming both of these are, in fact, the case, I think if you set the build action to 'Content', it will work. That is, the image files will be included in the ClickOnce deployment package.

Daniel Pratt