PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

WPF PDF Image not found on creating installer
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3773
Page 1 of 1

Author:  bprasad [ Tue Apr 24, 2018 3:39 am ]
Post subject:  WPF PDF Image not found on creating installer

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.

Author:  Thomas Hoevel [ Tue Apr 24, 2018 8:11 am ]
Post subject:  Re: WPF PDF Image not found on creating installer

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.

Author:  bprasad [ Tue Apr 24, 2018 6:49 pm ]
Post subject:  Re: WPF PDF Image not found on creating installer

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/