# Win32ole & Adobe Acrobat Reader

**URL:** <https://www.ruby-forum.com/t/win32ole-adobe-acrobat-reader/75011>\
**Category:** Ruby\
**Created:** [November 7, 2006, 11:06am UTC](https://www.ruby-forum.com/t/win32ole-adobe-acrobat-reader/75011 "2006-11-07T11:06:23Z")\
**Posts on this page:** 2\
**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:06am UTC](https://www.ruby-forum.com/t/win32ole-adobe-acrobat-reader/75011/1 "2006-11-07T11:06:23Z")

</div>

Hi,

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?

Thanks!

* * *

require ‘pdf/writer’  
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

---

<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:06am UTC](https://www.ruby-forum.com/t/win32ole-adobe-acrobat-reader/75011/2 "2006-11-07T11:06:31Z")

</div>

Philippe L. wrote:

> * * *
> 
> Philippe L.  
> Attik System

For one thing, don’t your backslashes need to be doubled?

“C:\Program Files\Microsoft Space-Bearing Paths\Are\Evil.pdf”
