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

PDFSharp - The system cannot find the file specified
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2163
Page 1 of 1

Author:  barklaj [ Tue Oct 09, 2012 9:17 pm ]
Post subject:  PDFSharp - The system cannot find the file specified

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);
}

Author:  Thomas Hoevel [ Wed Oct 10, 2012 9:21 am ]
Post subject:  Re: PDFSharp - The system cannot find the file specified

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.

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