Hi:
I am evaluating Aspose.Pdf.Kit and I am getting an error when I try to concatenate streams into 1 single out stream. This worked fine for me on my local development machine but when I moved my code to our development web server it started crashing. The following is the error I am getting:
System.TypeInitializationException: The type initializer for
‘Aspose.Pdf.Kit.PdfFileInfo’ threw an exception. —>
System.Security.SecurityException: Request for the permission of type
‘System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed. at
System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet) at
System.Security.CodeAccessPermission.Demand() at
System.Reflection.Assembly.VerifyCodeBaseDiscovery(String codeBase) at
System.Reflection.Assembly.GetName(Boolean copiedName) at
System.Reflection.Assembly.GetName() at Aspose.Pdf.Kit.PdfFileInfo…cctor() The
action that failed was: Demand The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission The first permission that failed
was: The demand was for: The granted set of the failing assembly was: The assembly or AppDomain
that failed was: Aspose.Pdf.Kit, Version=4.2.0.0, Culture=neutral,
PublicKeyToken=ae9e610db67fc2c1 The Zone of the assembly that failed was:
Trusted The Url of the assembly that failed was:
file://trcr.com/dfs1/WebCode/vdevweb01/wwwroot/WebConsole/bin/Aspose.Pdf.Kit.DLL
— End of inner exception stack trace — at
Aspose.Pdf.Kit.PdfFileEditor.Concatenate(Stream[] inputStreams, Stream
outputStream) at _PrintDocs.MergePDFandDisplay(String[] vwjobs) in
\trcr.com\dfs1\WebCode\vdevweb01\wwwroot\WebConsole\PrintDocs.aspx.cs:line 64
The follwoing is hte code where the error happens:
PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.Concatenate(streams, outStream);
streams is an ArrayList containing multiple converted to PDF Memory Streams. outStream is a single MemoryStream