{"record":{"id":"43dddbd37382ff0d","repo":"tonhowtf/omniget","slug":"libreoffice-nao-encontrado","errorCode":null,"errorMessage":"LibreOffice nao encontrado","messagePattern":"LibreOffice nao encontrado","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pdf.rs","lineNumber":1321,"sourceCode":"    report(&progress, \"done\", pages as u64, Some(pages as u64), None);\n    Ok(PdfOut {\n        output: output.to_string_lossy().to_string(),\n        pages,\n        bytes,\n    })\n}\n\n// ── LibreOffice (PDF ↔ Office) ─────────────────────────────────────────\n\npub async fn office_convert(\n    inputs: Vec<String>,\n    target: String,\n    output_dir: String,\n    progress: super::ProgressFn,\n) -> anyhow::Result<Vec<String>> {\n    let soffice = find_soffice()\n        .await\n        .ok_or_else(|| anyhow!(\"LibreOffice nao encontrado\"))?;\n    let target = target.trim().trim_start_matches('.').to_ascii_lowercase();\n    if !matches!(\n        target.as_str(),\n        \"docx\" | \"odt\" | \"pptx\" | \"xlsx\" | \"pdf\" | \"html\" | \"txt\" | \"epub\"\n    ) {\n        return Err(anyhow!(\"formato nao suportado: {}\", target));\n    }\n    let mut outputs = Vec::new();\n    let n = inputs.len() as u64;\n    for (i, input) in inputs.iter().enumerate() {\n        report(\n            &progress,\n            \"progress\",\n            i as u64,\n            Some(n),\n            Some(input.clone()),\n        );\n        let input_path = PathBuf::from(input.trim());","sourceCodeStart":1303,"sourceCodeEnd":1339,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pdf.rs#L1303-L1339","documentation":"Raised when `find_soffice()` cannot locate the LibreOffice `soffice` executable, which is required for document conversion. The function bails out early with this message instead of proceeding to conversion. LibreOffice is an optional external dependency, not bundled with the app.","triggerScenarios":"Calling the LibreOffice conversion API (e.g. convert to docx/odt/pptx/epub) on a machine where LibreOffice is not installed or `soffice` is not discoverable in standard install locations / PATH.","commonSituations":"Fresh CI containers or minimal Docker images without LibreOffice, macOS/Linux installs in non-standard prefixes not covered by the lookup paths, Windows installs without LibreOffice in Program Files.","solutions":["Install LibreOffice (`apt install libreoffice`, brew, or official installer)","Add the soffice binary directory to PATH if installed in a custom location","Check the app's dependency manager screen (Ajustes → Dependências) for bundled install","Verify `soffice --version` runs in a terminal"],"exampleFix":"// before\nlet out = convert_with_office(files, \"docx\", dir, progress).await?;\n// after\nif find_soffice().await.is_none() {\n    eprintln!(\"LibreOffice ausente; instale-o antes de converter\");\n    return Ok(vec![]);\n}\nlet out = convert_with_office(files, \"docx\", dir, progress).await?;","handlingStrategy":"validation","validationCode":"// Rust: probe for soffice before conversion\nlet soffice = find_soffice().await;\nif soffice.is_none() {\n    eprintln!(\"Instale o LibreOffice para conversao de documentos\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for soffice during app startup and show a dependency prompt","Document LibreOffice as an optional requirement in your install docs","In Docker/CI, install libreoffice in the image explicitly","Allow users to configure a custom soffice path in settings"],"tags":["external-dependency","libreoffice","conversion"],"backgroundTag":"missing-dependency","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}