Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: no export filter for /usr/src/app/tmp-1foTIGj1B16ym.rtf found, aborting #4

Closed
Valterrsj opened this issue Apr 4, 2021 · 3 comments · Fixed by #5
Closed

Error: no export filter for /usr/src/app/tmp-1foTIGj1B16ym.rtf found, aborting #4

Valterrsj opened this issue Apr 4, 2021 · 3 comments · Fixed by #5

Comments

@Valterrsj
Copy link

Congratulations on the project!
I am not able to convert an html file to rtf. I get the following notification:
Error: no export filter for /usr/src/app/tmp-1foTIGj1B16ym.rtf found, aborting.
Error: no export filter

async function convertHtmlToRtf() { try { let req = request.post(' http://conversion:4000/convert/') let form = req.form() form.append('file', fs.createReadStream('./storage/test.html')) form.append('format', 'rtf') req.pipe(fs.createWriteStream('./storage/test.rtf')) } catch (err) { console.error(err) } }

@sgbj
Copy link
Owner

sgbj commented Apr 6, 2021

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!

@Valterrsj
Copy link
Author

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) } }

@sgbj
Copy link
Owner

sgbj commented Apr 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants