As Martin said, interactive parts of a PDF, called Annotations in PDF specification parlance, such as links or 3D objects, get lost when embedding a PDF containing them. Instead, Annotations have to be re-generated for the new PDF.
To embed a 3D object in the PRC format into a PDF, use LaTeX package media9. See media9 manual, section "3D quick-start guide".
In case the standalone PRC file is not available it can be extracted from the PDF. This can be done manually, as explained below, or automatically with the help of a small Perl script. Either method requires a tool for uncompressing PDFs, such as PDFtk.
Extracting the PRC from PDF is not recommended if the PRC was generated by asymptote and you have the asy source file of it!
Standalone PRC files are generated from asy source by
asy --keep --tex pdflatex mysource.asy
Automatically, using PDFtk + Perl script
This extracts all PRC streams from PDFwithPRC.pdf to separate files prc-0.prc, prc-1.prc, ...
pdftk PDFwithPRC.pdf output - uncompress | perl prcextract.pl
On Windows, with a Java runtime and some perl.exe installed:
java -jar pdftk-all.jar PDFwithPRC.pdf output - uncompress | perl prcextract.pl
Perl script prcextract.pl:
#!/usr/bin/perl
$prc=0;
$stream=0;
$cnt=0;
while(<>){
if(/^stream/) {$stream=1;}
elsif(/^endstream/) {$stream=0; if($prc){close $PRC;} $prc=0;}
elsif((/^PRC/ || $prc) && $stream) {
if(!$prc){open $PRC,">prc-".$cnt++.".prc";select $PRC} print; $prc=1;
}
}
Manual procedure, by PDFtk + text editor
First uncompress the PDF:
pdftk doc.pdf output doc.unc.pdf uncompress
Open doc.unc.pdf in a text editor and scroll down to a line that starts with PRC. This line appears just after a line with the PDF keyword stream.
Delete everything from begin of the file up to and including the line containing the stream keyword.
Delete everything beginning with the line starting with the endstream keyword directly after the PRC stream upto the end of the file.
Save what has left as a file whose name ends in .prc.
pdftexbecause AFAIK they only work reliable in the main PDF, not in an included PDF. The same is true for hyperlinks in included PDFs. I think there might be a way to have them, butpdftexdoesn't know how to handle included PDF annotations in general. See How to preserve hyperlinks in included pdf? which might work as duplicate. – Martin Scharrer Apr 15 '12 at 14:21pdfteximplementation is lacking in this respect. It is be a bit sad if, after generating my PDF with pdflatex, I have to include my 3D graphs using Acrobat Pro… – F'x Apr 15 '12 at 14:35comp.text.texas well, there it will be noticed by thepdftexgurus/developers, which might give you an authorized answer on this topic. – Martin Scharrer Apr 15 '12 at 14:38c.t.t… – F'x Apr 15 '12 at 14:46lualatexshould be able to keep the annotations in the included PDF http://tex.stackexchange.com/a/33915/1871. (I never succeeded myself to make it work.) – alfC May 23 '13 at 02:30