0

I am trying to convert a word document(.docx) into PDF. I am trying to pass Stream object into load document method of RichEditDocumentServer,but my bad ,I am getting a blank pdf. I tried passing the file path in load document method ,which worked fine. But my requirement has to meet with stream object. Can anyone help me to fix the issue. A sample code has been added below.

 private Stream ConvertToPdf(Stream fileStream)
        {
            RichEditDocumentServer server = new RichEditDocumentServer();
            fileStream.Seek(0, SeekOrigin.Begin);
            server.LoadDocument(fileStream, DocumentFormat.Doc);
            Stream convertStream = new MemoryStream();
            server.ExportToPdf(convertStream);
            convertStream.Seek(0, SeekOrigin.Begin);
            return convertStream;
        }
4

1 に答える 1

0

以下のリンクで動作しました

https://www.devexpress.com/support/center/Question/Details/T340655#answer-9c3224dd-383a-4faa-9672-9b34e36c1c7a

server.LoadDocument(fileStream, DocumentFormat.OpenXml);

于 2016-02-02T10:59:31.623 に答える