WebViewer Version:
10.3.0
Do you have an issue with a specific file(s)?
No.
Can you reproduce using one of our samples or online demos?
No.
Are you using the WebViewer server?
No.
Does the issue only happen on certain browsers?
No.
Is your issue related to a front-end framework?
No.
Is your issue related to annotations?
Yes.
Please give a brief summary of your issue:
(Think of this as an email subject)
Question, I want to display the document after applyRedactions.
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I want to display the document after applyRedactions.
However, the document before redaction is displayed for a few milliseconds.
SampleCode.
pdftronStylesheets.css
{
// Hide viewer until redaction is applied
.content {
visibility: hidden;
}
}
------------------------------------------------------------------
WebViewer({
licenseKey: 'licensekey',
enableRedaction: true,
initialDoc: 'downloadUrl',
loadAsPdf: true,
css: '/assets/stylesheets/pdftronStylesheets.css',
fullAPI: true,
...
}).then((instance: WebViewerInstance) => {
const { annotationManager, documentViewer } = instance.Core;
documentViewer.addEventListener('documentLoaded', async () => {
const redactAnnotationXFDFs = DB.GetRedactAnnotationXFDFs();
redactAnnotationXFDFs .forEach(xfdf => {
const annots = await instance.Core.annotationManager.importAnnotations(xfdf);
instance.Core.annotationManager. redrawAnnotation(annots[0]);
});
// ***** apply *****
await instance.Core.annotationManager.applyRedactions();
const documentContent =
instance.UI.iframeWindow.document.querySelector(
'.content'
);
// ***** View in viewer after applying redaction *****
documentContent?.setAttribute('style', 'visibility: visible');
});
});
Result of sample code
What should I do?
Please give me some advice.
Best Regards.
Please provide a link to a minimal sample where the issue is reproducible: