SVG Images with transparencies, printing

Michael's Avatar

Michael

04 Mar, 2025 07:01 PM

// Please enter a detailed description of the issue // Description of the issue:

SVG Images with transparencies, printing

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

I have markdown files that use a code like the following line to display an SVG image:

Opening and displaying such MD files screen is perfect, but when I print the document and e.g. select “Open in Preview” in the Print dialog, the resulting image is defective because the transparencies are ignored.

Questions:

  1. Is is possible to support transpoarencies in printing at all? If yes, can you point me in a direction what changes I need?

  2. Alternatively: can I provide two images, one for screen, one for printing? I tried e.g the following whithout much success:


// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 1067 (Mac App Store)

macOS Version: 15.3.1

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 3
defaultProcessor: Discount (GFM)
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: YES
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

  1. Support Staff 1 Posted by Brett on 07 Mar, 2025 03:17 PM

    Brett's Avatar

    Your images didn't come through in your post, so I'm not sure what you've tried. It should be possible with CSS to provide two different images, but I don't think I can do anything to improve transparency handling in SVGs. Marked uses a now-outdated version of WebKit and its related printing system, and it can't be updated due to features it uses that aren't available in the updated version of WebKit.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • test.md 485 Bytes

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac