Q: Can you tell me if PDFTron has a method that allows the embedding
of a single page PDF as a watermark onto/behind another PDF? I can see
that raster image formats are handled, but could not figure out if PDF
was managed in the same way.
A: You can use ElementBuilder.CreateForm(src_page, new_doc) to create
a Form XObject from a source PDF page (src_page) in the destination
Before placing the form on the new page (i.e. writer.WritePlacedElement
(element)) you can set the transformation matrix (element.GetGState
().SetTransform(mtx)) that is used to control positioning, scaling,
and rotation of the form on the destination page.
This technique is illustrated in Imposition sample project (http://
www.pdftron.com/net/samplecode.html#Imposition) where multiple pages
from the source document are placed on a single page in a target PDF.
You can control whether the page/form/watermark is placed in front or
behind existing PDF content by specifying the second parameter in the
call to writer.Begin(page, is_background)