How to open a PDF file that is also a project resource?

后端 未结 8 1865
星月不相逢
星月不相逢 2021-01-17 19:35

I have a PDF file that I have imported in as a resource into my project. The file is a help document so I want to be able to include it with every deployment. I want to be a

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 19:44

    You need to convert the resource into format acceptable for the program supposed to consume your file.

    One way of doing this is to write the content of the resource to a file (a temp file) and then launch the program pointing it to the file.

    Whether it is possible to feed the resource directly into the program depends on the program. I am not sure if it can be done with the Adobe Reader.

    To write the resource content to a file you can create an instance of the MemoryStream class and pass your byte array to its constructor

提交回复
热议问题