You are viewing limited content. For full access, please sign in.

Question

Question

Convert from ExportElecDoc (from stream) to a PDF

asked on October 2, 2019

Hi,

We've got a repository of loads of documents that havent had 'Generate Pages' applied, I need to be able to get the document and view it in a browser, but be able to save it as if it were a PDF document. When using ExportElecDoc (output as stream as it's over an API) I can see the document in the browser, but when clicking on it it error's and returns a failure.

 

If I import a document and manually click generate pages I can use ExportPdf and output a stream straight to the browser and then can save the document. 

 

Is there a way I can ExportElecDoc and convert it to a PDF over a stream? (Stream is required, can't get away from storing it on a filepath for security reasons)

 

Thanks in advance

 

 

0 0

Replies

replied on October 2, 2019

To export the edoc contents to a stream, do something like this:

using (MemoryStream ms = new MemoryStream())
{
    docExp.ExportElecDoc(document, ms);
    byte[] fileContents = ms.ToArray();
}

 

0 0
replied on October 2, 2019

Thanks I've done that, I think it's something to do with the environment or asp.net at the moment, it can't be saved when using asp.net on the project I'm on, MVC is fine and a blank asp.net project works, could be my machine.

 

Thanks

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.