Merge Capabilities |
The HTML to PDF Converter provides you with the possibility to append a PDF file or a list of PDF files to the conversion result. This possibility is available with the AppendPDFFile and AppendPDFFIleArray properties from PdfDocumentOptions class. The properties must be set before calling the PDF render method. There also available similar properties to append PDF streams instead of files.
The prototypes of these properties are:
For more details please take a look a the WinForms_PrependAppendExternalPdfs sample application from our product archive. Sample code from the application:
PdfConverter pdfConverter = new PdfConverter(); // existing documents appended after the converted page: a file, and a document from memory pdfConverter.PdfDocumentOptions.AppendPDFFile = "terms-and-conditions.pdf"; byte[] attachmentBytes = File.ReadAllBytes("price-list.pdf"); pdfConverter.PdfDocumentOptions.AppendPDFStreamArray = new Stream[] { new MemoryStream(attachmentBytes) }; // and a cover page placed before it pdfConverter.PdfDocumentOptions.PrependPDFFile = "cover.pdf"; pdfConverter.SavePdfFromUrlToFile("https://www.example.com/offer", "offer.pdf");