{"record":{"id":"07201750f3be8150","repo":"flxzt/rnote","slug":"downcasting-finished-output-stream-failed-err-e","errorCode":null,"errorMessage":"Downcasting finished output stream failed, Err: {e:?}","messagePattern":"Downcasting finished output stream failed, Err: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/engine/export.rs","lineNumber":527,"sourceCode":"                            doc_export_prefs.with_pattern,\n                            doc_export_prefs.optimize_printing,\n                            DocExportPrefs::MARGIN,\n                            Engine::STROKE_EXPORT_IMAGE_SCALE,\n                        )?;\n                        cairo_cx.show_page().map_err(|e| {\n                            anyhow::anyhow!(\n                                \"Showing page failed while exporting page {i} as pdf, Err: {e:?}\"\n                            )\n                        })?;\n                        cairo_cx.restore()?;\n                    }\n                }\n                let data = *target_surface\n                    .finish_output_stream()\n                    .map_err(|e| anyhow::anyhow!(\"Finishing outputstream failed, Err: {e:?}\"))?\n                    .downcast::<Vec<u8>>()\n                    .map_err(|e| {\n                        anyhow::anyhow!(\"Downcasting finished output stream failed, Err: {e:?}\")\n                    })?;\n\n                Ok(data)\n            };\n\n            if oneshot_sender.send(result()).is_err() {\n                error!(\n                    \"Sending result to receiver failed while exporting document as Pdf bytes. Receiver already dropped.\"\n                );\n            }\n        });\n\n        oneshot_receiver\n    }\n\n    /// Export the document as a Xournal++ .xopp file.\n    fn export_doc_as_xopp_bytes(\n        &self,","sourceCodeStart":509,"sourceCodeEnd":545,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/engine/export.rs#L509-L545","documentation":"Guard in export_doc_pages_as_svgs_bytes: page i's content generated an SVG render that came back as None during the rayon parallel map, so the required Vec<u8> for that page is missing and the batch SVG export aborts. Indicates a page whose content could not be rendered to SVG.","triggerScenarios":"Thrown at crates/rnote-engine/src/engine/export.rs:527 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect page i's content; a None SVG usually means no renderable content or an unsupported element.","Re-run the export with the same file to confirm it reproduces deterministically.","Export pages individually or remove the offending page to isolate it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}