feat: adjust export quality to 0.95

This commit is contained in:
Shirasawa 2025-12-03 09:19:29 +00:00
parent 2cde5022b4
commit 333cbb8a27

View file

@ -60,7 +60,7 @@ const DEFAULT_VIRTUAL_WIDTH = 800;
/** Canvas scale factor for increased resolution */
const CANVAS_SCALE = 2;
/** JPEG quality for image compression (0.0 to 1.0) */
const JPEG_QUALITY = 0.7;
const JPEG_QUALITY = 0.95;
// ==================== Shared Utility Functions ====================
@ -392,8 +392,8 @@ export const downloadChatPdf = async (options: ChatPdfOptions): Promise<void> =>
const containerElement = document.getElementById(
options.containerElementId || 'full-messages-container'
);
if (containerElement) {
try {
if (containerElement) {
const virtualWidth = DEFAULT_VIRTUAL_WIDTH;
// 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);
pdf.save(`chat-${options.title}.pdf`);
} catch (error) {
console.error('Error generating PDF', error);
}
}
} finally {
await options.onAfterRender?.();
}
return;
}