Coder Social home page Coder Social logo

Comments (3)

sgbj avatar sgbj commented on July 18, 2024

Hi @Valterrsj,

I had to add some functionality in order to get this to work. For some reason, LibreOffice doesn't have rtf in the list of available output filters for a web document. I was able to get it to work by specifying the output filter manually.

Download the latest code and try form.append('format', 'rtf:Rich Text Format') instead.

You can find the list of supported input and output filters for LibreOffice here if you need them:
https://git.libreoffice.org/core/+/refs/heads/master/filter/source/config/fragments/filters

Hopefully that works for you.

Thanks!

from versed.

Valterrsj avatar Valterrsj commented on July 18, 2024

Hi @sgbj!

Thank you very much for the quick response! I tested it again and now I am getting this error.

conversion | [Error: ENOENT: no such file or directory, open 'tmp-1J8oyRsaMz0wf.rtf:Rich Text Format'] {
conversion | errno: -2,
conversion | code: 'ENOENT',
conversion | syscall: 'open',
conversion | path: 'tmp-1J8oyRsaMz0wf.rtf:Rich Text Format'
conversion | }

The inclusion of filters in "format" is generating a temporary file with an invalid extension. Below is my code:

const convertHtmlToRtf = () => { try { let req = request.post('http://conversion:4000/convert') let form = req.form() form.append( 'file', fs.createReadStream(path.join(__dirname, '../storage/test.html')) ) form.append('format', 'rtf:Rich Text Format') req.pipe( fs.createWriteStream(path.join(__dirname, '../storage/test2.rtf')) ) } catch (err) { console.error(err) } }

from versed.

sgbj avatar sgbj commented on July 18, 2024

Hey @Valterrsj, can you confirm that you have downloaded the latest version of the code and rebuilt the Docker image (if you're using Docker)? It has code that splits on the : and only uses the first part as the file extension, so it shouldn't be trying to create a file with that extension.

from versed.

Related Issues (1)

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.