# Pdf writer issue with text and image

**URL:** <https://www.ruby-forum.com/t/pdf-writer-issue-with-text-and-image/146235>\
**Category:** Rails\
**Created:** [August 19, 2008, 10:15am UTC](https://www.ruby-forum.com/t/pdf-writer-issue-with-text-and-image/146235 "2008-08-19T10:15:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [August 19, 2008, 10:15am UTC](https://www.ruby-forum.com/t/pdf-writer-issue-with-text-and-image/146235/1 "2008-08-19T10:15:43Z")

</div>

Hello friends  
Just wanted to know that how we can print text and image on same line,  
let  
say for eg

pdf = PDF::Writer.new  
pdf.text = “hi this is testing”  
pdf.image = “some image path”

so this will print

hi this is testing

# AND ON NEXT LINE IT WILL PRINT AN IMAGE

so friend please help me i want text and image shld be print on same  
line.

thanks and regards  
Abhishek…

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [August 19, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/pdf-writer-issue-with-text-and-image/146235/2 "2008-08-19T12:40:37Z")

</div>

Abhishek shukla wrote:

> Hello friends  
> Just wanted to know that how we can print text and image on same line,  
> let  
> say for eg
> 
> pdf = PDF::Writer.new  
> pdf.text = “hi this is testing”  
> pdf.image = “some image path”
> 
> so this will print
> 
> hi this is testing
> 
> # AND ON NEXT LINE IT WILL PRINT AN IMAGE
> 
> so friend please help me i want text and image shld be print on same  
> line.
> 
> thanks and regards  
> Abhishek…

With this code I am able to print the two images alone side by side.

```
  pdf = PDF::Writer.new
  pdf.start_columns 2,2
  pdf.image "header.jpg"
  pdf.start_new_page
  pdf.image "header.jpg"
  pdf.stop_columns
```
