We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Merging pdfs and docs together

I have several Word and Pdf documents I would like to merge together. My idea was to load the Word document into WordDocument and convert into Pdfs via the DocToPdfConverter class, then use PdfDocument.Merge to assemble the pdfs together.

This does not work since the Merge method expects PdfLoadedDocument instead of PdfDocument.

What is the best way to accomplish this?

3 Replies

PH Praveenkumar H Syncfusion Team June 17, 2013 04:11 AM UTC

Hi Alexander,

Thank you for using Syncfusion product,

We have attached sample program to create merged pdf document from several Word Document.

Please let us know if you have any concern.

With Regards,
Praveen


Doc to pdf with merge_6f691489.zip


AB Abigail August 14, 2013 09:24 AM UTC

Here is the demo code to merge pdf:
namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName1 = FolderName + "Sample1.pdf";
string fileName2 = FolderName + "Sample2.pdf";
string fileNameMerged = FolderName + "Merged.pdf";

REDocument doc1 = REFile.OpenDocumentFile(fileName1, new PDFDecoder());//use PDFDecoder open one pdf file

REDocument doc2 = REFile.OpenDocumentFile(fileName2, new PDFDecoder());//use PDFDecoder open another pdf file

BaseDocument docMerged = doc1.MergeDocument(doc2);//merge two pdf

REFile.SaveDocumentFile((REDocument)docMerged, fileNameMerged, new PDFEncoder());//save new pdf



PH Praveenkumar H Syncfusion Team August 20, 2013 04:27 AM UTC

Hi Abigail,

Thank you for your update.

With Regards,
Praveen



Loader.
Live Chat Icon For mobile
Up arrow icon