Rendering svg file into a jpg format

D

dare ruby

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top