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.SetDataSource(ds.Tables[0]);

                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");
                report.Dispose();


//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);
                        fs.Close();

Open in new window

Tech_MenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
0
Shahan AyyubSenior Software EngineerCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.