Solved

VS2015, C#, where to place PDF file into resource so it release to include PDF and how to reference to them to open?

Posted on 2016-09-25
2
64 Views
Last Modified: 2016-09-25
I have several PDF files that ia generated from Word documnet. I like to include PDF into project and make reference to them. I cannot place it into resource folder since it only for graphic element files.

I like a best solution to open the PDF file by external 3rd party viewer. I do not wish to make use of internal PDF veiwer within the C# project.
0
Comment
Question by:Richard Payne
2 Comments
 
LVL 29

Accepted Solution

by:
anarki_jimbel earned 500 total points
ID: 41815105
One way I know is like below:

a) E.g., drag and drop a pdf file to the solutions explorer, or include it to the solution by any other way;
b) Select the file in the solutions explorer, then open and modify it's properties like:
 - Build Action: Content;
 - Copy to Output Directory: Copy always
c) The path to the file after the application is installed should be like:
  string path = Application.StartupPath + "\\MyPDF.pdf".
or may be like (can't remember exactly)
Application.StartupPath + "\\Resources\\MyPDF.pdf";
1
 

Author Closing Comment

by:Richard Payne
ID: 41815418
Thank, that work, created new folder as PDFBIN which automatically placed onto obj. The properties make all the difference.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question