# Re: Win32ole & Adobe Acrobat Reader

**URL:** <https://www.ruby-forum.com/t/re-win32ole-adobe-acrobat-reader/75045>\
**Category:** Ruby\
**Created:** [November 7, 2006, 11:07am UTC](https://www.ruby-forum.com/t/re-win32ole-adobe-acrobat-reader/75045 "2006-11-07T11:07:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philpraxis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@philpraxis](https://www.ruby-forum.com/u/philpraxis)\
**Post date:** [November 7, 2006, 11:07am UTC](https://www.ruby-forum.com/t/re-win32ole-adobe-acrobat-reader/75045/1 "2006-11-07T11:07:54Z")

</div>

M. Edward (Ed) Borasky wrote:

> > require ‘win32ole’
> > 
> > pdf = PDF::Writer.new  
> > pdf.select\_font “Times-Roman”  
> > pdf.text “Hello, Ruby.”, :font\_size =\> 72, :justification =\> :center
> > 
> > pdf.save\_as(“hello.pdf”)
> > 
> > acrobat = WIN32OLE.new(‘AcroExch.App’) doc =  
> > WIN32OLE.new(‘AcroExch.PDDoc’)  
> > doc.open(“c:\<the\_absolute\_path\_to\_the\_file\>\hello.pdf”) acrobat.show

> For one thing, don’t your backslashes need to be doubled?
> 
> “C:\Program Files\Microsoft Space-Bearing Paths\Are\Evil.pdf”

Hi,

Hum, unfortunately, it does not seem to help!

---

<div class="post-metadata">

**Author:** ![philpraxis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@philpraxis](https://www.ruby-forum.com/u/philpraxis)\
**Post date:** [November 7, 2006, 9:05pm UTC](https://www.ruby-forum.com/t/re-win32ole-adobe-acrobat-reader/75045/2 "2006-11-07T21:05:58Z")

</div>

On 11/6/06, Jeff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> filename = “myfile.pdf”
> 
> `start #{filename}`

FYI: be careful when using quotes with start: `start "myfile.pdf"`  
won’t work because when first parameter is quoted it is the title of  
the window. so this works:  
`start "" "myfile.pdf"`

…sometimes I wonder what did they smoke when they created this…

---

<div class="post-metadata">

**Author:** ![philpraxis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@philpraxis](https://www.ruby-forum.com/u/philpraxis)\
**Post date:** [November 7, 2006, 11:08am UTC](https://www.ruby-forum.com/t/re-win32ole-adobe-acrobat-reader/75045/3 "2006-11-07T11:08:02Z")

</div>

Philippe L. wrote:

> M. Edward (Ed) Borasky wrote:
> 
> > > I’m trying to launch the opening of a PDF document from  
> > > within ruby, under Windows XP. Adobe Acrobat shows up, but no  
> > > document appears. Does anyone see the error, or maybe has  
> > > another better (cross-platform) method?

Not cross-platform, but try this:

filename = “myfile.pdf”

`start #{filename}`

If it’s hard to see in your browser, I’m using the “backtick” not the  
apostrophe, which will induce a system call. I’m assuming Acrobat is  
installed as your handler for .pdf files.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software
