Results 1 to 9 of 9

Thread: Open PDF file from ACAD

  1. #1
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Open PDF file from ACAD

    Is there a command that will allow me to open up a PDF file from autocad similar to the "EXPLORER" or "NOTEPAD" command? I notice when using these commands that a DOS(?) window quickly pops up and disappears.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    Here's what I use to open our CTB documents. This detects which version of AutoCAD is being used, then opens the appropriate document, as it relates to that version (each has a different standard):

    Code:
    (defun c:CTB  ()
      (vl-load-com)
      (cond (*vrsn*)
            ((setq *vrsn* (vlax-product-key))))
      (cond
        ((vl-string-search "R16.2" *vrsn*)                                  ; 2006
         (startapp
           "C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe"
           "FilePath\\FileName.pdf"))
        ((vl-string-search "R17.2" *vrsn*)                                  ; 2009
         (startapp
           "C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe"
           "FilePath\\FileName.pdf"))
        (T (alert "This Version of AutoCAD Not Supported. ")))
      (princ))
    Hope this helps!
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    using your code I can get Adobe to open but get an error stating the file cannot be found. I've copied the file in the same folder as the adobe executable. Anything I'm doing wrong here?

    Code:
    (defun c:NEC ()
      (startapp "C:\\Program Files (x86)\\Adobe\\Acrobat 8.0\\Acrobat\\Acrobat.exe"
                "C:\\Program Files (x86)\\Adobe\\Acrobat 8.0\\Acrobat\\NECH08.pdf")
    (princ)
    );eof

  4. #4
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    I moved the file to the C drive and it worked...Can't imagine what the problem is. Thanks for your help.

  5. #5
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    Rookie Lisper mistake. I forgot to enclose the file name in quotes since it has spaces in it.

    Code:
    (defun c:NEC ()
      (startapp "C:\\Program Files (x86)\\Adobe\\Acrobat 8.0\\Acrobat\\Acrobat.exe"
                \""C:\\Program Files (x86)\\Adobe\\Acrobat 8.0\\Acrobat\\NECH08.pdf\"")
    (princ)
    );eof
    Last edited by mvsawyer; 2010-11-15 at 08:59 PM.

  6. #6
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    Just in case anyone cares -

    you can open any document with its registered application from within acad.

    Do File\Open and type *.* or *.doc or *.pdf in the filename box. Navigate to the file, right-click and select Open.

  7. #7
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,804
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    Quote Originally Posted by mvsawyer View Post
    Is there a command that will allow me to open up a PDF file from autocad similar to the "EXPLORER" or "NOTEPAD" command?
    If you want to open the PDF using the registered application, regardless of what might be installed, then take a look at this: http://cadpanacea.com/node/22. This way you avoid trying to guess what program might be installed, and where it's installed, etc.

    If you insist on specifically opening Adobe as shown above, then you might want to consider using the %programfiles% variable so don't have to guess (or test for) \Program Files vs. \Program Files (x86)
    R.K. McSwain | CAD Panacea |

  8. #8
    100 Club
    Join Date
    2003-06
    Location
    North Dallas
    Posts
    168
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    I knew there was a way to use the shell like explorer or notpad does. Great link rkmcswain. Thanks alot!

  9. #9
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Open PDF file from ACAD

    Quote Originally Posted by rkmcswain View Post
    If you want to open the PDF using the registered application, regardless of what might be installed, then take a look at this: http://cadpanacea.com/node/22. This way you avoid trying to guess what program might be installed, and where it's installed, etc.

    If you insist on specifically opening Adobe as shown above, then you might want to consider using the %programfiles% variable so don't have to guess (or test for) \Program Files vs. \Program Files (x86)
    The code posted above was explicit, as all CAD users had that specific version installed. My region's offices are in transition right now to our new systems (servers, applications, directory structures, etc.) and this will come in handy as we move ahead.

    Thanks for sharing RK, cheers!
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 2
    Last Post: 2014-10-17, 04:57 PM
  2. 2005: Object Enabler to open file in Acad 2005?
    By Marie789 in forum AutoCAD General
    Replies: 3
    Last Post: 2014-03-27, 05:14 PM
  3. Replies: 3
    Last Post: 2012-06-17, 09:42 PM
  4. From acad (only acad) File\Open I am unable to access my C: drive
    By jaberwok in forum CAD Management - General
    Replies: 27
    Last Post: 2005-11-13, 07:53 PM
  5. open file dialog box slow to open
    By klanier in forum AutoCAD General
    Replies: 2
    Last Post: 2004-09-09, 02:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •