Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

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");

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum