PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Tue Dec 09, 2025 7:44 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  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 09, 2012 9:17 pm 
Offline

Joined: Tue Oct 09, 2012 8:58 pm
Posts: 1
Location: Estonia
Hello everyone.
I just on week work with PDFSharp , it is real good idea, but today i found problem with it.

I have Web application on ASP.NET what was hosted on somee.com server.
Local Development server in VS2010 (local web server) does not issue error.
But, when i hosted my application on server and try to open PDF file

Server Error in '/' Application. The system cannot find the file specified

Code:
protected void pdfBtn_Click(object sender, EventArgs e)
{
            initializeFormControls();
            // Create a new PDF document
            PdfDocument document = new PdfDocument();

            // Create an empty page
            PdfPage page = document.AddPage();

            // Get an XGraphics object for drawing
            XGraphics gfx = XGraphics.FromPdfPage(page);

            // Create a font
            XFont font = new XFont("Verdana", 20, XFontStyle.Bold);

            // Draw the text
            gfx.DrawString("Som text", new XFont("Georgia", 11, XFontStyle.Regular), XBrushes.Black, new  XRect(70, 150, page.Width, page.Height), XStringFormat.TopLeft);
            // Save the document...
            string filename = "Arve " + arveNumberLbl.Text.ToString() + ".pdf";
            //document.Save(filename);
            // ...and start a viewer.
            ProcessStartInfo info = new ProcessStartInfo(filename);
            Process.Start(info);
}


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 10, 2012 9:21 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3139
Location: Cologne, Germany
Hi!
barklaj wrote:
Server Error in '/' Application. The system cannot find the file specified
Based on this incomplete error message, I suspect the error message is correct. Probably insufficient privileges.

Are you trying to invoke "Process.Start(info);" on the server? This makes sense only for users working locally on the server, remote users (web browser) won't see the process.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 403 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