C# 使用PdfDocumentProcessor将大尺寸PDF文档保存到内存流

C# 使用PdfDocumentProcessor将大尺寸PDF文档保存到内存流,c#,devexpress,pdfdocument,C#,Devexpress,Pdfdocument,我尝试了一个使用devExpress的PdfDocumentProcessor在内存流中保存大尺寸PDF文档的代码。但当文件大小过大时,会出现类似System.OutOfMemoryException的错误。示例代码片段如下所示。请帮我解决这个问题 public byte[] MergeToBytes() { using (var processor = new PdfDocumentProcessor()) { AppendSt

我尝试了一个使用devExpress的PdfDocumentProcessor在内存流中保存大尺寸PDF文档的代码。但当文件大小过大时,会出现类似System.OutOfMemoryException的错误。示例代码片段如下所示。请帮我解决这个问题

public byte[] MergeToBytes()
    {
        using (var processor = new PdfDocumentProcessor())

        {
            AppendStreamsToDocumentProcessor(processor);

            using (var newDocument = new MemoryStream())
            {
                processor.SaveDocument(newDocument); // this line gives memory exception
                return newDocument.ToArray();
            }
        }
    }

您是否已通过将生成的PDF保存到文件来检查其大小?它对你的内存来说真的太大了吗?@gnud是的,它的文件太大了。但是我们不能使用PdfDocumentProcessor将其保存到内存流吗?您的httpRuntime maxRequestLength值是多少?可能是问题,您可以在web.config中找到。我的Xtrareports有问题