try
{
PDStream src = page.getContents();
PDStream dest = new PDStream( new COSStream( src.getStream(), document.getScratchFile() ) );
importedPage.setContents( dest );
os = dest.createOutputStream();
byte[] buf = new byte[10240];
int amountRead = 0;
is = src.createInputStream();
while((amountRead = is.read(buf,0,10240)) > -1)