What is the color code for no fill?

We’re using a custom header and want to put the option for no fill but don’t know the color code.

this.wvInstance.setColorPalette({
toolNames: [ToolNames[‘TEXT’], ToolNames[‘FREETEXT’], ToolNames[‘LINE’], ToolNames[‘RECTANGLE’], ToolNames[‘FREEHAND’], ToolNames[‘HIGHLIGHT’]],
colors: [
#ffffff’,
#FF0000’,
#0000FF’,
],
defaults: [{StrokeColor:‘#FF0000’}]
});

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hello shiran305,

For the no fill color palette option, you can simply set the opacity to be 0:

    instance.setColorPalette({
      toolNames: [ToolNames['TEXT'], ToolNames['FREETEXT'], ToolNames['LINE'], ToolNames['RECTANGLE'], ToolNames['FREEHAND'], ToolNames['HIGHLIGHT']],
      colors: [
      '#ffffff',
      '#FF0000',
      '#0000FF',
      ],
      defaults: [{
        StrokeColor:'#FF0000',
        FillColor: new instance.Core.Annotations.Color(0, 0, 255, 0),
      }]
    });

Reference document can be found here:

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

I should have been more clear. We are using the draw a shape tool, the demo has a no fill option. Putting it to 0% opacity doesn’t make a box.

Hello shiran305,

The color code for no-fill is ‘transparency’:

      colors: [
      '#ffffff',
      '#FF0000',
      '#0000FF',
      'transparency',
      ],

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here