feat: add inline PDF viewer for Custom_PDF objects
Add a /pdf proxy route that forces Content-Disposition inline so PDFs render instead of downloading, and a web viewer that embeds the document in an iframe with a standalone open-in-new-tab link.
This commit is contained in:
@@ -23,4 +23,9 @@ export function resolveAssetUrl(url: string, baseUrl?: string): string {
|
||||
/** Route an external asset URL through the proxy so three.js can load it. */
|
||||
export function assetUrl(url: string): string {
|
||||
return `/asset?url=${encodeURIComponent(url)}`;
|
||||
}
|
||||
|
||||
/** Route a PDF URL through the proxy so it renders inline instead of downloading. */
|
||||
export function pdfUrl(url: string): string {
|
||||
return `/pdf?url=${encodeURIComponent(url)}`;
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
export { resolveAssetUrl, assetUrl } from './asset.js';
|
||||
export { resolveAssetUrl, assetUrl, pdfUrl } from './asset.js';
|
||||
export { traceImage } from './trace.js';
|
||||
export type { TraceResult } from '@tts/shared';
|
||||
Reference in New Issue
Block a user