# Rendering svg file into a jpg format

**URL:** <https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161>\
**Category:** Ruby\
**Created:** [August 12, 2010, 10:09am UTC](https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161 "2010-08-12T10:09:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [August 12, 2010, 10:09am UTC](https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161/1 "2010-08-12T10:09:20Z")

</div>

Dear Friends,

I need to prepare some some logo’s, i have inputs like svg images and  
text. I need to read the same and write into a jpg file.

I have an svg image with 600 X 400 size, and a text called “Company Log”

I need to generate a jpg image of size 300X200, which reads the svg  
image resize it to 100 X 50 and write this into jpg image. Also i need  
to add the text “company logo” in jpg file.

How i should proceed?

I have used rmagick like,

```
granite = Magick::ImageList.new('one.svg')
canvas = Magick::ImageList.new
canvas.new_image(300, 200,

```

Magick::TextureFill.new(granite.resize(100,50)))  
text = Magick::Draw.new  
text.font\_family = ‘arial’  
text.pointsize = 24  
text.annotate(canvas, 1,1,1,180, Text) {  
self.fill = ‘darkblue’  
}  
canvas.write(‘logo.jpg’)  
exit

when using the above code, granite image is displayed thrice as i have  
resized it to small and also as texture it is filled throughout the  
image. I want display it only once at the right side and at the left  
side i need the text.

Could anyone plz suggest on abouve issue

Regards  
Jose Marin

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [August 17, 2010, 2:25am UTC](https://www.ruby-forum.com/t/rendering-svg-file-into-a-jpg-format/193161/2 "2010-08-17T02:25:07Z")

</div>

> Could anyone plz suggest on abouve issue

There’s also the mini\_magick gem, a wrapper to the “convert” command.  
-r
