I am trying to grab 2 PDF files that are currently on my website, combine them into one PDF file that I can save.
I am finding a lot of examples on how to open an HTML page, but these are already PDF files
thanks for your help
I am trying to grab 2 PDF files that are currently on my website, combine them into one PDF file that I can save.
I am finding a lot of examples on how to open an HTML page, but these are already PDF files
thanks for your help
Hi there,
Thanks for your inquiry. I am afraid Document() object support loading PDF file from file system or streams. So you need to download pdf files from url to file system or stream and concatenate the PDF files. Please find a sample code snippet for the purpose. Hopefully it will help you to accomplish the task.
System.Net.WebClient
wc = new System.Net.WebClient();<o:p></o:p>
// Open document
Document pdfDocument1 = new Document(new MemoryStream(wc.DownloadData("http://www.test.com/samples/Sample1.PDF")));
Document pdfDocument2 = new Document(new MemoryStream(wc.DownloadData("http://www.test.com/samples/Sample2.PDF")));
pdfDocument1.Pages.Add(pdfDocument2.Pages);
pdfDocument1.Save("test.pdf");
wc.Dispose();
Please feel free to contact us for any further assistance.
Best Regards,
thank you that worked.
one more question, how do you display the combined document in the browser
fsafadi:one more question, how do you display the combined document in the browser