Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I have a physical pdf file on the server.
Lecture 36 — Mining Data Streams - Mining of Massive Datasets - Stanford University
I want to convert this to a memory stream and send it back to the user like this:. Use an overload that uses a filename, see here. It's the easiest solution when you have a physical file.
Learn more. How to convert a pdf to a memory stream Ask Question. Asked 5 years, 11 months ago.
Active 3 years, 5 months ago. Viewed 31k times. I am writing an application in MVC4.
I would not say "convert". Given that a pdf in file form IS a stream of bytes that is no conversion.
Why do you need a memory stream? Any stream should do, and guess what, there is a file stream.
You don't need MemoryStream. Open, FileAccess.
ReadAllBytes imageLocation ; pdfContent. This isn't bad, but this allocates a lot of memory unnecessarily. You lose the advantage of having a physical file that can be streamed. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. How to create micro-interactions with react-spring: Part 1.
Subscribe to RSS
This week, StackOverflowKnows syntactic sugar, overfit or nah, and the…. Featured on Meta. Thank you, Robert Cartaino.
Change in roles for Jon Ericson leaving SE. How do the moderator resignations affect me and the community?
Has Stack Exchange rescinded moderator access to the featured tag on Meta? Linked Related Hot Network Questions. Question feed.