# Viewer for PDF images

**URL:** https://discourse.julialang.org/t/viewer-for-pdf-images/95668
**Category:** General Usage
**Tags:** question, images, cairomakie-plotting
**Created:** [March 7, 2023, 1:47pm UTC](https://discourse.julialang.org/t/viewer-for-pdf-images/95668 "2023-03-07T13:47:43Z")
**Posts on this page:** 1
**Showing post:** 35

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [March 12, 2023, 4:47pm UTC](https://discourse.julialang.org/t/viewer-for-pdf-images/95668/35 "2023-03-12T16:47:32Z")

</div>

I’ve made a prototype work (without error checking or resource freeing) and with that one can freely plot existing PDFs into CairoMakie `Figures`. Whoever is motivated could turn that easily into a small CairoMakie extension package:

> <https://gist.github.com/jkrumbiegel/e6b998e1a0660dd550ce436beee67f2d>

The usage part looks like this:

```julia
f = lines(cumsum(randn(100)), color = :red; figure = (resolution = (400, 300)))
CairoMakie.save("f1.pdf", f)
f = lines(cumsum(randn(100)), color = :blue; figure = (resolution = (400, 300)))
CairoMakie.save("f2.pdf", f)

##

f = Figure(resolution = (600, 800))
pdf!(f.scene, path = "f1.pdf", bbox = (BBox(0, 600, 400, 800)))
pdf!(f.scene, path = "f2.pdf", bbox = (BBox(0, 600, 0, 400)))
CairoMakie.save("f1_f2.pdf")

```

And the end result:

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/8/1/81f7ff91fae304038c5c5aefd075b2d82e1f94ce.png)

---

_[View the full topic](https://discourse.julialang.org/t/viewer-for-pdf-images/95668)._
