Skip to main content
Participant
December 2, 2020
Answered

Programmatically set thickness of drawing tool

  • December 2, 2020
  • 2 replies
  • 874 views

I am using Adobe Embed API and I would like to change the thickness (and also the color) of the output of the drawing tool. Using a SET_USER_SETTINGS_API callback, I received an object 

annotationTooltipShownMap: {
freetext:  false
highlight: false
note: false
shape: false
strikeout: false
underline: false
}
However, I cannot find the parameters I need to give to the GET_USER_SETTINGS_API callback in order to change the thickness and color of the drawing tool. I would also be very glad for a link that discusses the parameters for these APIs. 
 
Thanks!
    This topic has been closed for replies.
    Correct answer Shubhanshu Dixit

    Thanks for using PDF Embed API. Currently, it is not possible to change the thickness of the drawing tool programmatically. But it is possible to store the user's color preferences for each annotation tool. Same are stored with below key in object return/expected by SET_USER_SETTING_API and GET_USER_SETTING_API

    "previewAnnotationColorMap": {
    "freetext": "#16EC83",
    "note": "#16EC83",
    "shape": "#16EC83",
    "highlight": "#16EC83",
    "underline": "#16EC83",
    "strikeout": "#16EC83"
    }

     The reason, it is not reflecting in your settings object because the user did not change any annotation's color from the default ones.

    2 replies

    Shubhanshu DixitCorrect answer
    Adobe Employee
    December 3, 2020

    Thanks for using PDF Embed API. Currently, it is not possible to change the thickness of the drawing tool programmatically. But it is possible to store the user's color preferences for each annotation tool. Same are stored with below key in object return/expected by SET_USER_SETTING_API and GET_USER_SETTING_API

    "previewAnnotationColorMap": {
    "freetext": "#16EC83",
    "note": "#16EC83",
    "shape": "#16EC83",
    "highlight": "#16EC83",
    "underline": "#16EC83",
    "strikeout": "#16EC83"
    }

     The reason, it is not reflecting in your settings object because the user did not change any annotation's color from the default ones.

    Participant
    December 4, 2020

    Shubhanshu, thank you for your answer. If one could change the thickness of the drawing tool, that would turn it into a text marker, something that users very much like when commenting on actual paper, and that commercial kits often offer. Would it be possible to include that in a future update?

     

    I will use the fields you showed in your answer for changing the color. It would be greatly appreciated if the documentation somewhere listed all fields that can be set.

     

     

    Participant
    December 3, 2020

    In fact, the Documentation on Adobe Embed API explicitly says "For example, you could store the user’s color choice for any annotation tool. In that case, new annotations subsequently receive the updated color". However, the necessary field names aren't given anywhere.