We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

Convert PDF to FileBytes in C#


After I have converted an email to a PDF is it then possible to convert the PDF to bytes so i can return this a new tab on the browser?

  public FileResult ViewDocument()
            byte[] FileBytes;

            using (Converter converter = new Converter("emailMessage.msg"))
                PdfConvertOptions options = new PdfConvertOptions();
                converter.Convert("msg-Message.pdf", options);
                FileBytes = System.IO.File.ReadAllBytes(converter);

            return File(FileBytes, "application/pdf");




You can convert the resultant PDF to byte array like this.