Create PDF on another server

Create PDF on another server

Forum member · Apr 2, 2008
I need to create the PDF file on another server. The folder is mapped under wwwroot/. I get an error: "Access to the path '\\rhino\workfile\consortia\HomePNA\Invoices\2008\Ayecom_Technology_Co.,_Ltd..10883.08-04-02.pdf' is denied." The statement is document.Draw("\\rhino\workfile\consortia\HomePNA\Invoices\2008\Ayecom_Technology_Co.,_Ltd..10883.08-04-02.pdf"); How do I grant permission to my web page so that .Draw(file) can write to the folder please? Thank you, Piyush Varma

Re: Create PDF on another server

Support · Apr 3, 2008
Hello Piyush Varma, It looks like the user account through which you are creating the PDF; in this case the Internet user account does not have permission to the drive where you are saving the PDF. In order to save the PDF in the disk you will have to give the necessary permissions to the internet user (typically "IUSR_MACHINE" or "ASPNET") or save the PDF in a location where the user account has permission. Thanks, ceTe Software Support Team.

Re: Create PDF on another server

Forum member · Apr 23, 2008
Can I create the PDF file on a mapped drive? I get the following error 'Could not find a part of the path' when I try to save the file on a mapped drive. The error trace is below: Could not find a part of the path 'W:\consortia\ZigBee\Invoices\2008\piyush_test.08-04-23.pdf'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at ceTe.DynamicPDF.Document.Draw(String filePath) at generate_pdf_file.drawInvoice(Hashtable& htInvInfo, String cAppPath) in c:\Inetpub\wwwroot\Finance_Integration\App_Code\generate_pdf_file.cs:line 186 W: is mapped to a network drive. The statement is document.Draw(cFileName); When I Remote Desktop to the server where the web application is stored, I can see the folder (W:\consortia\ZigBee\Invoices\2008) in explorer. What can i do please? Thanks, Piyush Varma

Re: Create PDF on another server

Support · Apr 23, 2008
Hello Piyush, You can save the file on the network without any problem by specifying the UNC path. The user will need permissions to write to the folder on the network. Thanks, ceTe Software Support Team

Re: Create PDF on another server

Forum member · Apr 23, 2008
How can I determine values for user name or bad password in the following error message please? Logon failure: unknown user name or bad password. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at ceTe.DynamicPDF.Document.Draw(String filePath) at generate_pdf_file.drawInvoice(Hashtable& htInvInfo, String cAppPath) in c:\Inetpub\wwwroot\Finance_Integration\App_Code\generate_pdf_file.cs:line 187 --- The call is made from a web page to the method in generate_pdf_file.cs file. Thanks, Piyush

Re: Create PDF on another server

Support · Apr 23, 2008
This error that you are getting is not being thrown by our component. This looks like a FileStream object that you are trying to save the PDF to. Make sure that the account you are using when saving the PDF has the appropriate permissions to read and write to that location in the file system. Thanks, ceTe Software Support Team

Re: Create PDF on another server

Forum member · Apr 25, 2008
Hi, I am sorry to be persistent. As suggested by my network admin person, I tried to add a domain to the username (iv\pvarma) and I got this error message: Server Error in '/' Application. -------------------------------------------------------------------------------- Could not load file or assembly 'ceTe.DynamicPDF' or one of its dependencies. Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileLoadException: Could not load file or assembly 'ceTe.DynamicPDF' or one of its dependencies. Access is denied. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Assembly Load Trace: The following information can be helpful to determine why the assembly 'ceTe.DynamicPDF' could not be loaded. WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Stack Trace: [FileLoadException: Could not load file or assembly 'ceTe.DynamicPDF' or one of its dependencies. Access is denied.] [FileLoadException: Could not load file or assembly 'ceTe.DynamicPDF, Version=4.0.0.0, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b' or one of its dependencies. Access is denied.] System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141 System.Reflection.Assembly.Load(String assemblyString) +25 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32 [ConfigurationErrorsException: Could not load file or assembly 'ceTe.DynamicPDF, Version=4.0.0.0, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b' or one of its dependencies. Access is denied.] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3596761 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +350 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125 System.Web.Compilation.BuildManager.CompileCodeDirectories() +525 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +448 [HttpException (0x80004005): Could not load file or assembly 'ceTe.DynamicPDF, Version=4.0.0.0, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b' or one of its dependencies. Access is denied.] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +521 [HttpException (0x80004005): Could not load file or assembly 'ceTe.DynamicPDF, Version=4.0.0.0, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b' or one of its dependencies. Access is denied.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3540923 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +275 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 The web.config lines are: <authentication mode="Windows"/> <identity impersonate="true" userName="iv\pvarma" password="testpwd"/> Thanks, Piyush

Re: Create PDF on another server

Support · Apr 25, 2008
Hello Piyush, The problem is likely related to permissions issue on the DynamicPDF DLL files. The solution is to first figure out which user the Forms Authentication was being logged in with so that they could grant that user the correct permissions needed. Take a look at the following MSDN link if you need assistance determining the identity of certain configuration setting, http://msdn2.microsoft.com/en-us/library/Aa302377.aspx . Once the user identity is known then the solution is to make sure that the user identity (typically "IUSR_MACHINE" or "ASPNET") has at least "read & execute" permissions on the DLL file. Keep in mind that this will require you to clear out the Temporary ASP .NET Files for that project in order for this change to take affect. Here are the steps to follow to complete this: - Go to the DynamicPDF DLL file in the bin folder of your application and add/give the appropriate account (typically "IUSR_MACHINE" or "ASPNET") "read & execute" permissions. - Next you will need to stop the "WWW Publishing" service so that you can clear the Temp ASP files. - Once the "WWW Publishing" service is stopped then explore to the "C:\WINDOWS\Microsoft.NET\Framework\v[your_framework_version]\Temporary ASP.NET Files" folder and then delete the folder associated with this particular application (if you are unsure you can just delete every folder in the folder). - Once the folders have been deleted then Start the "WWW Publishing" service again. - Now run the application again. Thanks, ceTe Software Support Team