Eps image (from inkscape) does not appear in tcpdf

Using php and TCPDF to create a pdf file. Everything works fine, except when I try to write an EPS image in pdf using ImageEPS(). I can not see anything. No errors (he can definitely find the file). It just displays as a space.

Bitmap images (like PNG / JPG) work very well.

I use Inkscape to save the .eps file. When I open a file in any other program, it opens just fine. Its the only TCPDF with which it does not appear.

+5
source share
3 answers

*.ai Adobe Illustrator " 3", . , ( "Illustrator 8", *.ai B & W.)

+3

, .

PDF PDF TCPDF/FPDI :

$num_pages = $pdf->setSourceFile(path_to_file);  
$template_id = $pdf->importPage(1); //if the grafic is on page 1
$pdf->useTemplate($template_id,$x,$y,$width,$height);
+2

ImageEPS TCPDF (6.0.004) , :

/**
 * Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files.
 * NOTE: EPS is not yet fully implemented, use the 
 * setRasterizeVectorImages() method to enable/disable rasterization of 
 * vector images using ImageMagick library.
 * ...
 */
public function ImageEps(...){/*...*/}

TCPDF (6.0.004) eps . Adobe Illustrator, , 8, . , Adobe Illustrator, , . , TCPDF PS, , , , AI . PostScript :

  • , script. PostScript , . , , PostScript.

, .

Inkscape (0.48.3.1 r9886) epses cairo, , . TCPDF eps, , , , . .

I had more success exporting my eps to svg with inkscape -D --file = filename.eps --export-plain-svg = filename.svg and using ImageSVG. Note: this function is also not fully implemented, so I can not guarantee that it will work. I tested pretty simple eps.

0
source

All Articles