Open sr71684 opened 1 year ago
Have you found a solution to this? it's 2024 and the problem still persists.
I think the issue stems from the pdf having a transparent background to begin with. One solution may be to add an option for drawing a white background behind each pdf page.
What do you think @zsviczian?
in case helpful to others, here's a script (for macos) to change pdf backgrounds to white as work-around for this issue:
#!/bin/bash
# Usage: ./script.sh <input_pdf_file>
# outputs: <input_pdf_file>-whitened.pdf
#
# This script replaces any transparency with white background to all pages of a PDF.
#
# Note: this assumes you're on macOS and have 'pdfinfo' and 'gs' (Ghostscript) installed
# e.g., via Homebrew: 'brew install pdfinfo ghostscript'
# Get pdfinfo output
pdfinfo_output=$(pdfinfo "$1")
# Extract page size using regular expression (compatible with BSD grep)
page_size=$(echo "$pdfinfo_output" | grep -E 'Page size:' | grep -oE '[0-9]+ x [0-9]+')
# Split width and height
width=$(echo "$page_size" | cut -d' ' -f1)
height=$(echo "$page_size" | cut -d' ' -f3)
# Get the original base filename (without extension)
original_base_filename=$(basename "$1" .pdf)
# Construct Ghostscript command (original, working version)
gs_command="gs -o ${original_base_filename}-whitened.pdf -sDEVICE=pdfwrite -c \"[/PageSize [$width $height] /ImagingBBox null def] << /BeginPage { /DeviceRGB setcolorspace 1 1 1 setcolor fill 0 0 $width $height rectfill } bind >> setpagedevice\" -f $1"
# Execute Ghostscript command, redirecting stderr to /dev/null unless there's an error
if ! eval "$gs_command" 2>/dev/null; then
echo "An error occurred during Ghostscript execution. Please check the output for details." >&2
fi
Is your feature request related to a problem? Please describe. I'm always frustrated when I try to annotate an imported PDF in darkmode and the text is black against a black (or very dark) excallidraw background.
Describe the solution you'd like The ability to read a pdf in dark mode. Ideally, the PDF text should be white, such that it can be read against a dark canvas background.
Additional context Light mode is readable but blinding:
Dark mode is unreadable :(