# Embedding PNGs in PDFs

**URL:** <https://www.ruby-forum.com/t/embedding-pngs-in-pdfs/108780>\
**Category:** Ruby\
**Created:** [July 6, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/embedding-pngs-in-pdfs/108780 "2007-07-06T22:42:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f475e1/32.png) [@ralph](https://www.ruby-forum.com/u/ralph)\
**Post date:** [July 6, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/embedding-pngs-in-pdfs/108780/1 "2007-07-06T22:42:47Z")

</div>

Hello,

is there a Ruby library for embedding PNGs and other images in existing  
PDF files?

## I’ve found Haru ([http://libharu.sourceforge.net/](http://libharu.sourceforge.net/)) which seems to be supported on many platforms, but I’d prefer to go with plain Ruby.

Greetings  
Ralph

---

<div class="post-metadata">

**Author:** ![ralph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f475e1/32.png) [@ralph](https://www.ruby-forum.com/u/ralph)\
**Post date:** [July 7, 2007, 3:48pm UTC](https://www.ruby-forum.com/t/embedding-pngs-in-pdfs/108780/2 "2007-07-07T15:48:44Z")

</div>

> is there a Ruby library for embedding PNGs and other images in existing  
> PDF files?

Yes, PDF Writer supports this:  
[http://ruby-pdf.rubyforge.org/pdf-writer/doc/classes/PDF/Writer/Graphics.html#M000153](http://ruby-pdf.rubyforge.org/pdf-writer/doc/classes/PDF/Writer/Graphics.html#M000153)

Project homepage:  
[http://ruby-pdf.rubyforge.org/pdf-writer/releases.html](http://ruby-pdf.rubyforge.org/pdf-writer/releases.html)

---

<div class="post-metadata">

**Author:** ![ralph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f475e1/32.png) [@ralph](https://www.ruby-forum.com/u/ralph)\
**Post date:** [July 7, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/embedding-pngs-in-pdfs/108780/3 "2007-07-07T16:55:43Z")

</div>

Uma G. wrote:

> Yes, PDF Writer supports this:  
> [http://ruby-pdf.rubyforge.org/pdf-writer/doc/classes/PDF/Writer/Graphics.html#M000153](http://ruby-pdf.rubyforge.org/pdf-writer/doc/classes/PDF/Writer/Graphics.html#M000153)
> 
> Project homepage:  
> [http://ruby-pdf.rubyforge.org/pdf-writer/releases.html](http://ruby-pdf.rubyforge.org/pdf-writer/releases.html)

Does PDF Writer actually support manipulating existing PDFs? If I recall  
correctly, it can only generate new ones.
