mpdf / mpdf

PHP library generating PDF files from UTF-8 encoded HTML

Home Page:https://mpdf.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adobe Illustrator and printing machine won't read spot colors

Widziks92 opened this issue · comments

Guidelines

Description of the bug

Hello,
I tried to use spot color add function in code:
$mpdf->AddSpotColor('Thru-cut', 10, 10, 10, 10);

I see that in pdf is added this spot color, but any program cannot se it.
For example Adobe Illustrator should discover that spot colors in Swatches.

I know that's not a problem that mpdf export pdf as pdf 1.4 instead 1.7. And That's not a problem that pdf does not included xmpTPg tags. I had pdf 1.7 from Corel and when I converted it to pdf 1.4 by some online converter it still works (Illustrator discover that swatches and it worked without xmpTPg tags).

mPDF version

8.1.4

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

PHP 8.2.8,

Reproducible PHP+CSS+HTML snippet suffering by the error

$mpdfSettings = $this->mpdfSettings;
/*
protected array $mpdfSettings = [
'mode' => 'utf-8',
'margin_left' => 0,
'margin_right' => 0,
'margin_top' => 0,
'margin_bottom' => 0,
'margin_header' => 0,
'margin_footer' => 0,
];
*/

$mpdfSettings['format'] = [280, 180];

$mpdf = new Mpdf($mpdfSettings);

$mpdf->AddSpotColor('Thru-cut', 10, 10, 10, 10);

$mpdf = $this->setPrintOptions($mpdf);

try {
//avodid -> The HTML code size is larger than pcre.backtrack_limit 1000000.
ini_set("pcre.backtrack_limit", "5000000");
$this->generate($mpdf, $html, $request->fileName);
} catch (\Exception $e) {
abort(500, "Fail");
}

The code example is not exactly reproducible by itself, is it?

Anyway, are you actually using the spot color in the document apart from adding it? When I add the color and use it, I see it in swatches in Illustrator.

See Example 55 which works. https://github.com/mpdf/mpdf-examples/blob/master/example55_new_mPDF_v5-1_color_and_other_features.php

I found this example today and It's fine. That's I closed this issue.

I just need to add fill="spot(SPOT_COLOR_NAME, 100%) to svg ant it's fine