[WC-3431]: Doc Viewer Checkbox Fix#2262
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use mx.appUrl (with window.location.origin fallback) for cMapUrl and standardFontDataUrl so the PDF.js worker can resolve font and cmap resources when loaded from a cross-origin URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
863b072 to
bd769e1
Compare
This comment has been minimized.
This comment has been minimized.
AI Code Review
What was reviewed
Skipped (out of scope): Findings
|
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Fix PDF standard font rendering in Document Viewer
Problem: PDFs containing glyphs from ZapfDingbats (e.g. checkmarks generated by .NET PDF libraries) rendered as blank rectangles in Document Viewer. The browser's native PDF viewer displayed them correctly.
Root cause: standardFontDataUrl and cMapUrl were relative paths. The PDF.js worker is loaded from //unpkg.com (cross-origin), so fetch() in the worker context has no document origin to resolve relative URLs against — throwing TypeError: Failed to parse URL.
Fix: Prepend window.location.origin to both URLs, making them absolute and resolvable from any worker origin.
Tested with: