Home Cannot create a multiple polygon in tcpdf
Reply: 1

Cannot create a multiple polygon in tcpdf

Sairam Duggi
1#
Sairam Duggi Published in 2018-01-13 05:37:21Z

I am using tcpdf to create a pdf using php and mysql, i have successfully created one polygon using below code but when am trying to create the second polygon it is unable to create and the previous polygon also disappears

How to create the multiple polygons?

First Polygon

$pdf->StarPolygon(94, 110, 39, 90, 3, 0, 1, 'CNZ');
$pdf->SetLineStyle( array( 'width' => 1, 'color' => array(145,191,56)));
$pdf->Image('@'.$imgdata1, 50, 70, 90, 90, '', '', 'C', false, 300, '', false, false, 0, false, false, false);
$pdf->StopTransform();

Second Polygon

$pdf->StarPolygon(147, 58, 29, 90, 3, 0, 1, 'CNZ');
$pdf->SetLineStyle( array( 'width' => 1, 'color' => array(145,191,56)));
$pdf->Image('@'.$imgdata2, 25, 130, 70, 60, '', '', 'R', false, 300, '', false, false, 0, false, false, false);
$pdf->StopTransform();
Iwan
2#
Iwan Reply to 2018-01-13 07:08:36Z

You should add StartTransform before code for second polygon:

// Secodn polygon
$pdf->StartTransform();
$pdf->StarPolygon(147, 58, 29, 90, 3, 0, 1, 'CNZ');
$pdf->SetLineStyle( array( 'width' => 1, 'color' => array(145,191,56)));
$pdf->Image('@'.$imgdata2, 25, 130, 70, 60, '', '', 'R', false, 300, '', false, false, 0, false, false, false);
$pdf->StopTransform();
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.329471 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO