cmxl / pdftron-printcheckbox-issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDFTron Printing Checkbox Form Field Issue

When printing the issue.pdf via the WebViewer component all checkbox form fields will be printed with a rectangle around. This is not an issue in the viewer per se, but only when printing the document.

Is there a way to prevent this behavior?

Prerequisites

Reproducing the issue

=> In the browser's print dialog you would already see the rectangles.

Fix

https://www.pdftron.com/documentation/web/guides/form-field-styling/

Webviewer(...).then(async (instance) => {
  const { Annotations } = instance;

  Annotations.WidgetAnnotation.getCustomStyles = widget => {
    if (widget instanceof Annotations.CheckButtonWidgetAnnotation) {
      return {
        'border': 'none',
      };
    }
  };
});

About


Languages

Language:JavaScript 51.3%Language:HTML 48.7%