Forum moved here!

# Home / Default color for Underline annotation [Supported in pre-release 3.4.14185+]

nyonyo

Hi,
I have been using the experimental annotation features in V3.3 Is there any easy way to change the default color setting for underline and squiggle?

Many thanks

GitHubRulesOK

old way was to edit the annotations file with hex values
new way is so much better just pulldown the color tree

[LATER EDIT]
see later post for change in Underline support
(but not currently squiggle)

Underlin

Can you put an option for color the text please?

GitHubRulesOK

Underline default colour is Lime (Green)
Highlight default colour is Yellow

In the past you could change those the same as others individually with the editor.

However see later post for changing their default colors.

benyaminl

Hello, is there any possibility to create underline annotation shortcut to “u” like “a” for highlight? That would be convenient for user after release. Thank you

GitHubRulesOK

you could add to open issue

[Later Edit]
This was variable 5/6 keys =
context key > then up > up > [ may need another up] enter > U

However in 3.4.14185 has been added as one key u and default colour can be included in Advanced SumatrPDF-settings.txt

benyaminl

yeah, seems that could be enabled using AHK. well thanks.

I already open the issue in github. [Suggestion] Underline Hotkey Shortcut to “u” · Issue #2157 · sumatrapdfreader/sumatrapdf

Thank you

GitHubRulesOK

Your issue as you may know was closed in 3.4.14185 as it has been added as one key u and default colour can also be included in Advanced SumatrPDF-settings.txt

GitHubRulesOK

If not already included, you can change UnderlineColor in version 3.4.14185+ like in this example

Annotations [
HighlightColor = #ffff00
UnderlineColor = #ff00ff
TextIconColor = #ffff00
TextIconType = comment
DefaultAuthor = (none)
]

nyonyo

@GitHubRulesOK that is really useful, thanks.

Is there also a bindkey to save annotation to the existing pdf (rather than having to do it via the annotation popup)

kjk

In a way there is: Shift - F10', cursor up, enter.

Shift-F10 brings the context menu
cursor up selects Save Annotations command
enter executes the command.

GitHubRulesOK

Note a feature of annotation apps in general (not just SumatraPDF) is that each time an object is added then saved (OR later deleted in another session), it edits the PDF by adding a new appendix annotations index (xref table).

So it is not a good idea to keep saving work in progress unless you have first made a lot of additions (or deletions) you wish to protect, as it can quickly bloat the end of file and take longer to traverse the index next time.

Also beware the example I show in Undo highlights - #2 by GitHubRulesOK

So overall it is best to only save annotations when closing the file which should be optional and easy to reject or accept (no need for a hot key)

benyaminl

woah. I can script this now using AHK. thank you!

#If WinActive("ahk_exe sumatrapdf.exe") ;
; Open Acrobat from SumatraPDF
!o::
Send !{f}a
return

; Save annotation
F3::
Send +{F10}
Send {Up}
Send {Enter}
return

#IfWinActive

abc

Inspired by @benyaminl’s Oct 29 post, I make the following AHK script to add underline in color red (default being lime) to a selection. My company’s computer cannot run the pre-release version, so I’m stuck with v3.3. The script may not work for other versions since the context menu may not be the same.

#If WinActive("ahk_exe sumatrapdf.exe") ;
; Add underline in red with Ctrl+U
^u::
Send +{F10}
Send {Up}
Send {Up}
Send {Right}
Send u
Send {Down}{End}
Send +{Tab}
Send +{Tab}
Send +{Tab}
Send +{Tab}
Send r

; Save annotation
F3::
Send !f
Send {Down}{Down}{Down}{Down}{Down}

#IfWinActive

M_S

hello i’m not new to use sumatra pdf but i ask if i can add more hotkey to setting only hotkey is (a) to highlight , I want use other kinds of highlights like underground etc , This will make my life easy and want text hotkey too, I want change color too be more easy.

GitHubRulesOK

Latest pre-release has U for underline

You can in recent pre-release set your own UnderlineColor =

Annotations [
HighlightColor = #ffff60
UnderlineColor = #ff0000
]
`

M_S

a big thanks for answer for me
but
i want to add my own hotkeys
like 1 , 2 ,3 ,4 and text editor too
so please how to do it ?

GitHubRulesOK

To write your own keyboard redirection you need to store the keyboard sequence and apply / assign it to an unused key combination like for example CTRL 7 8 9, However SumatraPDF itself does not have a means to remap keys, you need to use a keyboard app like AutoHotKeys and two user examples are given in the posts above, you save the sequence as plain text in filename.ahk then they can be (auto)running before or during sumatrapdf session