[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 126
  • Last Modified:

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

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
Richard Payne
Asked:
Richard Payne
1 Solution
 
anarki_jimbelCommented:
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
 
Richard PayneChief Technology EngineerAuthor Commented:
Thank, that work, created new folder as PDFBIN which automatically placed onto obj. The properties make all the difference.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now