1

I'm using c# and Cairo to create a pdf file.I want to make a multiple page pdf and I can't find any samples.I only found this one : http://lists.cairographics.org/archives/cairo/2008-September/014949.html

any help or suggestion will be highly appreciated.

Mina N
  • 231
  • 3
  • 8
  • 17

4 Answers4

7

Just came to this question. It turns out that the setting the "onefile" argument to TRUE in cairo_pdf will solve this issues.

Example:

cairo_pdf("my.super.plot.pdf",onefile=T)
plot(c(1,1))
plot(c(2,2))
dev.off()

Note: I am using Cairo 1.5.6

Eric Paquet
  • 81
  • 1
  • 3
1

I do not use C#, but there is a function in C cairo_show_page() which does exactly you want. I think there is a similar method in C#.

https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-show-page

0

can't believe it was too easy just changing context.showpage() to context.copypage()

Mina N
  • 231
  • 3
  • 8
  • 17
0

Simply calling showpage multiple times seems to do the trick for me.

IanJ
  • 467
  • 7
  • 15