Hello
Im trying to convert a pdf file to a png and then place a svg image on top of the png.
The svg contains a white background which I would like it to be transparent when placing over the png. Can someone please help me accomplish this.
I know that (in php)
exec('convert /file/filepdf.pdf /file/filepng.png');
converts the file to a png and I tried adding the following command to it to make it overlay the svg but it doesnt seem to work
exec('convert /file/filepdf.pdf /file/filepng.png -composite /file/svgfile.svg'); hoping this will place the svg file above the converted png but no luck.
Any suggestions on how i can accomplish this?
Overlay a SVG image on top of a png image
Re: Overlay a SVG image on top of a png image
I would apply the svg and then change to png; something like:
Code: Select all
exec('convert /file/filepdf.pdf \( /file/svgfile.svg -fuzz 10% -transparent white \) -gravity center -composite /file/filepng.png ');
Re: Overlay a SVG image on top of a png image
Bonzo
This doesnt seem to work
I get the following error in my logs
convert: Memory allocation failed `/file/svgfile.svg' @ svg.c/ReadSVGImage/2825.
convert: missing an image filename `/file/filepng.png ' @ convert.c/ConvertImageCommand
This doesnt seem to work
I get the following error in my logs
convert: Memory allocation failed `/file/svgfile.svg' @ svg.c/ReadSVGImage/2825.
convert: missing an image filename `/file/filepng.png ' @ convert.c/ConvertImageCommand
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Overlay a SVG image on top of a png image
post links to your pdf and svg files so others can look at them and work with them