unrblt / phpsvg

Automatically exported from code.google.com/p/phpsvg
0 stars 0 forks source link

Merging SVG failes on TCPDF created Datamatrix codes #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open merge.svg.php from the examples
2. replace image.svg path with the one attached
3. run the php stript

What is the expected output? What do you see instead?
I expected to have the code.svg seamlessly merged with the other SVG. 
But instead I get the errors:

Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: Element name 
is required in /www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 156

Warning: XmlElement::append() [xmlelement.append]: Node no longer exists in 
/www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 158

Warning: XmlElement::append() [xmlelement.append]: Node no longer exists in 
/www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 170

Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: Element name 
is required in /www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 156

Warning: XmlElement::append() [xmlelement.append]: Node no longer exists in 
/www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 158

Warning: XmlElement::append() [xmlelement.append]: Node no longer exists in 
/www/htdocs/XXX/test/phpsvg/svglib/xmlelement.php on line 170

What version of the product are you using? On what operating system?
PHPSVG 0.8

Please provide any additional information below.
The code.svg was created with TCPDF Datamatrix Module. It might be that the 
TCPDF Datamatrix exporter does not a good job of creating all the necessary 
attributes. In this case the author of phpSVG should point to the missing 
atributes of the code.svg XML that are needed (if they really are).

Original issue reported on code.google.com by indyaner...@gmail.com on 29 Apr 2015 at 2:06

Attachments:

GoogleCodeExporter commented 9 years ago
Turns out, I hav'nt taken my medicine and there is nothing wrong with phpSVG.

The problem was that phpSVG tried to merge two parts to the existing SVG that 
could not be found:

$svg->addShape( $code->path );
$svg->addShape( $code->image );

The code.svg does not have a "path" and "image" section. Only a "g" part.
Therefore this works:

$svg->addShape( $code->g );

Sorry.

/closed

Original comment by indyaner...@gmail.com on 29 Apr 2015 at 2:13