PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Sat Sep 20, 2025 9:04 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Nov 20, 2013 5:36 pm 
Offline

Joined: Wed Nov 20, 2013 5:20 pm
Posts: 2
Hello,
I am using PdfSharp.

My newly generated PDFs are stored in the folder C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0

How do I change the path to some local project folder instead of C: path?

In the following code how can I change the path value?

Stream stream = new FileStream(path, FileMode.Create, FileAccess.Write);

Please let me know if any one knows how it can be done.

TIA

Kapil.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2013 9:17 am 
Offline
PDFsharp Guru
User avatar

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

If "path" contains the filename only (e.g. "mypdf.pdf"), then the operating system (i.e. Windows) will automatically save the file in the working folder (aka current directory).

The best way: give a fully qualified filename in "path" and you're done.

The risky way: change the working folder (but OpenFile dialogs etc. will sometimes change the working folder, therefore this method is risky).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2013 7:16 pm 
Offline

Joined: Wed Nov 20, 2013 5:20 pm
Posts: 2
Thanks a ton Thomas!!!

It worked like a charm.. :)


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: Google [Bot] and 307 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