[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 613
  • Last Modified:

combine 2 pdf files to 1 file to print in duplex

hi there i have this code  that create the pdf file :

then i have the second pdf that need to append to the first pdf by this code :

when i open the pdf file i can only 1 page the combine not working


                report.SetParameterValue("@CustName", CustName);
                report.SetParameterValue("@CustOrderNum", CustOrderNum);
                report.SetParameterValue("@Quant", Quant);
                report.SetParameterValue("@OrderNum", OrderNum);

                //report.PrintOptions.PrinterDuplex = CrystalDecisions.Shared.PrinterDuplex.Vertical;
                //report.PrintToPrinter(0, false, 0, 0);
                report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "c:\\temp.pdf");

//The Second Pdf That need to Append to the first file

  DataSet ds1 = new DataSet();
                        ds1 = AgaTekensClass.AgaTekensMange.GetSketshDs(MktId);

                        Byte[] byteBLOBData;
                        byteBLOBData = null;

                        byteBLOBData = (Byte[])(ds1.Tables[0].Rows[0]["ProSketch"]);

                        FileStream fs = new FileStream("c:\\temp.pdf", FileMode.Append);
                        fs.Write(byteBLOBData, 0, byteBLOBData.Length);

Open in new window

1 Solution
Jens FiedererTest Developer/ValidatorCommented:
You can't append two .pdf files and still get a valid .pdf file.
.PDF files are not like text files that way - try it in the file system with two small .PDF files, and just concatenate the two - what you get will be a corrupted file.

Perhaps you can make a more complex report with two sections, and make a single .PDF from that?
Shahan AyyubSenior Software Engineer - iOSCommented:

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now