Cannot add annotation to second page programatically


Product Version:10.0

Please give a brief summary of your issue:
Cannot add the annotation dynamically on the second page that covers the entire page.

Please describe your issue and provide steps to reproduce it:
I loaded the pdf file with multiple pages. I wanted to add the freetext annotation that covers the entire second page. But with the code below, It is added to the first page only though I have set the page number to 2.

Please provide a link to a minimal sample where the issue is reproducible:

redactWholePage() {

const { documentViewer, annotationManager, Annotations } = this.viewerInstance.Core;
const doc = documentViewer.getDocument();
const pageinfo = doc.getPageInfo(2)
const annot = new this.viewerInstance.Core.Annotations.FreeTextAnnotation('freetext', {
  pageNumber: 2,
  X: 0,
  Y: 0,
  Width: pageinfo.width,
  Height: pageinfo.height,
annot.StrokeThickness = 0;
annot.TextColor = new Annotations.Color(0, 0, 0)
annot.FillColor = new Annotations.Color(255, 255, 255)
annot.TextAlign = 'center'
annot.TextVerticalAlign = 'center'
annot.FontSize = '14pt'
annot.NoResize = true
annot.NoMove = true
annot.NoRotate = true
annot.setCustomData('ObjectId', this.selectedObjectId)


Hi there,

Thanks for reaching out to WebViewer forum,

Looking at this guide to creating freetext annotations: Apryse Documentation | Documentation

It looks like you want to set the intent to be the enum:
and page number attribute to be ‘PageNumber

Best regards,
Kevin Kim