Hide comments and annotations checkboxes

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
Latest

Detailed description of issue
Is there a way to hide the “Print comments” and “Print annotations” checkboxes from the print modal?
I have disabled the annotations using disableFeatures, but the checkbox is still there.

let disabledFeatures = [
    instance.UI.Feature.Download,
    instance.UI.Feature.Annotations,
];
instance.UI.disableFeatures(disabledFeatures);

They dont seem to have a data-element tag either
Expected behaviour
They should be hidden

Hi there,

You can remove them via CSS:

See this forum post for more details:

best regards,
Kevin Kim

Thanks.

I was thinking about using css, but they all have the same classes, so I dont see a way of targeting them without using a lot of not()

I did this and it seems to work. Feels a bit brittle though :slight_smile:

const iframeDoc = instance.UI.iframeWindow.document;

iframeDoc.querySelector('.settings-form .ui__choice:not(.ui__choice--radio)').remove();
iframeDoc.querySelector('.settings-form .ui__choice:not(.ui__choice--radio)').remove();