开发者

Start process from stream

开发者 https://www.devze.com 2022-12-18 14:39 出处:网络
I have a memory stream that contains a PDF file. Is it possible to view the PDF without s开发者_开发问答aving it to the hard disk ?Process.Start() only takes a path and not a stream.

I have a memory stream that contains a PDF file.

Is it possible to view the PDF without s开发者_开发问答aving it to the hard disk ? Process.Start() only takes a path and not a stream.

Thank you


Only by implementing your own pseudo-file system in C#, somehow mounting this as a disk in Windows, and having it intercept the file open and stream the contents of your MemoryStream. Absolutely 100% certainly not worth the effort.


You can create a RAM drive and write the stream to it, this way you are still keeping it all in ram (assuming the disk operations are what worries you).


Sure, this is certainly possible. Just not via Process Start and Adobe Reader (I assume you are invoking Adobe or something similar)

If you are using .NET or Java you simply need to find a PDF viewer component, there are lots to choose from, google will give you plenty of links, Gnostice has a good one, but its expensive. Once you find a suitable control, view the PDF directly from your app.


If there is, process.Start won't be the way, but I'd risk guessing that there isn't. Unless there's a specific PDF API that allows that somehow (I doubt) I'd save it to disk.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号