?
Solved

vb.net and project resources

Posted on 2014-11-24
4
Medium Priority
?
257 Views
Last Modified: 2014-11-24
Hey guys, i have a project im working on which includes a non modifiable PDF document.  I am able to view it fine, but i want to embed the pdf in my exe and compile it at runtime.  I dont want to host it externally to the EXE.  Can i put it in the resources folder and then call it from there?  It doesnt seem to be working.  I have it in the resources and when i try to type in my.resources.filename.pdf, it cant find it at runtime.

Calling it like the below works:
 Private Sub BentleyManual_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AxAcroPDF1.LoadFile("C:\Program Files (x86)\BMW Maintenance\Bentley_BMW_3_Series_2006-2010.pdf")
    End Sub

Open in new window


I want to call it via my.resources, but it fails to find it at runtime:
 Private Sub BentleyManual_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AxAcroPDF1.LoadFile("Resources\Bentley_BMW_3_Series_2006-2010.pdf")
    End Sub

Open in new window


I added the file via the project settings resource tab. The pdf is set to None for Build Action and Do not copy for copy to output directory
0
Comment
Question by:derek7467
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:FarWest
ID: 40462499
you just simply add it to the project "add existing item" select build action as "resource"  in the item properties
0
 

Author Comment

by:derek7467
ID: 40462525
OK, i did that again, right click the project solution, add existing item, then i reference it like the below:
I set the build action to resource and the copy to output as do not copy.

Private Sub BentleyManual_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AxAcroPDF1.LoadFile("Resources\Bentley_BMW_3_Series_2006-2010.pdf")
    End Sub

Open in new window


Just shows a grey adobe reader screen and DOES NOT display the actual pdf
0
 
LVL 12

Accepted Solution

by:
FarWest earned 2000 total points
ID: 40462573
I think you have to use temp file to open it
check this thread

http://www.dreamincode.net/forums/topic/112777-use-pdf-file-from-myresources/
0
 

Author Closing Comment

by:derek7467
ID: 40462665
That worked!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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