I am not experienced with iTextSharp
and have this need:
I have generated 2 PDFs:
a small PDF (ie size A6) of one page containing 1 background image and some text in various format (paragraph, chunks, etc), some barcode some rectancles... But nothing more (no forms etc). The pdf is generated to a memory stream.
a bigger one (ie size A3). I want to "copy" or embed the little pdf to the bigger in a fixed position.
How can I merge them? All examples I found use PDFReader
, but I am not able to use it on a memory stream and I dont' like to save intermediate PDF to disk.
You essentially want to stamp a page from one document somewhere onto the bigger page of another one.
This is a task for a PdfStamper
.
PdfReader readerA
PdfReader readerB
PdfStamper stamperB
for readerB
readerA
using stamperB.GetImportedPage
stamperB.OverContent.AddTemplate
; this method allows to supply positioning coordinates stamperB
, then the readers
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.