Append a Document

Append a Document

Forum member · Mar 15, 2010
I may have missed this somewhere but I am tired of looking. I have Document that was created using a DPLX template. Currently I am saving the file to the local hard drive and then merging a couple of other PDF files into one. I would prefer not to hav eto write to the disk to do this. is thi an easy way to covert the Document to a PDFDocument or some other method I am missing to accomplish waht I need. Here i wht I have that works but I am looking to optimize. Document document; DocumentLayout report = new DocumentLayout("DPLXs\\table.dplx"); document = report.Run(); report.Draw("GeneratedForms.pdf"); MergeDocument mDoc = new MergeDocument("pdf\\coverpage.pdf"); mDoc.Append("GeneratedForms.pdf");

Re: Append a Document

Support · Mar 15, 2010
Hello, Yes, you can merge the generated PDF document without saving it to disk without any problem using our DynamicPDF product. You will have to draw the generated PDF document in the form of byte array and then use this byte data in the PdfDocument constructor to create the PdfDocument object and then pass the PdfDocument object in the constructor of the MergeDocument. Below is the sample code for it: Document document; DocumentLayout report = new DocumentLayout("DPLXs\\table.dplx"); document = report.Run(); byte[] byteData=document.Draw(); PdfDocument pdfdocument = new PdfDocument(byteData, ""); MergeDocument mDoc = new MergeDocument("pdf\\coverpage.pdf"); mDoc.Append(pdfdocument); Thanks, ceTe Software Support Team