title: How to convert word file to PDF in ROR
body: <p>I am using Libreconv gem to convert word to doc but it's not working with S3</p>
  
  <pre><code>bucket = Aws::S3::Bucket.new('bucket-name')
  object = bucket.object file.attachment.blob.key
  path = object.presigned_url(:get)
  Libreconv.convert(path, "public/test.pdf")
  </code></pre>
  
  <p>If I try to convert this path to PDF using Libreconv then it's give me filename too long error. I have wrriten this code under ActiveJobs. So kindly provide me solutions as per ActiveJobs.</p>
  
  <p>Can someone please suggest me how can I convert word file to pdf.
  Here path is <code>https://domain.s3.amazonaws.com/Bf5qPUP3znZGCHCcTWHcR5Nn?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIZ6RZ7J425ORVUYQ%2F20181206%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20181206T051240Z&amp;X-Amz-Expires=900&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=b89c47a324b2aa423bf64dfb343e3b3c90dce9b54fa9fe1bc4efa9c248e912f9</code> </p>
  
  <p>and error I am getting is </p>
  
  <p><code>Error: source file could not be loaded
  *** Errno::ENAMETOOLONG Exception: File name too long @ rb_sysopen - /tmp/Bf5qPUP3znZGCHCcTWHcR5Nn?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIZ6RZ7J425ORVUYQ%2F20181206%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20181206T051240Z&amp;X-Amz-Expires=900&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=b89c47a324b2aa423bf64dfb343e3b3c90dce9b54fa9fe1bc4efa9c248e912f9.pd</code></p>