Which product are you using?
PDF.js Express Viewer
PDF.js Express Version
8.4.0
Detailed description of issue
Even though I have entered the correct key, the watermark is still displayed when running on the server.
It’s an angular application. I tried using @pdftron/pdfjs-express as well as @pdftron/pdfjs-express-viewer. In both cases, the watermark never disappears.
However, there are some differences.
@pdftron/pdfjs-express:
locally: PDF is displayed, watermark is displayed, no console output regarding license
server: PDF is displayed, watermark is displayed
@pdftron/pdfjs-express-viewer:
locally: PDF is displayed, watermark is displayed, console output says the license is valid for the correct domain
server: PDF is not displayed (never stops loading), console shows error:
Expected behaviour
Watermark should disappear on server
Does your issue happen with every document, or just one?
With every document
Link to document
n/a
Code snippet
@ViewChild('viewer', { static: false }) public viewer: ElementRef;
public ngAfterViewInit(): void {
this.fileDownloadService.downloadBlob(this.fileDownloadService.downloadDocumentPath.replace('{documentId}', this.documentId))
.subscribe((result: BlobWithFilename) => {
WebViewer({
licenseKey: 'MY-KEY',
path: '../assets/pdfjs-express-viewer',
disableLogs: true},
this.viewer.nativeElement)
.then(instance => {
// https://pdfjs.express/documentation/ui-customization/hiding-elements
instance.UI.loadDocument(result.blob, { filename: result.filename });
instance.UI.disableFeatures([instance.UI.Feature.Print]);
instance.UI.disableFeatures([instance.UI.Feature.TextSelection]);
instance.UI.disableFeatures([instance.UI.Feature.Annotations]);
instance.UI.disableElements(['panToolButton']);
instance.UI.disableElements(['selectToolButton']);
instance.UI.disableElements(['toolsHeader']);
});
}, (error) => {
throw error;
});
}