Remove support for rem2ps - we use rem2pdf to print.

This commit is contained in:
Dianne Skoll
2025-10-31 16:51:59 -04:00
parent 22d6c0583a
commit 1fd19b89e2

View File

@@ -252,9 +252,6 @@ set DateToWinOffset [dict create]
# Remind program to execute -- supply full path if you want
set Remind "remind"
# Rem2PS program to execute -- supply full path if you want
set Rem2PS "rem2ps"
# Rem2PDF program to execute -- supply full path if you want
set Rem2PDF "rem2pdf"
@@ -360,8 +357,8 @@ set Option(PrintMargins) 36pt
set OptDescr(PrintSmallCalendars) "(0/1) If 1, print small calendars in PostScript output"
set Option(PrintSmallCalendars) 1
set OptDescr(PrintFormat) "Print format: pdf, ps or ps1 - ps1 means PostScript using rem2pdf"
set Option(PrintFormat) ps
set OptDescr(PrintFormat) "Print format: pdf or ps"
set Option(PrintFormat) pdf
set WarningHeaders [list "# Lines starting with REM TAG TKTAGnnn ... were created by tkremind" "# Do not edit them by hand or results may be unpredictable."]
@@ -1232,6 +1229,11 @@ proc LoadOptions {} {
"$Option(View)" != "Week-4" } {
set Option(View) "Month"
}
# We no longer support rem2ps
if { "$Option(PrintFormat)" == "ps1" } {
set Option(PrintFormat) ps
}
}
@@ -1662,13 +1664,13 @@ proc DoPrint {} {
}
proc DoPrintHelper {} {
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus RemindErrors
global Rem2PDF HaveRem2PDF PSCmd Option PrintStatus RemindErrors
global CurDay CurMonth CurYear MonthNames
catch {destroy .p}
if {$Option(View) != "Month" && ! $HaveRem2PDF} {
tk_messageBox -message "rem2pdf was not found, but is required to print weekly calendars" -icon error -type ok
if {! $HaveRem2PDF} {
tk_messageBox -message "rem2pdf was not found, but is required to print calendars" -icon error -type ok
return
}
@@ -1693,13 +1695,10 @@ proc DoPrintHelper {} {
entry .p.command
.p.command insert end "lpr"
if { $HaveRem2PDF } {
frame .p.ff -relief sunken -bd 2
label .p.format -text "Output Format:"
radiobutton .p.pdf -text "PDF" -variable Option(PrintFormat) -value pdf
radiobutton .p.ps -text "PostScript (using rem2ps)" -variable Option(PrintFormat) -value ps
radiobutton .p.ps1 -text "PostScript (using rem2pdf)" -variable Option(PrintFormat) -value ps1
}
frame .p.ff -relief sunken -bd 2
label .p.format -text "Output Format:"
radiobutton .p.pdf -text "PDF" -variable Option(PrintFormat) -value pdf
radiobutton .p.ps -text "PostScript" -variable Option(PrintFormat) -value ps
label .p.size -text "Paper Size:"
radiobutton .p.letter -text "Letter" -variable Option(PrintSize) -value letter
@@ -1740,9 +1739,7 @@ proc DoPrintHelper {} {
pack .p.f11 .p.f12 -in .p.f1 -side top -fill none -expand 0 -anchor w
pack .p.tofile .p.filename .p.browse -in .p.f11 -side left -fill none -expand 0 -anchor w
pack .p.tocmd .p.command -in .p.f12 -side left -fill none -expand 0 -anchor w
if { $HaveRem2PDF } {
pack .p.format .p.pdf .p.ps .p.ps1 -in .p.ff -side top -fill none -expand 0 -anchor w
}
pack .p.format .p.pdf .p.ps -in .p.ff -side top -fill none -expand 0 -anchor w
pack .p.size .p.letter .p.a4 -in .p.f2 -side top -fill none -expand 0 -anchor w
pack .p.margin .p.24pt .p.36pt .p.48pt -in .p.f2a -side top -anchor w -fill none -expand 0
pack .p.orient .p.landscape .p.portrait -in .p.f3 -side top -fill none -expand 0 -anchor w
@@ -1792,56 +1789,29 @@ proc DoPrintHelper {} {
} else {
set p [regsub %WEEKS% $PSCmd "+[get_num_weeks]"]
}
if {$HaveRem2PDF && $Option(PrintFormat) == "pdf"} {
if {$Option(PrintFormat) == "pdf"} {
set p [regsub %EXTRA% $p "-itkpdf=1 $Option(ExtraRemindArgs)"]
set cmd "$p 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PDF --weeks-per-page=[get_num_weeks]"
} elseif {$HaveRem2PDF && $Option(PrintFormat) == "ps1"} {
} else {
set p [regsub %EXTRA% $p "-itkpdf=1 $Option(ExtraRemindArgs)"]
set cmd "$p 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PDF --ps --weeks-per-page=[get_num_weeks]"
} else {
set p [regsub %EXTRA% $p $Option(ExtraRemindArgs)]
set cmd "$p $CurDay [lindex $MonthNames $CurMonth] $CurYear | $Rem2PS"
set Option(PrintFormat) ps
}
if {$Option(PrintSize) == "letter"} {
if {$Option(PrintFormat) == "ps"} {
append cmd " -m Letter"
} else {
append cmd " --media=Letter"
}
append cmd " --media=Letter"
} else {
if {$Option(PrintFormat) == "ps"} {
append cmd " -m A4"
} else {
append cmd " --media=A4"
}
append cmd " --media=A4"
}
if {$Option(PrintMargins) == "24pt"} {
if {$Option(PrintFormat) == "ps"} {
append cmd " -or 24 -ol 24 -ot 24 -ob 24"
} else {
append cmd " --margin-right=24 --margin-left=24 --margin-top=24 --margin-bottom=24"
}
append cmd " --margin-right=24 --margin-left=24 --margin-top=24 --margin-bottom=24"
} elseif {$Option(PrintMargins) == "36pt"} {
if {$Option(PrintFormat) == "ps"} {
append cmd " -or 36 -ol 36 -ot 36 -ob 36"
} else {
append cmd " --margin-right=36 --margin-left=36 --margin-top=36 --margin-bottom=36"
}
append cmd " --margin-right=36 --margin-left=36 --margin-top=36 --margin-bottom=36"
} else {
if {$Option(PrintFormat) == "ps"} {
append cmd " -or 48 -ol 48 -ot 48 -ob 48"
} else {
append cmd " --margin-right=48 --margin-left=48 --margin-top=48 --margin-bottom=48"
}
append cmd " --margin-right=48 --margin-left=48 --margin-top=48 --margin-bottom=48"
}
if {$Option(WrapCal)} {
if {$Option(PrintFormat) == "pdf" || $Option(PrintFormat) == "ps1"} {
append cmd " --wrap"
}
append cmd " --wrap"
}
if {$Option(PrintOrient) == "landscape"} {
append cmd " -l"
@@ -1854,12 +1824,6 @@ proc DoPrintHelper {} {
if {!$Option(PrintDaysRight)} {
append cmd " -x"
}
if {$Option(PrintEncoding)} {
if {$Option(PrintFormat) == "ps"} {
append cmd " -i"
}
}
if {$Option(PrintSmallCalendars)} {
append cmd " -c3"
} else {