I've tried to add some Vectorgraphics to a PDF document via PDF::API2. I
Took an eps, converted it via epstopdf to PDF an attached it with
elsif ( $s->imgtype eq "pdf" )
{
my $llx;
my $lly;
my $urx;
my $ury;
my $src = PDF::API2->open($s->filename);
my $srcpage = $src->openpage(1);
($llx, $lly, $urx, $ury) = $srcpage->get_mediabox();
my $dw = $urx - $llx;
my $scale=( $s->rectangleSize->width / $dw );
my $xo = $src->importPageIntoForm($src,1);
print STDERR "\n" . $s->filename . ":";
print STDERR "($llx, $lly, $urx, $ury) $scale\n";
$gfx->formimage($xo,$x,$y-$s->rectangleSize->height,$scale);
#$gfx->formimage($xo,0,0,1);
}
In addition to that I attached the same way a bitmap.
The result did work in KPDF but not in Adobe Reader 7.0 on Linux.