Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 943923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:30:42+00:00 2026-05-15T22:30:42+00:00

I use a Windows Web Server 2008 with ruby, PDFCreator, Microsoft Office, and OpenOffice

  • 0

I use a Windows Web Server 2008 with ruby, PDFCreator, Microsoft Office, and OpenOffice to convert files to PDF automatically. The setup works ok for Microsoft Office files but I have not been able to get it to work automatically with OpenOffice files (e.g. .sxw). PDFCreator is able to convert .sxw files without problem when I do it manually but throws the following error when I try it with my ruby script below.

Error: 1 Description: The ActiveX-Server has not been started! Please use function \”cStart()\” to start the ActiveX-Server!

def convert( filename, data )
  require 'win32ole'

  dirpath = File.join( '/', 'files' )
  filepath =  File.join( dirpath, filename )
  puts filepath
  filepath_out = File.join( dirpath, 'output.pdf' )
  begin
     File.open( filepath, 'wb+' ) { |f| f.write( data ) }
     puts File.exists?( filepath ).inspect
     pdfcreator = WIN32OLE.new( 'PDFCreator.clsPDFCreator' )
     event = WIN32OLE_EVENT.new( pdfcreator )
     event.on_event( 'eReady' ) do
        File.open( filepath_out, 'rb' ) { |f| update_attribute( :data_converted, f.read ) }
        $printed = true
     end
     event.on_event( 'eError' ) do
        pdfcreator.cClose()
        raise 'error'
     end
     if !pdfcreator.cIsPrintable( filepath )
        raise 'error'
     end
     pdfcreator.cStart( '/NoProcessingAtStartup' )
     pdfcreator.setproperty( 'cOption', 'UseAutosave', 1 )
     pdfcreator.setproperty( 'cOption', 'UseAutosaveDirectory', 1 )
     pdfcreator.setproperty( 'cOption', 'AutosaveFormat', 0 )
     pdfcreator.setproperty( 'cDefaultprinter', 'PDFCreator' )
     pdfcreator.cClearCache()
     pdfcreator.setproperty( 'cPrinterStop', false )
     pdfcreator.setproperty( 'cOption', 'AutosaveDirectory', File.dirname( filepath_out ) )
     pdfcreator.setproperty( 'cOption', 'AutosaveFilename', File.basename( filepath_out ) )
     $printed = false
     pdfcreator.cPrintfile( "C:\\files" + File.basename( filepath ) )
     started_at = Time.new
     loop {
        pdfcreator.cOption( 'UseAutosave' ) # noop to get ready event
        break if $printed
        if ( Time.new - started_at )>TIMEOUT
           raise 'timeout'
        end
        sleep 0.5
     }
  rescue => e
     raise e
  ensure
     begin
        pdfcreator.cClearCache()
        pdfcreator.cClose()
     rescue
     end
     begin
        File.delete( filepath ) if File.exists?( filepath )
        File.delete( filepath_out ) if File.exists?( filepath_out )
     rescue
     end

  end

Any ideas?

Thanks,
Peder

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:30:43+00:00Added an answer on May 15, 2026 at 10:30 pm

    Strange. Now it is working!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my asp.net web server setup to use windows authentication. It is authenticating
I have visualSVN server installed on windows server 2008. I want to use the
Question I setup Hudson CI on a Windows 2008 server and now I want
The environment is Windows Web Server 2008, and I'm just trying to copy a
I use Windows Server 2008 R2, IIS 7.0. I downloaded umbraco5 sources, created new
We have windows server 2008. Whenever we try to fax a PDF document using
I'm looking for speech (wave files) to text on windows server 2008 (or win
I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site
We have a Windows Server Web Edition 2003 Web Farm. What can we use
I am trying to setup windows server 2008 smtp server to relay emails to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.