Coder Social home page Coder Social logo

libreconv's Issues

encode error

generate pdf success but content encode error

image

image

how to fix this bug?

New release on rubygems?

Hi there,

Do you know when / if there will be a new release on rubygems with the latest updates?

Gemfile in rubygems differs from the code in the repository

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.

Does it work on Windows?

Hi guys.
Does the gem work on Windows?
I have tried with both OpenOffice and LibreOffice but unfortunately I got only errors ๐Ÿ˜ž

Custom fonts into the generated PDF

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?

Convert xlsb to xlsx file with password fails

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?

Errno::ENOENT (No such file or directory @ rb_file_s_stat - /tmp/sample_template.pdf)

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:inconvert'

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?

Anybody running into can't find java error on heroku?

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.

No such file or directory @ rb_sysopen

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'

Fail convert if "convert_to" consists of three parts

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

getting error No such file or directory @ rb_file_s_stat - /tmp/test.docx

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?

Getting 403 Forbidden when using S3 url

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?

Feature request: Allows to set maximum acceptable conversion time, then timeout

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.