From c7cfab3cfbdf54ffc92ace631d2f25f6553e8da3 Mon Sep 17 00:00:00 2001 From: e551763 Date: Thu, 12 Sep 2024 12:40:49 +0200 Subject: [PATCH] fix: svg images bottom part is missing Refs: #63 --- README.md | 6 +++--- app/SvgUtils.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 37368ea..57f5a9f 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Service providing REST API to use WeasyPrint functionality ```bash docker build \ - --build-arg APP_IMAGE_VERSION=62.4.0 \ + --build-arg APP_IMAGE_VERSION=62.4.3 \ --file Dockerfile \ - --tag weasyprint-service:62.4.0 . + --tag weasyprint-service:62.4.3 . ``` ## Start Docker container @@ -16,7 +16,7 @@ Service providing REST API to use WeasyPrint functionality docker run --detach \ --publish 9080:9080 \ --name weasyprint-service \ - weasyprint-service:62.4.0 + weasyprint-service:62.4.3 ``` ## Stop Docker container diff --git a/app/SvgUtils.py b/app/SvgUtils.py index f88f737..cd3ea4a 100644 --- a/app/SvgUtils.py +++ b/app/SvgUtils.py @@ -93,13 +93,14 @@ def replace_svg_with_png(svg_content): png_filepath = os.path.join(temp_folder, uuid + '.png') result = subprocess.run([ f'{chrome_executable}', - '--headless', + '--headless=old', '--no-sandbox', '--disable-gpu', '--disable-software-rasterizer', '--disable-dev-shm-usage', '--default-background-color=00000000', '--hide-scrollbars', + '--enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb', f'--screenshot={png_filepath}', f'--window-size={width},{height}', f'{svg_filepath}',