mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-17 14:55:23 +00:00
feat: adjust export quality to 0.95
This commit is contained in:
parent
2cde5022b4
commit
333cbb8a27
1 changed files with 13 additions and 13 deletions
|
|
@ -60,7 +60,7 @@ const DEFAULT_VIRTUAL_WIDTH = 800;
|
||||||
/** Canvas scale factor for increased resolution */
|
/** Canvas scale factor for increased resolution */
|
||||||
const CANVAS_SCALE = 2;
|
const CANVAS_SCALE = 2;
|
||||||
/** JPEG quality for image compression (0.0 to 1.0) */
|
/** JPEG quality for image compression (0.0 to 1.0) */
|
||||||
const JPEG_QUALITY = 0.7;
|
const JPEG_QUALITY = 0.95;
|
||||||
|
|
||||||
// ==================== Shared Utility Functions ====================
|
// ==================== Shared Utility Functions ====================
|
||||||
|
|
||||||
|
|
@ -392,8 +392,8 @@ export const downloadChatPdf = async (options: ChatPdfOptions): Promise<void> =>
|
||||||
const containerElement = document.getElementById(
|
const containerElement = document.getElementById(
|
||||||
options.containerElementId || 'full-messages-container'
|
options.containerElementId || 'full-messages-container'
|
||||||
);
|
);
|
||||||
if (containerElement) {
|
|
||||||
try {
|
try {
|
||||||
|
if (containerElement) {
|
||||||
const virtualWidth = DEFAULT_VIRTUAL_WIDTH;
|
const virtualWidth = DEFAULT_VIRTUAL_WIDTH;
|
||||||
|
|
||||||
// Clone and style element for rendering
|
// Clone and style element for rendering
|
||||||
|
|
@ -415,11 +415,11 @@ export const downloadChatPdf = async (options: ChatPdfOptions): Promise<void> =>
|
||||||
canvasToPdfWithSlicing(pdf, canvas, virtualWidth, A4_PAGE_WIDTH_MM, A4_PAGE_HEIGHT_MM);
|
canvasToPdfWithSlicing(pdf, canvas, virtualWidth, A4_PAGE_WIDTH_MM, A4_PAGE_HEIGHT_MM);
|
||||||
|
|
||||||
pdf.save(`chat-${options.title}.pdf`);
|
pdf.save(`chat-${options.title}.pdf`);
|
||||||
} catch (error) {
|
|
||||||
console.error('Error generating PDF', error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
await options.onAfterRender?.();
|
await options.onAfterRender?.();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue