{"record":{"id":"07b73aceec780a1d","repo":"flxzt/rnote","slug":"exporting-document-to-format-with-extension-ext","errorCode":null,"errorMessage":"Exporting document to format with extension \"{ext}\" is not supported.","messagePattern":"Exporting document to format with extension \"(.+?)\" is not supported\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-cli/src/export.rs","lineNumber":329,"sourceCode":"    };\n\n    let prefs = DocExportPrefs {\n        export_format: format,\n        with_background: !no_background,\n        with_pattern: !no_pattern,\n        optimize_printing,\n        page_order,\n    };\n\n    Ok(prefs)\n}\n\nfn doc_export_format_from_ext_str(format: &str) -> anyhow::Result<DocExportFormat> {\n    match format {\n        \"svg\" => Ok(DocExportFormat::Svg),\n        \"xopp\" => Ok(DocExportFormat::Xopp),\n        \"pdf\" => Ok(DocExportFormat::Pdf),\n        ext => Err(anyhow::anyhow!(\n            \"Exporting document to format with extension \\\"{ext}\\\" is not supported.\"\n        )),\n    }\n}\n\npub(crate) fn create_doc_pages_export_prefs_from_args(\n    export_format: DocPagesExportFormat,\n    no_background: bool,\n    no_pattern: bool,\n    optimize_printing: bool,\n    page_order: SplitOrder,\n    bitmap_scalefactor: f64,\n    jpeg_quality: u8,\n) -> anyhow::Result<DocPagesExportPrefs> {\n    Ok(DocPagesExportPrefs {\n        export_format,\n        with_background: !no_background,\n        with_pattern: !no_pattern,","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-cli/src/export.rs#L311-L347","documentation":"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.","triggerScenarios":"`rnote export doc notes.rnote --output-file out.png` (or .jpg, .txt, .rnote, etc.) — extension exists but is not one of svg|xopp|pdf.","commonSituations":"Assuming image exports (png/jpg) exist for whole documents; typos like `.pddf`; reusing an output filename with the source `.rnote` extension.","solutions":["Use a supported extension: .svg, .xopp, or .pdf.","Check `rnote export doc --help` for the formats accepted by --output-format.","If you need PNG of a specific area, use the selection export subcommand instead of doc export."],"exampleFix":"// before\nrnote export doc notes.rnote --output-file out.png\n// after\nrnote export doc notes.rnote --output-file out.pdf","handlingStrategy":"validation","validationCode":"ext=\"${OUT##*.}\"; case \"$ext\" in svg|xopp|pdf) ;; *) echo \"doc export does not support .$ext (use svg|xopp|pdf)\"; exit 2;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember doc export supports only svg, xopp, pdf — not raster images.","Use selection export for png-style image output.","Double-check for typos in extensions (.pddf vs .pdf)."],"tags":["cli","unsupported-format","export"],"backgroundTag":"invalid-enum-value","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}