Frequently Asked Question:
Stamp with an other pdf file
Question
Is it possible to stamp a PDF with an other one? (like pdftk sotware with the stamp parameter - http://www.pdflabs.com/docs/pdftk-man-page/#dest-op-stamp)
Answer
You can use the CapturePage and DrawCapturedPage functions to overlay a PDF file onto another.
Here is a small code snippet that uses CapturePage() and then draws it to an new PDF using the scaleFactor variable.
pageWidth = QP.PageWidth();
pageHeight = QP.PageHeight();
horizBorder = pageWidth * (1.0 - scaleFactor) / 2;
vertBorder = pageHeight * (1.0 - scaleFactor) / 2;
// This deletes the page from the document.
capturedPageId = QP.CapturePage(1);
pageId = QP.NewPage();
QP.SetPageDimensions(pageWidth, pageHeight);
ret = QP.DrawCapturedPage(capturedPageId, horizBorder, vertBorder, pageWidth - 2 *
horizBorder, pageHeight - 2 * vertBorder);
QP.SavePage("newfile.pdf");