docspring / libreconv Goto Github PK
View Code? Open in Web Editor NEWRuby gem that converts office documents to PDF using LibreOffice / OpenOffice.
License: MIT License
Ruby gem that converts office documents to PDF using LibreOffice / OpenOffice.
License: MIT License
I am trying to use this gem but getting the following error on mac os X eventhough I installed Libreoffice
IOError: Can't find Libreoffice or Openoffice executable.
Hi there,
Do you know when / if there will be a new release on rubygems with the latest updates?
Hi Guys,
I need to use libreconv gem in one of my current project which is hosted on Heroku Cader 14. I used https://github.com/rishihahs/heroku-buildpack-libreoffice to support libreoffice on Heroku but getting following error while using gem's features:
"IOError: (Can't find LibreOffice or OpenOffice executable)"
Can anyone help me please to fix this issue on Heroku.
Thanks
The code in the rubygems seems to be older:
def convert
orig_stdout = $stdout.clone
$stdout.reopen File.new('/dev/null', 'w')
pid = Spoon.spawnp(@soffice_command, "--headless", "--convert-to", @convert_to, @source, "--outdir", @target_path)
Process.waitpid(pid)
$stdout.reopen orig_stdout
target_tmp_file = "#{@target_path}/#{File.basename(@source, ".*")}.#{File.basename(@convert_to, ":*")}"
FileUtils.cp target_tmp_file, @target
end
The package released in the release section also has this same code.
Hi guys.
Does the gem work on Windows?
I have tried with both OpenOffice and LibreOffice but unfortunately I got only errors ๐
Hello,
I'm working on a service called FormAPI, and we also have a GitHub account: https://github.com/FormAPI
If you are still looking for a maintainer, I'd be happy to keep it updated for newer versions of Ruby / Rails / LibreOffice.
Can't find Libreoffice or Openoffice executable.even after installing the openoffice
Hello
Thank you for this great gem, I really appreciate it
I'm converting a docx file to PDF using libreconv and I want to keep the same fonts that I'm using inside the docx file but the generated PDF does not have the same fonts
What is the solution for this issue?
Hi I'm trying to convert a xlsb to xlsx file however the xlsb file has password, with this files I get this issue
[3] pry(main)> Libreconv.convert('/Users/joelgarcia/Downloads/InsightReports_CM.xlsb', '/Users/joelgarcia/Downloads/InsightReports_CM.xlsx')
Libreconv::ConversionFailedError: Conversion failed! Output: "", Error: "Error: source file could not be loaded"
someone know how can I solved it?
I am using the following command:
Libreconv.convert(doc.docx, mypdf.pdf, soffice_path)
It has a docx file as first argument, a pdf file as second argument and the path to soffice -> /opt/libreoffice4.4/program/soffice. When I try to run this statement in production, I get the following error;
Errno::ENOENT (No such file or directory @ rb_file_s_stat - /tmp/sample_template.pdf):
libreconv (0.9.0) lib/libreconv.rb:36:in convert' libreconv (0.9.0) lib/libreconv.rb:10:in
convert'
How can I resolve this? And if it is the version of libreoffice that is causing this, what version should I use for this gem?
Conversion failed! Output: "", Error: "javaldx: Could not find a Java Runtime Environment!\nWarning: failed to read path from javaldx
I'm getting the above error intermittently. It usually isn't a problem, but sometimes I get the error above during conversion from DOCX to HTML.
I am getting following error while convert the simple ms word document to pdf:
2.2.0 > Libreconv.convert('sample1.doc', '/Users/rp/test_document.pdf')
Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/sample1.pdf
from /home/rp/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:1391:in `initialize'
To convert a document to HTML with embdedded images, you must use convert_to param 'html:HTML:EmbedImages'.
For example:
Libreconv.convert('document.docx', '/Users/ricn/pdf_documents/my_document_as.html', nil, 'html:HTML:EmbedImages')
But this code fail at
target_tmp_file = File.join(
target_path,
File.basename(@escaped_source_path, '.*') + '.' +
File.basename(@convert_to, ':*')
)
because generating output filename extension File.basename(@convert_to, ':*')
returns 'html:HTML'.
This is incorrect filename extension.
I think code
File.basename(@convert_to, ':*')
must be replaced by something like this
@convert_to.split(':').first
After upgrading the LibreOffice 4.2.8.2 420m0(Build:2) to LibreOffice 5.1.3.2 10m0(Build:2), I am suddenly getting error during docx conversion using the following command..
Libreconv.convert("test.html", "test.docx", ClockworkConfiguration.libreoffice.path, "docx")
I have the /tmp folder also have permission to write on it. Also I had closed all open instances of libreoffice.
How can I resolve this? And if it is the version of libreoffice that is causing this, what latest version should I use for this gem?
I have noticed everytime I have libreoffice open, and then this gem attempts to convert the word to pdf, it gives me an error "No such file or directory @ rb_sysopen". However, as soon as I close out of libreoffice, the errors go away. How come?
I've noticed, that Amazon API returns 403 response when trying to request only headers:
curl "https:/..." --head
HTTP/1.1 403 Forbidden
x-amz-request-id: 9A0D5596C066E400
x-amz-id-2: Cb1y8kEjyPKd3JzpaxV8cGAsXvA9tzlLaCy4l/HP1qBfaRMIR9Q/da0tnpHUfItbyH8P7WmokkI=
Content-Type: application/xml
Date: Tue, 23 Feb 2021 07:01:38 GMT
Server: AmazonS3
While, ordinary request works fine
curl "https://..." --output file.docx
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 38010 100 38010 0 0 123k 0 --:--:-- --:--:-- --:--:-- 123k
What is the reason for this?
Hello.
Sometimes our conversions run for a very long time without throwing any errors, it might be a corrupt file or something else happening. Would it be possible to allow the call to throw an error after a set time?
I tried to investigate if the soffice
has this option but I have not been able to find out yet.
Thankful for any help and I could contribute if I am given some pointers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.