PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 5:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Nov 23, 2012 4:22 pm 
Offline

Joined: Mon Nov 19, 2012 11:54 am
Posts: 16
Hi

I have set up a website on my dev server and when I test the page it creates the pdfs no problem. When I move them to my prod server almost everything fails to work.

for example it looks for images and areas to save the pdfs on the c: drive instead of within the folder of the website.

it doesnt matter if I specify the location of the image it still defaults to the c: drive so if I have
Code:
Dim image As XImage = XImage.FromFile("\\servername\drive\folder1\folder2\folder3\folder4\logo.png")


or
Code:
Dim image As XImage = XImage.FromFile("/images/logo.png")

it wont display the image and throws and error.

Also on when it tries to save the document using
Code:
document.Save(filename)
it throws an error

Can anyone help?


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 26, 2012 1:07 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Hi!

The Application Pool on the Web Server must use an account with sufficient rights to read and/or save the files where you want to have them.

For a quick test, you can create an Application Pool with "Local System" as user. If that works, than create a new user for your application and give that user only the required rights on your disks.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 28, 2012 1:56 pm 
Offline

Joined: Mon Nov 19, 2012 11:54 am
Posts: 16
Hi

thanks for adding a reply.

if I use the short path to the folder it doesnt work at all (images/image.png) even on the dev server as it seems to default to using the C drive is there anyway I can force it to use the images folder within the solution regardless of where I put the solution (for example on the production server) the same goes for the location of when it tries to save the document.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 28, 2012 2:19 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Relative paths (like images/image.png) are relative to the current directory.
You can set this using Environment.CurrentDirectory.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 28, 2012 5:34 pm 
Offline

Joined: Mon Nov 19, 2012 11:54 am
Posts: 16
Excellent thanks I will have a look and report back.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group