From bae122a8b79239de0ef34d47b6a1075e741c6165 Mon Sep 17 00:00:00 2001 From: Tomas Rutkauskas Date: Fri, 6 Nov 2026 16:48:29 +0200 Subject: [PATCH] PDF thumbnail example: keep the thumbnail inside 300x300 Without FitToSize, the ImageHeight=300 / ImageWidth=300 request came back 300x388 for the portrait test.pdf: the width was applied, the height was not. FitToSize fits the image inside both limits (231x300). Co-Authored-By: Claude Opus 5.5 --- examples/create_pdf_thumbnail.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/create_pdf_thumbnail.js b/examples/create_pdf_thumbnail.js index 25529ab..7848947 100644 --- a/examples/create_pdf_thumbnail.js +++ b/examples/create_pdf_thumbnail.js @@ -12,7 +12,8 @@ convertapi.convert('jpg', { File: './examples/files/test.pdf', PageRange: 1, ImageHeight: 300, - ImageWidth: 300 + ImageWidth: 300, + FitToSize: true }) .then(function(jpgResult) { return jpgResult.saveFiles(dir);