Usig pdf file in REALBasic

Discussion in 'Mac Programming' started by mahaboob, Aug 3, 2009.

  1. mahaboob macrumors member

    Jul 10, 2008
    I need to launch a pdf file when clicking the help button.
    So I used the code :
      Dim f as FolderItem
      f = GetFolderItem("MyHelp.pdf")
    and I imported the MyHelp.pdf file into the project.
    When I'm running the application the file is launched.
    But After building the application and I ran the application, it is not opening.
    So I checked it with f.LastErrorCode and it shows error code 101(file not found). How can I use the pdf file in my application?
    I need to distribute the application with this help file.

    I'm using Realbasic 2007 R5 on Mac OS X 10.5

    Thanks in advance
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    Note: I don't know RealBasic

    A quick google came up with a few threads that suggest using:
    To get the path to your executable inside your bundle. You can then move to the resources directory (or wherever the PDF is ending up in your bundle) and open it up.

  3. blaster_boy macrumors 6502


    Jan 31, 2004
    I don't know Realbasic either, but it seems to me that you need to specify the path where your helpfile is located. Inside the project the executable probably sees it, once compiled it will need to be specified.

    For easy testing, I would put the pdf in the same folder as where your executable is created and create a variable to the pdf using for the filepath the result of app.ExecutableFile.AbsolutePath + the name of the pdf.

    In pseudocodish:
    var x=app.ExecutableFile.AbsolutePath + "MyHelp.pdf"
    You might want to print f or x to verify that the filepath is created correctly.
  4. lazydog macrumors 6502a

    Sep 3, 2005
    Cramlington, UK
    It's been a while since I did any RB, but it sounds like you're including the pdf in your project as a resource and so you would access it using the getresource() (I think) methods. Perhaps it would be easier to just distribute the pdf file with the executable, especially if your app is cross platform. Best to ask on the RealBasic forum over at RealSoftware if you haven't already.

    b e n
  5. mahaboob thread starter macrumors member

    Jul 10, 2008

Share This Page