flxzt/rnote · error

Exporting document to format with extension

Error message

Exporting document to format with extension "{ext}" is not supported.

What it means

doc_export_format_from_ext_str maps a file extension to a DocExportFormat. Only svg, xopp, and pdf are supported for document export; any other extension reached via --output-file (or an explicitly derived extension) is rejected with this message embedding the offending extension.

Solutions

  1. Use a supported extension: .svg, .xopp, or .pdf.
  2. Check `rnote export doc --help` for the formats accepted by --output-format.
  3. If you need PNG of a specific area, use the selection export subcommand instead of doc export.

Example fix

// before
rnote export doc notes.rnote --output-file out.png
// after
rnote export doc notes.rnote --output-file out.pdf
Defensive patterns

Strategy: validation

Validate before calling

ext="${OUT##*.}"; case "$ext" in svg|xopp|pdf) ;; *) echo "doc export does not support .$ext (use svg|xopp|pdf)"; exit 2;; esac

Prevention

When it happens

Trigger: `rnote export doc notes.rnote --output-file out.png` (or .jpg, .txt, .rnote, etc.) — extension exists but is not one of svg|xopp|pdf.

Common situations: Assuming image exports (png/jpg) exist for whole documents; typos like `.pddf`; reusing an output filename with the source `.rnote` extension.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08). Data as JSON: /api/errors/07b73aceec780a1d. Report an issue: GitHub.

Appendix: source

Thrown at crates/rnote-cli/src/export.rs:329

    };

    let prefs = DocExportPrefs {
        export_format: format,
        with_background: !no_background,
        with_pattern: !no_pattern,
        optimize_printing,
        page_order,
    };

    Ok(prefs)
}

fn doc_export_format_from_ext_str(format: &str) -> anyhow::Result<DocExportFormat> {
    match format {
        "svg" => Ok(DocExportFormat::Svg),
        "xopp" => Ok(DocExportFormat::Xopp),
        "pdf" => Ok(DocExportFormat::Pdf),
        ext => Err(anyhow::anyhow!(
            "Exporting document to format with extension \"{ext}\" is not supported."
        )),
    }
}

pub(crate) fn create_doc_pages_export_prefs_from_args(
    export_format: DocPagesExportFormat,
    no_background: bool,
    no_pattern: bool,
    optimize_printing: bool,
    page_order: SplitOrder,
    bitmap_scalefactor: f64,
    jpeg_quality: u8,
) -> anyhow::Result<DocPagesExportPrefs> {
    Ok(DocPagesExportPrefs {
        export_format,
        with_background: !no_background,
        with_pattern: !no_pattern,

View on GitHub (pinned to bbc5354502)