PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon May 28, 2018 3:12 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Apr 24, 2018 3:39 am 
Offline

Joined: Tue Apr 24, 2018 3:18 am
Posts: 2
Hello. I have run into an image issue. I have an image located in the project root which is of type content and set as always copy. When i run the exe from both release and debug folders in bin, the image is shown in the generated pdf.

.AddImage(“abc.png”)

Issue 1.
When i create the installer for my project using advanced installer. The generated pdf shows image not found. The image file is present in the root folder of the installed project. Works with debug/release exes but not with installers.

Issue 2.
When i try to access the same file in Resources/Images/abc.png, the generated pdf shows image not found in both release and debug exes.

Have been trying to get the path right with no success.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 24, 2018 8:11 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2815
Location: Cologne, Germany
Hi!
bprasad wrote:
Have been trying to get the path right with no success.
Since your question does not provide enough details, I cannot tell you how to fix it.

The PdfDocumentRenderer class has a WorkingDirectory property that could be used to resolve the issue.
The Document class has an ImagePath property that could be used to resolve the issue.

Your process has a working folder. You could resolve the issue by setting a different working folder.

When running the EXE from Visual Studio the working folder could be two or three levels above the folder with the EXE file. You can set the working folder in VS to get consistent behavior between installed version and development version.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 24, 2018 6:49 pm 
Offline

Joined: Tue Apr 24, 2018 3:18 am
Posts: 2
Thomas Hoevel wrote:
The PdfDocumentRenderer class has a WorkingDirectory property that could be used to resolve the issue.
The Document class has an ImagePath property that could be used to resolve the issue.

Your process has a working folder. You could resolve the issue by setting a different working folder.


Got it working. Thank you


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

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 8 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:  
Powered by phpBB® Forum Software © phpBB Group