Skip to content

Downloads ​

The module allows you to download several files in order to produce the design.

SVG Download ​

You can download the production SVG from the backoffice order page or from the carts page

Sell menu

The module will display each design summary like this

Bo summary

Click the button Svg download zip to download the SVG file and the files that are related to the design in a single zip archive.

The zip will contain different folders for the different design sides

Zip

Opening the SVG files

To open the SVG files, you need to use Inkscape logo inkscape because it's the only program that is compatible with browsers in terms of SVG support.

You can also use inkscape to convert the SVG to PDF if you want to open them in other programs like Corel or illustrator.

Server software ​

The SVG download works on any server. The other downloads, the preview images and some upload formats need extra software on the server. The module detects what is installed and uses the first tool that works.

SoftwareUsed forInstall hint
Inkscape 1.0+PDF download, PNG previews, AI / EPS / PDF uploadssudo apt install inkscape
DockerRuns Inkscape in a container when Inkscape is not installedUsing docker
Chromium / Google ChromeChrome PDF and Chrome PNG downloadssudo apt install chromium
Ghostscript (gs)CMYK PDF downloadsudo apt install ghostscript
ImageMagick command line (convert, magick)PNG previews (last fallback), HEIC uploadssudo apt install imagemagick
PHP Imagick extension (php-imagick)HEIC and AVIF uploads, without shell accesssudo apt install php-imagick, then restart PHP-FPM or Apache
PHP GD with AVIF supportAVIF uploadsIncluded in PHP 8.1+ builds with AVIF enabled
heif-convertHEIC uploadssudo apt install libheif-examples
tifigHEIC uploads (last fallback)tifig releases
Remote converter (paid API)PDF, Chrome PDF and PNG previews when nothing is installedRemote converter

TIP

All command line tools need the PHP shell_exec function to be enabled, and the binary must be in the PATH of the web server user. The module also looks in /usr/local/bin and /opt/homebrew/bin.

Imagick vs ImageMagick

The PHP Imagick extension and the ImageMagick command line tools are installed separately. The extension runs inside PHP and doesn't need shell_exec. HEIC needs ImageMagick built with HEIC support, and AVIF needs it built with AVIF support. To check that the extension is loaded:

shell
php -m | grep imagick

Fallback order ​

FeatureTools tried, in order
PDF downloadInkscape, Docker (linuxserver/inkscape), remote converter
CMYK PDF downloadSame as PDF download, then Ghostscript converts the PDF to CMYK
Chrome PDF downloadchromium, chromium-browser, google-chrome, remote converter
Chrome PNG downloadchromium, chromium-browser, google-chrome
PNG previewsInkscape, Docker (uvarc/inkscape:1.0), remote converter, ImageMagick convert
AI / EPS / PDF uploadsInkscape, Docker (uvarc/inkscape:1.0)
HEIC uploadsPHP Imagick extension, heif-convert, ImageMagick (magick, then convert), tifig
AVIF uploadsPHP GD, PHP Imagick extension

If no tool works for PNG previews, the module keeps the SVG preview.

PDF Download ​

To be able to download PDF files directly from the backoffice, you need to install inkscape 1.0 or newer on your server.

The reason for requiring inkscape 1.0 or newer, is that it's the only version of inkscape that supports SVG embedded fonts.

Inkscape installation ​

To install inkscape, you need access to a terminal to allow you to execute the following commands.

shell
sudo apt update
sudo apt install inkscape

Then check the inkscape version like this

shell
inkscape --version
# The version should be something like this:
# Inkscape 1.0.1 (3bc2e813f5, 2020-09-07)

Please ask your hosting service or webmaster for assistance regarding the installation of inkscape on the server.

Using docker ​

If you can't install inkscape 1.0 on your system, try using it from a docker container.

The module will pull these images in the background:

  • linuxserver/inkscape for the PDF download
  • uvarc/inkscape:1.0 for PNG previews and AI / EPS / PDF uploads

The command that the module will execute for the PDF download is roughly:

shell
docker run -i -v /var/www/html/designer:/var/www/html/designer linuxserver/inkscape /usr/bin/inkscape "/var/www/html/designer/designer/output/18-design18/0-side0/design-18-0.svg" --export-type=pdf
# /var/www/html/designer being the PrestaShop root dir in this case

You can pull the images in advance to avoid a slow first download:

shell
docker pull linuxserver/inkscape
docker pull uvarc/inkscape:1.0

If you get a permission error, try adding the www-data user to the docker group.

shell
sudo usermod -aG docker www-data

Using Chrome / Chromium ​

The Chrome PDF and Chrome PNG downloads use a headless Chromium or Google Chrome to convert the SVG files. The module looks for these binaries, in this order: chromium, chromium-browser, google-chrome.

shell
sudo apt update
sudo apt install chromium

If no browser is found, the Chrome PDF download falls back to the remote converter.

CMYK PDF ​

The CMYK PDF download first creates the PDF (see above), then converts it to CMYK with Ghostscript.

shell
sudo apt install ghostscript
gs --version

Using the remote converter (Paid API) ​

You can use my online converter to convert the SVG files to PDF or PNG. It's used only when the local tools fail. The CMYK PDF download still needs Ghostscript on your server.

Here are the steps to follow:

1- Make a subscription to the API by following this payment link: 💳 API Subscription

2- Add this line to the file config/defines.inc.php

php
define('_DSN_API_URL_', 'https://converter.prestalife.net/');

TIP

Make sure to insert this line after the <?php tag