I have this command that will convert SVG to image:
exec("convert -size 400x400 test.svg test.png", $out, $rcode);
But it works with fiels, when I actually need to work with DOM variables.
how to get the resulting PNG to $variable insted of file (in PHP) please.
The capturing and assigning result value from EXEC function to a variable is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher. Here I am making use of Microsoft’s Northwind Database. The download and install instructions are provided in the following article.
The resultset from an exec can be put into a table directly: declare @tmp_select char(500) set @tmp_select = 'select count(*) from dptest'. CREATE TABLE ResultSet (mycount int) INSERT INTO ResultSet. EXEC @tmp_select. To put it into a variable from there, you'd have to add another select.
SELECT @cmd = 'INSERT INTO #number SELECT COUNT (*) FROM CONTACT2 WHERE ' + @fldname + ' IS NOT NULL ' Execute dynamic SQL statement using sp_executesql system stored procedure, if you want a output to a variable. It allows input parameters as well as output parameters. I support sp_executesql approach.
The capturing and assigning result value from EXEC function to a variable is supported in SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012, 2014 or higher. Here I am making use of Microsoft’s Northwind Database.
This is probably what you are looking for:
<?php
$output = shell_exec("convert test.svg png:-");
echo $output;
Depending on your local setup you might have to specify the absolute path to your convert
utility. Also the path to the file to be converted must be resolvable, again an absolute path is a safe bet at first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With