Divooka Reference

Convert

8 nodes

On this page 8

Conversion Targets

Function

The formats a file can be converted into, as extensions - .pdf, .docx - in the order Save as offers them; empty for a file nothing here reads.

Signature
ConversionTargets(source: Text) -> Text Array
string[] ConversionTargets(string source)

Parameters

nametypedefaultdescription
sourceText—The file, or only its name.

Returns

ExtensionsText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert

Function

Converts a file into the format the target names: a document to PDF or Word, a picture to JPEG, a sound to MP3, a film to WebM, a model to glTF - whatever the conversion table offers for it.

Signature
Convert(source: Text, target: Text) -> Text Array
string[] Convert(string source, string target)

Parameters

nametypedefaultdescription
sourceText—The file to convert.
targetText—Where to write it - a path, or an extension such as .pdf.

Returns

FilesText Array

Remarks

The target is a full path, or only the new extension - .pdf - to write beside the source under its own name. A document's pages written as pictures are one file each, named after the target with the page's number: notes_0001.png.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert 3D Model

Function

Converts a 3D model - OBJ, FBX, glTF, STL, PLY, Collada, 3DS, 3MF, Blender and some forty more - to glTF, OBJ, STL, PLY, FBX, Collada, 3MF, X3D, 3DS or DirectX.

Signature
Convert3DModel -> Text
    source: Text
    format: Model Target
    folder: Text
string Convert3DModel(
    string source,
    ModelTarget format = ModelTarget.Glb,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The model to convert.
formatModel TargetglTF binaryWhat to write it as.
folderText—Where to write it; empty for beside the source.

Returns

FileText

Remarks

The model's faces are cut into triangles. An OBJ is written with its materials beside it, a glTF with its buffer. STL and PLY hold shapes only, without materials, and OBJ, STL, PLY and 3MF hold no animation.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert Audio

Function

Converts a sound - WAV, MP3, FLAC, Ogg, Opus, M4A, AAC or AIFF - or a film's sound to MP3, M4A, Ogg Vorbis, Opus, FLAC or WAV.

Signature
ConvertAudio -> Text
    source: Text
    format: Audio Target
    folder: Text
string ConvertAudio(
    string source,
    AudioTarget format = AudioTarget.Mp3,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The sound or film to convert.
formatAudio TargetMP3What to write it as.
folderText—Where to write it; empty for beside the source.

Returns

FileText

Remarks

MP3 at 192 kbit/s, M4A as AAC at 128 kbit/s, Ogg Vorbis at quality 3, Opus at 96 kbit/s, FLAC at level 5, WAV as 16-bit PCM. A sound already in the target's codec is copied as it is.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert Document

Function

Converts a document or a text file: Markdown, text and source code to PDF or Word; Word to PDF, EPUB, PowerPoint, RTF, OpenDocument or HTML; a book to PDF, Word or PowerPoint; a deck to PDF; RTF, OpenDocument, HTML, Word 97-2003 and PDF to Word.

Signature
ConvertDocument -> Text
    source: Text
    format: Document Target
    folder: Text
string ConvertDocument(
    string source,
    DocumentTarget format = DocumentTarget.Pdf,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The document to convert.
formatDocument TargetPDFWhat to write it as.
folderText—Where to write it; empty for beside the source.

Returns

FileText

Remarks

A PDF becomes a Word document of its pages as they look, to edit: its text in text boxes where it stood, its pictures where they stood, and the rest of what it draws behind them; a font that is not installed here is set in the nearest installed one. It holds glyphs at positions rather than paragraphs, so it becomes no other kind of document. PDF to Images draws its pages.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert Image

Function

Converts a picture - PNG, JPEG, BMP, GIF, TGA, WebP, TIFF, QOI, an icon or Netpbm - to another format, or to a PDF of one page.

Signature
ConvertImage -> Text
    source: Text
    format: Image Target
    folder: Text
string ConvertImage(
    string source,
    ImageTarget format = ImageTarget.Png,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The picture to convert.
formatImage TargetPNGWhat to write it as.
folderText—Where to write it; empty for beside the source.

Returns

FileText

Remarks

A JPEG is written at quality 100 with its colour at full resolution, and has no transparency: what was transparent is on white. A WebP is written lossless. A GIF holds at most 256 colours.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

Convert Video

Function

Converts a film - MP4, WebM, Matroska or QuickTime, in H.264, VP8 or VP9 - to another of them.

Signature
ConvertVideo -> Text
    source: Text
    format: Video Target
    folder: Text
string ConvertVideo(
    string source,
    VideoTarget format = VideoTarget.Mp4,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The film to convert.
formatVideo TargetMP4What to write it as.
folderText—Where to write it; empty for beside the source.

Returns

FileText

Remarks

MP4 and QuickTime are written as H.264 and AAC, Matroska as H.264 and Opus, WebM as VP9 and Opus. A stream already in the target's codec is copied as it is; subtitles are left out. Convert Audio takes a film's sound alone.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion

PDF to Images

Function

Draws every page of a PDF - or of a Word document, a book or a deck - as a picture, one file a page, named with the page's number: report_0001.png, report_0002.png.

Signature
PdfToImages -> Text Array
    source: Text
    format: Page Image Target
    DPI: Number
    folder: Text
string[] PdfToImages(
    string source,
    PageImageTarget format = PageImageTarget.Png,
    double dpi = 150,
    string folder = "")

Parameters

nametypedefaultdescription
sourceText—The document whose pages to draw.
formatPage Image TargetPNGWhat each page is written as.
DPINumber150How finely to draw, in dots per inch: 150 makes a page of US Letter 1275 × 1650 pixels.
folderText—Where to write the pages; empty for beside the source.

Returns

PagesText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Convert
Package
File Conversion