flxzt/rnote · error

Downcasting finished output stream failed, Err

Error message

Downcasting finished output stream failed, Err: {e:?}

What it means

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.

Solutions

  1. Inspect page i's content; a None SVG usually means no renderable content or an unsupported element.
  2. Re-run the export with the same file to confirm it reproduces deterministically.
  3. Export pages individually or remove the offending page to isolate it.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/rnote-engine/src/engine/export.rs:527 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/rnote-engine/src/engine/export.rs:527

                            doc_export_prefs.with_pattern,
                            doc_export_prefs.optimize_printing,
                            DocExportPrefs::MARGIN,
                            Engine::STROKE_EXPORT_IMAGE_SCALE,
                        )?;
                        cairo_cx.show_page().map_err(|e| {
                            anyhow::anyhow!(
                                "Showing page failed while exporting page {i} as pdf, Err: {e:?}"
                            )
                        })?;
                        cairo_cx.restore()?;
                    }
                }
                let data = *target_surface
                    .finish_output_stream()
                    .map_err(|e| anyhow::anyhow!("Finishing outputstream failed, Err: {e:?}"))?
                    .downcast::<Vec<u8>>()
                    .map_err(|e| {
                        anyhow::anyhow!("Downcasting finished output stream failed, Err: {e:?}")
                    })?;

                Ok(data)
            };

            if oneshot_sender.send(result()).is_err() {
                error!(
                    "Sending result to receiver failed while exporting document as Pdf bytes. Receiver already dropped."
                );
            }
        });

        oneshot_receiver
    }

    /// Export the document as a Xournal++ .xopp file.
    fn export_doc_as_xopp_bytes(
        &self,

View on GitHub (pinned to bbc5354502)