Skip to content

Converters

Sometimes documents in your system are in the wrong format. NodeActa allows you to convert any file to any format (of course, if you have a converter defined for that format).
In the picture below we have an example how to convert .jpeg image format to .pdf using dpfkit library from www.npmjs.com repository (see how to install module from NPM in Module Manager).

converters

With defined converter for a certain file type, you will get Convert to... and Save as (with conversion)... commands in the context menu of FilesView control (see image below).
Convert to... command will create a new file next to the source file.
Save as (with conversion)... command will export selected file to the file system and perform conversion on the fly.

convert to

save as

To convert a file in your code, you can directly call matching converter. For example:

import { jpeg } from "nv:SystemManagement.Converters.jpeg";
or
const { jpeg } = await import('nv:SystemManagement.Converters.jpeg');
...
await jpeg.convert(inFilePath, outFilePath, 'pdf');