3 Answers, 1 is accepted
Thank you for contacting us.
No, the current WinForms PDF API is only used to export grid data to PDF files. With the upcoming Q1 2013 we are going to release a new RadPdfViewer control for WinForms, which however will only be able to display PDF files.
To merge PDF files, you need a library that can edit PDFs. Such library is the open source PdfSharp project. Here is a sample that demonstrates how you can merge two PDF files using this library: http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=34&Itemid=45.
I hope you find it useful. Do not hesitate to ask if you have any additional questions.
All the best,
Ivan Todorov
the Telerik team
public static class PDF_Utilities
{
/// <SUMMARY>
/// Imports all pages from a list of documents.
/// </SUMMARY>
public static void MergeFiles(List<string> filepaths, string outputFilePath, bool viewNow)
{
// Open the output document
PdfDocument pdfDocument = new PdfDocument();
// Iterate files
foreach (string filepath in filepaths)
{
// Open the document to import pages from it.
PdfDocument inputDocument = PdfReader.Open(filepath, PdfDocumentOpenMode.Import);
// Iterate pages
int pageCount = inputDocument.PageCount;
for (int index = 0; index < pageCount; index++)
{
// Get the page from the external document...
PdfPage page = inputDocument.Pages[index];
// ...and add it to the output document.
pdfDocument.AddPage(page);
}
}
// Save the document...
pdfDocument.Save(outputFilePath);
// ...and start a viewer.
if (viewNow)
Process.Start(outputFilePath);
}
}