コード例 #1
0
        public static int GeneratePDF(Upsilab.Data.Model.CustomerProspect pCustomer, Upsilab.Data.Model.FirmInstitution pFirmInstitution, string pathFileName, bool forceDownload = true) //Guid idCustomer paramétre à mettre en place ???
        {
            float y = 100;
            int height = 20;
            int width = 500;
            int interligne = 20;
            int paddingLeft = 50;
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            #region Page 1

            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_001"), y += 100, width, height);
            string[] rowContents = { string.Format(LanguageContentBL.Translate("PdfRapportMission_002"), DateTime.Now.ToShortDateString()), 
                                       string.Format("{0} EC-{1}", LanguageContentBL.Translate("PdfFirm_082"),pCustomer.idCustomer) };
            pdfGen.AddTableTitle(rowContents, 110, y += 80);

            #endregion

            #region Page 2

            pdfGen.CreatePage();
            y = 0;
            Dictionary<int, List<string>> data = new Dictionary<int, List<string>>();
            for (int j = 0; j < 7; j++)
            {
                data.Add(j, new List<string>());
            }
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_002"));
            data[0].Add(pFirmInstitution.FirmInstitutionName);

            data[1].Add(LanguageContentBL.Translate("PdfEngagement_003"));
            data[1].Add(pFirmInstitution.ShareCapital);

            data[2].Add(LanguageContentBL.Translate("PdfEngagement_004"));
            data[2].Add(pFirmInstitution.RegisteredInRegister);

            data[3].Add(LanguageContentBL.Translate("PdfEngagement_005"));
            data[3].Add(pFirmInstitution.RCS);

            data[4].Add(LanguageContentBL.Translate("PdfEngagement_006"));
            data[4].Add(string.Format("{0}\n{1}\n{2}", pFirmInstitution.FirmStreet, pFirmInstitution.FirmPostCode, pFirmInstitution.FirmCity));
            data[5].Add(LanguageContentBL.Translate("PdfEngagement_007"));
            data[5].Add(string.Format("{0} {1}", pFirmInstitution.LeaderFirstName, pFirmInstitution.LeaderName));

            data[6].Add(LanguageContentBL.Translate("PdfEngagement_008"));
            data[6].Add(pFirmInstitution.LeaderFonction);

            pdfGen.AddReceuil_SubTitle_Left_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_009"), y, width, height, paddingLeft);

            pdfGen.GeneratePinkTable(data, 0, y += interligne * 2, width, 240, 11, false);

            pdfGen.AddReceuil_SubTitle_Left_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_010"), y += 260, width, height, paddingLeft);

            pdfGen.AddReceuil_SubTitle_Right_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_011"), y += interligne * 2, width, height);

            pdfGen.AddReceuil_SubTitle_Left_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_012"), y += interligne * 2, width, height, paddingLeft);

            var lstRowHeight = new List<float>();
            data = new Dictionary<int, List<string>>();
            for (int j = 0; j < 5; j++)
            {
                data.Add(j, new List<string>());
            }

            data[0].Add(LanguageContentBL.Translate("PdfEngagement_013"));
            data[0].Add(pCustomer.User.EntireName);
            lstRowHeight.Add(30);

            data[1].Add(LanguageContentBL.Translate("PdfEngagement_014"));
            data[1].Add(pCustomer.DateOfBirth.HasValue ? pCustomer.DateOfBirth.Value.ToShortDateString() : string.Empty);
            lstRowHeight.Add(30);

            data[2].Add(LanguageContentBL.Translate("PdfEngagement_015"));
            data[2].Add(pCustomer.PlaceOfBirth);
            lstRowHeight.Add(30);

            data[3].Add(LanguageContentBL.Translate("PdfEngagement_016"));
            data[3].Add(pCustomer.Nationality);
            lstRowHeight.Add(30);

            data[4].Add(LanguageContentBL.Translate("PdfEngagement_017"));
          //  data[4].Add(pCustomer.Adress);
            // fix issue 9509
            var str = string.Empty;
            var hg = 30;
            if (!string.IsNullOrEmpty(pCustomer.Adress) && !string.IsNullOrEmpty(pCustomer.ZipCode) &&
                !string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}\n{1}\n{2}", pCustomer.Adress, pCustomer.ZipCode, pCustomer.City);
                hg = 60;
            }
            else if(!string.IsNullOrEmpty(pCustomer.Adress) && !string.IsNullOrEmpty(pCustomer.ZipCode) &&
                string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}\n{1}", pCustomer.Adress, pCustomer.ZipCode);
                hg = 45;
            }
            else if (string.IsNullOrEmpty(pCustomer.Adress) && !string.IsNullOrEmpty(pCustomer.ZipCode) &&
   ! string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}\n{1}", pCustomer.ZipCode, pCustomer.City);
                hg = 45;
            }
            else if (!string.IsNullOrEmpty(pCustomer.Adress) && string.IsNullOrEmpty(pCustomer.ZipCode) &&
!string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}\n{1}", pCustomer.Adress, pCustomer.City);
                hg = 45;
            }
            else if (!string.IsNullOrEmpty(pCustomer.Adress) && string.IsNullOrEmpty(pCustomer.ZipCode) &&
                     string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}", pCustomer.Adress);
                hg = 30;
            }
            else if (string.IsNullOrEmpty(pCustomer.Adress) && !string.IsNullOrEmpty(pCustomer.ZipCode) &&
         string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}", pCustomer.ZipCode);
                hg = 30;
            }
            else if (string.IsNullOrEmpty(pCustomer.Adress) && string.IsNullOrEmpty(pCustomer.ZipCode) &&
!string.IsNullOrEmpty(pCustomer.City))
            {
                str = string.Format("{0}", pCustomer.City);
                hg = 30;
            }
            data[4].Add(str);
            lstRowHeight.Add(hg);

           // pdfGen.GeneratePinkTable(data, 0, y += interligne * 2, width, 150, 11, false);
            pdfGen.GeneratePinkTableWithRowHeight(data, 0, y += interligne * 2, width, 150, 11, false, lstRowHeight);

            pdfGen.AddReceuil_SubTitle_Left_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_018"), y += 200, width, height, paddingLeft);

            pdfGen.AddReceuil_SubTitle_Right_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_019"), y += interligne * 2, width, height);

            pdfGen.AddReceuil_SubTitle_Left_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_020"), y += interligne * 2, width, height, paddingLeft);


            #endregion

            #region Page 3

            pdfGen.CreatePage();
            y = 0;
            pdfGen.GenerateStyledTitle(LanguageContentBL.Translate("PdfEngagement_021"), y, 100, 300, 40, 16);
            pdfGen.GenerateSommaireAnalytique(0, y = +interligne * 4, width, 400, 12,
                new List<string>() {LanguageContentBL.Translate("PdfEngagement_095"),LanguageContentBL.Translate("PdfEngagement_096"),LanguageContentBL.Translate("PdfEngagement_097"),LanguageContentBL.Translate("PdfEngagement_098")
                    ,LanguageContentBL.Translate("PdfEngagement_099"),LanguageContentBL.Translate("PdfEngagement_100"),LanguageContentBL.Translate("PdfEngagement_101"),LanguageContentBL.Translate("PdfEngagement_102")
                    ,LanguageContentBL.Translate("PdfEngagement_103"),LanguageContentBL.Translate("PdfEngagement_104"),LanguageContentBL.Translate("PdfEngagement_105"),LanguageContentBL.Translate("PdfEngagement_106")
                    ,LanguageContentBL.Translate("PdfEngagement_107"),LanguageContentBL.Translate("PdfEngagement_108") ,LanguageContentBL.Translate("PdfEngagement_109"),LanguageContentBL.Translate("PdfEngagement_110")
                    ,LanguageContentBL.Translate("PdfEngagement_111") ,LanguageContentBL.Translate("PdfEngagement_112")
                });

            #endregion

            #region Page 4

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_022"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_023"), y += interligne, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_024"), y += interligne * 2, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_025"), y += interligne * 2, width - 50, height * 4, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_026"), y += interligne * 3, width - 50, height * 4, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_027"), y += interligne * 4, width - 50, height * 3, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_028"), y += interligne * 3, width - 50, height * 4, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_029"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_030"), y += interligne * 1.5f, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_031"), y += interligne, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_032"), y += (interligne * 2), width - 50, height * 5, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_033"), y += (interligne * 4), width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_034"), y += (interligne * 2), width - 50, height * 2, paddingLeft);



            #endregion

            #region Page 5

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_035"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_036"), y += interligne * 1.5f, width - 50, height * 5, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_037"), y += interligne * 3, width - 50, height * 3, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_038"), y += interligne * 3, width - 50, height * 4, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_039"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_040"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_041"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_042"), y += interligne * 2, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_043"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_044"), y += interligne * 2, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_045"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_046"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_047"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_048"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_049"), y += interligne * 1.5f, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_050"), y += interligne, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_051"), y += interligne, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_052"), y += interligne * 1.5f, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_053"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);


            #endregion

            #region Page 6

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_054"), y, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_055"), y += interligne, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_056"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_057"), y += interligne * 2.5f, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_058"), y += interligne, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_059"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_060"), y += interligne * 1.5f, width - 50, height * 4, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_061"), y += interligne * 3.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_062"), y += interligne * 2.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_063"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft + 15);
            pdfGen.AddPinkNotesRectangle(y += interligne * 1.5f, paddingLeft + 15, width - 65, 45);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(!string.IsNullOrEmpty(pFirmInstitution.claimsName) ? pFirmInstitution.claimsName : "", y += 5, width - 65, 40, paddingLeft + 15);
           // string customerAdress = string.Format("{0}\n{1}\n{2}", pCustomer.Adress, pCustomer.ZipCode, pCustomer.City);
            string firmAdress = string.Format("{0}\n{1}\n{2}", pFirmInstitution.FirmStreet, pFirmInstitution.FirmPostCode, pFirmInstitution.FirmCity);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(!string.IsNullOrEmpty(firmAdress) ? firmAdress : "", y += 5, width - 65, 45, paddingLeft + 20);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_064"), y += (interligne * 2) + 5, width - 50, height * 2, paddingLeft + 15);
            pdfGen.AddPinkNotesRectangle(y += interligne * 1.5f, paddingLeft + 15, width - 65, 40);
            //  pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(!string.IsNullOrEmpty(pFirmInstitution.claimsMail) ? pFirmInstitution.claimsMail : "", y += 5, width - 65, 40, paddingLeft + 15);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(!string.IsNullOrEmpty(pCustomer.User.UserEmail) ? pCustomer.User.UserEmail : "", y += 5, width - 65, 40, paddingLeft + 15);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(!string.IsNullOrEmpty(pFirmInstitution.E_mail) ? pFirmInstitution.E_mail : "", y += 5, width - 65, 40, paddingLeft + 20);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_065"), y += interligne * 2.5f, width - 50, height * 3, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_066"), y += interligne * 2.5f, width - 50, height * 3, paddingLeft);

            // 
            #endregion

            #region Page 7
            // 
            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_067"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_068"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_069"), y += interligne * 2, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_070"), y += interligne * 2, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_071"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_072"), y += interligne * 1.5f, width - 50, height * 3, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_073"), y += interligne * 2.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_074"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_075"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_076"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_077"), y += interligne * 2.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_078"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_079"), y += interligne * 2f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_080"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_081"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_082"), y += interligne * 1.5f, width - 50, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_083"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);


            #endregion

            #region Page 8

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_084"), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_085"), y += interligne * 1.5f, width - 50, height * 2, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfEngagement_086"), y += interligne * 2, width, height);

            data = new Dictionary<int, List<string>>();
            data.Add(0, new List<string>());
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_087")); // fait à 
            data[0].Add(" ");

            pdfGen.GeneratePinkTable(data, 0, y += interligne * 2, width, 30, 11, false);

            data = new Dictionary<int, List<string>>();
            data.Add(0, new List<string>());
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_088"));//en
            data[0].Add(" ");
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_089"));

            pdfGen.GeneratePinkTable3cols(data, 0, y += interligne * 3, width, 30, 11, false);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_090"), y += interligne * 2.5f, width - 50, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfEngagement_091"), y, width - 50, height * 2, paddingLeft * 5);

            data = new Dictionary<int, List<string>>();
            data.Add(0, new List<string>());
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_092"));
            data[0].Add((pCustomer.ConfidentialityAgreement != null && pCustomer.ConfidentialityAgreement.User != null) ? pCustomer.ConfidentialityAgreement.User.EntireName : pCustomer.User1.EntireName);

            data.Add(1, new List<string>());
            data[1].Add(LanguageContentBL.Translate("PdfEngagement_093"));
            data[1].Add(" ");

            data.Add(2, new List<string>());
            data[2].Add(LanguageContentBL.Translate("PdfEngagement_094"));
            data[2].Add(DateTime.Now.ToShortDateString());

            pdfGen.GeneratePinkTable2(data, 0, y += interligne * 1.5f, 230, 100, 11, false);

            data = new Dictionary<int, List<string>>();
            data.Add(0, new List<string>());
            data[0].Add(LanguageContentBL.Translate("PdfEngagement_092"));
            data[0].Add(pCustomer.User.EntireName);

            data.Add(1, new List<string>());
            data[1].Add(LanguageContentBL.Translate("PdfEngagement_093"));
            data[1].Add("");

            data.Add(2, new List<string>());
            data[2].Add(LanguageContentBL.Translate("PdfEngagement_094"));
            data[2].Add(DateTime.Now.ToShortDateString());

            pdfGen.GeneratePinkTable2(data, paddingLeft * 5, y, 230, 100, 11, false);

            float x = 18;
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 6, x, 200, 120);

            if (forceDownload)
            {
                //Ces textes sont automatiques pour la signature en ligne //
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), y + 5, 200, 20, x + 5);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), y + 20, 145, 20, x + 5);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), y + 35, 145, 20, x + 5);
            }

            x = (paddingLeft * 5) + 13;
            pdfGen.AddRecueil_Notes_Rectangle(y, x, 200, 120);

            if (forceDownload)
            {
                //Ces textes sont automatiques pour la signature en ligne
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), y + 5, 200, 20, x + 5);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), y + 20, 145, 20, x + 5);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), y + 35, 145, 20, x + 5);
            }

            #endregion

            if (forceDownload)
            {
                pdfGen.GeneratePdfToWeb("EngagementConfidentialiteSignature.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
            return pdfGen.PageCount;

        }
        public static void GeneratePM_EngagementLetter(Upsilab.Data.Model.MissionDocument pMissionDoc, string pathFileName, bool forceDownload)
        {
            float y = 260;
            int height = 20;
            int width = 500;
            int interligne = 15;
            int paddingLeft = 50;
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            #region page 1
            FirmInstitution firmInstitution = pMissionDoc.CustomerProspect.FirmInstitution;
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_001"), y, width, 100);
            pdfGen.AddReceuil_SubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_134"), y += 100, width, height);

            string[] rowContents = { string.Format(LanguageContentBL.Translate("PdfRapportMission_002"), DateTime.Now.ToShortDateString()) //Date de maj ou Date de création
                                     , string.Format("{0} LM-{1}",LanguageContentBL.Translate("PdfFirm_082"),pMissionDoc.idMissionDocument)
                                     , string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName)
                                   };
            pdfGen.LM_AddTableTitle(rowContents, 90, y += 80);

            //pdfGen.AddRecueil_Notes_Rectangle(y += 100, 105, 375, 30);
            //pdfGen.AddReceuil_DetailText_Justify_Calibri_Label(string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName), y + 5, 300, 20, 120);
            #endregion

            #region page 2

            Data.Model.CustomerProspect cust = pMissionDoc.CustomerProspect;
            Data.Model.User userAdviser = (pMissionDoc.User != null) ? pMissionDoc.User : pMissionDoc.CustomerProspect.User1;

            var data = Upsilab.Business.CustomerProspect.CustomerProspectOptionBL.GetOptionValueListWithIdCustomerProspectAndIdParentOptionPlus(cust.idCustomer,
               Upsilab.Business.CustomerProspect.CustomerProspectBL.EngagementLetterParentQuestionId);
            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_003"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_004"), cust.CompanyName), y += interligne * 1.5f, width, height);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format("Prénom : {0}", "XXX"), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_006"), cust.Adress), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_007"), cust.ZipCode), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_008"), cust.City), y += interligne, width, height);

            FirmInstitution firm = cust.FirmInstitution;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_009"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_010"), firm.FirmInstitutionName), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_011"), userAdviser.UserName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_012"), userAdviser.UserFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_013"), firm.LeaderName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_014"), firm.LeaderFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_015"), firm.FirmStreet), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_016"), firm.FirmPostCode), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_017"), firm.FirmCity), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_018"), firm.RCS), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_019"), firm.RegisteredInRegister), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_020"), firm.AgregateurNoms), y += interligne, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_021"), y += interligne * 2, width, height, paddingLeft);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_022"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_023"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_024"), y += interligne * 3f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_025"), y += interligne * 2.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_026"), y += interligne * 2.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_027"), y += interligne * 1.5f, width, height * 3);


            #endregion

            #region page 3

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_028"), y, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(138, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_029"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(139, data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_030"), y - 5, width, height * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(140, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_031"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(141, data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_032"), y - 5, width, height * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(142, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_033"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(143, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_034"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(144, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_035"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(145, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_036"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(146, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_037"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(147, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_038"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(148, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_039"), y, width, 20, 15);
            //PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(149, data), y += interligne, 0, "1");
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label("Réception / transmission d’ordres", y, width, 20, 15);
            //PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(150, data), y += interligne, 0, "1");
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label("Suivi annuel de patrimoine et produits financiers externes", y, width, 20, 15);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_040"), y += interligne, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(128, 96, data), y + 5, width, height, 5);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_040"), y += interligne * 1.5f, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(128, 97, data), y + 5, width, height, 5);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_040"), y += interligne * 1.5f, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(128, 98, data), y + 5, width, height, 5);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_041"), y += interligne * 2, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_042"), y += interligne * 1.5f, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_031", data), y += interligne * 1.5f + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_043"), y - 5, width, 40, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_032", data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_045"), y, width, 20, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_033", data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_054"), y - 5, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_034", data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_055"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_035", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_135"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_036", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_136"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_037", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_137"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_038", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_138"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_039", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_139"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_040", data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_140"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_041", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_141"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_042", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_142"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Letter_PM_043", data), y += interligne);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_143"), y, width, 20, 15);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_040"), y += interligne, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 20);
            if (!cust.IsCorporation.Value)//PP
                pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(151, 59, data), y + 5, width, height, 5);
            else
                pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue("Client_Letter_PM_044", data), y + 5, width, height, 5);

            #endregion

            #region page 4

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_056"), y, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(166, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_057"), y - 5, width, 20 * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(167, data), y += interligne * 3f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_058"), y - 15, width, 20 * 3, 15);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_059"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_060"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(168, 100, data), y + 5, width, 125, 5);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_062"), y += interligne * 9f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);//Notes
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(169, 101, data), y + 5, width, 125, 5);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_063"), y += interligne * 9f, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(172, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_064"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(173, data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_065"), y - 5, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(174, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_066"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(175, data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_067"), y - 5, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(176, data), y += (interligne * 1.5f) + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_068"), y - 5, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(177, data), y += (interligne * 1.5f) + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_069"), y - 5, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(178, data), y += (interligne * 1.5f) + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_070"), y - 5, width, 40, 15);

            #endregion

            #region page 5
            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_040"), y, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(170, 102, data), y + 5, width, height, 5);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_061"), y += interligne * 1.5f, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(170, 103, data), y + 5, width, 125, 5);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_071"), y += interligne * 9f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(171, 104, data), y + 5, width, 125, 5);

            #endregion

            #region page 6

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_072"), y, width, height);//Le mode de facturation et de rémunération
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_073"), y += interligne, width, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_074"), y += interligne, width, 20 * 3);

            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 3, 0, 30, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(131, 105, data), y + 5, 50, 20, 5);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label("X", y + 8, 20, 20, 40);
            pdfGen.AddRecueil_Notes_Rectangle(y, 60, 30, 20);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(131, 106, data), y + 5, 50, 30, 65);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_075"), y + 8, width, height, 110);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_076"), y += interligne * 3, width, height * 2);
            // pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label("Au titre de l’accompagnement du client, une information plus précise sera fournie ultérieurement sur simple demande une fois connus les supports choisis par le client.", y += interligne * 3, width, height * 2, 15);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriItalic_Label(LanguageContentBL.Translate("PdfLM_077"), y += interligne * 3, width, height * 2, 15);


            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_078"), y += interligne * 3, width, height);//Les honoraires

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(181, data), y += (interligne * 1.5f) + 10, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_079")
                , CustomerProspectOptionBL.GetProspectAttributeValue(181, 115, data)
                , CustomerProspectOptionBL.GetProspectAttributeValue(181, 116, data)
                , CustomerProspectOptionBL.GetProspectAttributeValue(181, 117, data))
                , y - 10, width, height * 4, 20);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 3f, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(182, data), y += (interligne * 1.5f) + 10, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_081")
                , CustomerProspectOptionBL.GetProspectAttributeValue(182, 118, data)), y - 10, width, height * 3, 20);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 2.5f, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(183, data), y += (interligne * 1.5f) + 20, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_082")
                , CustomerProspectOptionBL.GetProspectAttributeValue(183, 119, data)), y - 20, width, height * 5, 20);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_083")
                , CustomerProspectOptionBL.GetProspectAttributeValue(133, 120, data)), y += interligne * 4, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_084")
               , CustomerProspectOptionBL.GetProspectAttributeValue(133, 121, data)), y += interligne * 2, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_085"), y += interligne * 2f, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_086"), y += interligne, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(184, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_087"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(185, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_088"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(186, data), y += interligne + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_089"), y - 5, width, height * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(187, data), y += interligne + 10 + 5, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_090"), y - 5, width, height * 2, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(188, data), y += interligne + 10, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_091"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(189, data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_092"), y, width, height, 15);



            #endregion

            #region page 7

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_093"), y, width, height);//La durée et le calendrier de la mission

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_094")
            , CustomerProspectOptionBL.GetProspectAttributeValue(135, 122, data)), y += interligne * 1.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_095")
            , CustomerProspectOptionBL.GetProspectAttributeValue(135, 123, data)), y += interligne * 2f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_096"), y += interligne * 3, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_097")
            , CustomerProspectOptionBL.GetProspectAttributeValue(136, 124, data)), y += interligne * 1.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_098"), y += interligne * 3, width, height);//Typologie de client

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_099"), y += interligne * 1.5f, width, height * 4);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_100"), y += interligne * 4, width, height);//Déroulement de la mission
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_101"), y += interligne * 2f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_102"), y += interligne * 2.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_103"), y += interligne * 2f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_104"), y += interligne * 2.5f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_105"), y += interligne * 4f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_106"), y += interligne * 3.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_107"), y += interligne * 3f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_108"), y += interligne * 2f, width, height * 2);


            #endregion

            #region page 8

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_109"), y, width, height);//Suivi patrimonial envisagé
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_110"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_111"), y += interligne * 2f, width, height * 3);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_112"), y += interligne * 4, width, height);//Modalités d’information
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_113"), y += interligne * 1.5f, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_114"), y += interligne * 2.5f, width, height);//Dénonciation de la mission
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_115"), y += interligne * 1.5f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_116"), y += interligne * 4f, width, height * 4);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_117"), y += interligne * 4f, width, height * 3);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_118"), y += interligne * 3.5f, width, height);//Responsabilité
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_119"), y += interligne * 1.5f, width, height * 4);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_120"), y += interligne * 4.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_121"), y += interligne * 3f, width, height);//Confidentialité
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_122"), y += interligne * 1.5f, width, height * 2);




            #endregion

            #region page 9

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_123"), y, width, height);//Litiges
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_124"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_125"), y += interligne * 3f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_126"), y += interligne * 3f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_127"), y += interligne * 4f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_128"), y += interligne * 3f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_129"), y += interligne * 3, width, height);//Traitement des informations
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_130"), y += interligne * 1.5f, width, height * 5);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_131"), y += interligne * 5f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_132"), y += interligne * 4f, width, height * 4);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfLM_133"), y += interligne * 4.5f, width, height * 4);



            #endregion

            #region page 10

            pdfGen.CreatePage();
            y = 0;
            //Signature
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature"), 0);

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature_Etabs"), 100, 500, 20, 80);


            pdfGen.AddRecueil_Notes_Rectangle(130, 35, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 40);
            }

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature_Client"), 100, 500, 20, 340);
            pdfGen.AddRecueil_Notes_Rectangle(130, 280, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 285);
            }

            #endregion

            //Force download if pathFileName is not set
            if (forceDownload)
            {
                pdfGen.GeneratePdfToWeb("LettreMission_PM.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
        }
        public static void Generate_MissionReport(Upsilab.Data.Model.MissionDocument pMissionDoc, string pathFileName, bool forceDownload)
        {
            float y = 260;
            int height = 20;
            int width = 500;
            int interligne = 15;
            // int paddingLeft = 50;
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            #region page 1

            FirmInstitution firmInstitution = pMissionDoc.CustomerProspect.FirmInstitution;
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportMission_001"), y, width, 100);

            string clientName = string.Empty;
            if (pMissionDoc.CustomerProspect.IsCorporation.HasValue && pMissionDoc.CustomerProspect.IsCorporation.Value)
                clientName = string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName);
            else
                clientName = string.Format("{0} {1}", pMissionDoc.CustomerProspect.User.UserName, pMissionDoc.CustomerProspect.User.UserFirstName);

            //Title
            string[] rowContents = { string.Format(LanguageContentBL.Translate("PdfRapportMission_002"), DateTime.Now.ToShortDateString()) //Date de maj ou Date de création??
                                     , string.Format(LanguageContentBL.Translate("PdfRapportMission_003"),pMissionDoc.idMissionDocument)
                                     , clientName
                                   };

            pdfGen.LM_AddTableTitle(rowContents, 90, y += 80);

            //pdfGen.AddRecueil_Notes_Rectangle(y += 100, 105, 375, 30);
            //if (pMissionDoc.CustomerProspect.IsCorporation.HasValue && pMissionDoc.CustomerProspect.IsCorporation.Value)
            //    pdfGen.AddReceuil_DetailText_Justify_Calibri_Label(string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName), y + 5, 300, 20, 120);
            //else
            //    pdfGen.AddReceuil_DetailText_Justify_Calibri_Label(string.Format("{0} {1}", pMissionDoc.CustomerProspect.User.UserFirstName, pMissionDoc.CustomerProspect.User.UserName), y + 5, 300, 20, 120);


            #endregion

            #region page 2

            Data.Model.CustomerProspect cust = pMissionDoc.CustomerProspect;
            Data.Model.User userAdviser = (pMissionDoc.User != null) ? pMissionDoc.User : pMissionDoc.CustomerProspect.User1;

            var data = Upsilab.Business.CustomerProspect.CustomerProspectOptionBL.GetOptionValueListWithIdCustomerProspectAndIdParentOptionPlus(cust.idCustomer,
            Upsilab.Business.CustomerProspect.CustomerProspectBL.MissionParentQuestionId);

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfMissionClient"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionNom"), (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? cust.CompanyName : cust.User.UserName), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionPrenom"), (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? LanguageContentBL.Translate("PdfMission") : cust.User.UserFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionAdresse"), cust.Adress), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionCP"), cust.ZipCode), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionVille"), cust.City), y += interligne, width, height);

            FirmInstitution firm = cust.FirmInstitution;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfMissionConseiller"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionNomEtabs"), firm.FirmInstitutionName), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionNomCons"), userAdviser.UserName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionPrenomCons"), userAdviser.UserFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionNomDir"), firm.LeaderName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionPrenomDir"), firm.LeaderFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionAdrssSiege"), firm.FirmStreet), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionCP"), firm.FirmPostCode), y += interligne, width, height);//CP
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionVille"), firm.FirmCity), y += interligne, width, height);//Ville
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionRCS"), firm.RCS), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionRegistre"), firm.RegisteredInRegister), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfMissionAgregateur"), ""), y += interligne, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfMmeMsieur"), y += interligne * 2f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_004"), y += interligne * 2f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_005"), y += interligne * 3f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_006"), y += interligne * 4f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_007"), y += interligne * 1.5f, width, height * 2);



            #endregion

            #region page 3

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_ChapterSubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportmission_008"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_009"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_010"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue("Client_Mission_008", data), y + 5 * 1.5f, width, height, 5);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_011"), y += interligne * 3f, width, height);

            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 1.5f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 126, data), y + 2 * 1.5f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 127, data), y + 2 * 1.5f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 128, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 129, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 130, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 131, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 132, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 133, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 134, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne * 2.6f, 0, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(192, 135, data), y + 2 * 2.6f, width, height, 5);

            #endregion

            #region page 4

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_ChapterSubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportmission_012"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_013"), y += interligne * 1.5f, width, height * 3);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_012", data), y += interligne * 3, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_014"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_013", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_015"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_014", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_016"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_015", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_017"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_016", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_018"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_017", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_019"), y, width, height, 15);
            // PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_018", data), y += interligne, 0, "1"); --> pas de checkbox sur le formulaire
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_020"), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue("Client_Mission_018", data), y, 480, height * 2, 40);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne * 2, 500, 20);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue("Client_Mission_019", data), y + 5, 480, 125, 10);

            pdfGen.AddReceuil_ChapterSubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportmission_021"), y += interligne * 9f, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_020", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_022"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_021", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_023"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_022", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_024"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_023", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_025"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_024", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_026"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_025", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_027"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_026", data), y += interligne, 0, "1");
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_028"), y, width, height, 15);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne * 2, 500, 20);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 125);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(194, 139, data), y + 5, 480, 125, 10);

            #endregion

            #region page 5

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_ChapterSubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportmission_029"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne * 2, 500, 20);
            pdfGen.AddRecueil_Notes_Rectangle(y += interligne, 0, width, 600);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(CustomerProspectOptionBL.GetProspectAttributeValue(195, 140, data), y + 5, 480, 600, 10);

            #endregion

            #region page 6

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddReceuil_ChapterSubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRapportmission_030"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_031"), y += interligne * 2, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_032"), y += interligne, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_033"), y += interligne * 2, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_034"), y += interligne * 2, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRapportmission_035"), y += interligne * 2, width, height * 2);

            #endregion

            #region page 7

            pdfGen.CreatePage();
            y = 0;
            //Signature
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(@"Signatures", 0);

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(@"Signature de l'Etablissement", 100, 500, 20, 80);


            pdfGen.AddRecueil_Notes_Rectangle(130, 35, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"J'ai lu et j'accepte les conditions générales.", 135, 200, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"Lu et approuvé.", 145, 145, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"Date:", 160, 145, 20, 40);
            }

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(@"Signature du Client", 100, 500, 20, 340);
            pdfGen.AddRecueil_Notes_Rectangle(130, 280, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"J'ai lu et j'accepte les conditions générales.", 135, 200, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"Lu et approuvé.", 145, 145, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(@"Date:", 160, 145, 20, 285);
            }

            #endregion

            //Force download if pathFileName is not set
            if (forceDownload)
            {
                pdfGen.GeneratePdfToWeb("RapportDeMission.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
        }
        public static void GenerateRTO(Upsilab.Data.Model.MissionDocument pMissionDoc, string pathFileName, bool forceDownload)
        {
            float y = 250;
            int height = 20;
            int width = 500;
            int interligne = 15;
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            #region page 1
            FirmInstitution firmInstitution = pMissionDoc.CustomerProspect.FirmInstitution;
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRTO_001"), y, width, height + 5);
            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRTO_002"), y += interligne, width, height + 5);
            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfRTO_003"), y += interligne, width, height + 5);

            string[] rowContents = { string.Format(LanguageContentBL.Translate("PdfRapportMission_002"), DateTime.Now.ToShortDateString()), //Date de maj ou Date de création
                                       string.Format("{0} RTO-{1}",LanguageContentBL.Translate("PdfFirm_082"),pMissionDoc.idMissionDocument) };
            pdfGen.LM_AddTableTitle(rowContents, 80, y += 90);

            #endregion

            #region page 2

            Data.Model.CustomerProspect cust = pMissionDoc.CustomerProspect;
            Data.Model.User userAdviser = (pMissionDoc.User != null) ? pMissionDoc.User : pMissionDoc.CustomerProspect.User1;

            var data = Upsilab.Business.CustomerProspect.CustomerProspectOptionBL.GetOptionValueListWithIdCustomerProspectAndIdParentOptionPlus(cust.idCustomer,
               Upsilab.Business.CustomerProspect.CustomerProspectBL.EngagementLetterParentQuestionId);
            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_003"), y, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_004"), (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? cust.CompanyName : string.Format("{0} {1}", cust.FirstName, cust.Name)), y += interligne * 1.5f, width, height);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format("Prénom : {0}", "XXX"), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_006"), cust.Adress), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_007"), cust.ZipCode), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_008"), cust.City), y += interligne, width, height);

            FirmInstitution firm = cust.FirmInstitution;
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfLM_009"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_010"), firm.FirmInstitutionName), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_011"), userAdviser.UserName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_012"), userAdviser.UserFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_013"), firm.LeaderName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_014"), firm.LeaderFirstName), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_015"), firm.FirmStreet), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_016"), firm.FirmPostCode), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_017"), firm.FirmCity), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_018"), firm.RCS), y += interligne, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(string.Format(LanguageContentBL.Translate("PdfLM_019"), firm.RegisteredInRegister), y += interligne, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_004"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_005"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_006"), y += interligne * 2.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_007"), y += interligne * 1.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_008"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_009"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_010"), y += interligne * 2.5f, width, height * 5);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_011"), y += interligne * 5.5f, width, height * 6);


            #endregion

            #region page 3

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_012"), y, width, height * 5);
            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_013"), y += interligne * 6, width, height);

            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_014"), y += interligne * 1.5f, width, height * 4);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_015"), y += interligne * 4.5f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_016"), y += interligne * 4, width, height * 7);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_017"), y += interligne * 6, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_018"), y += interligne * 1.5f, width, height * 3);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_019"), y += interligne * 3.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_020"), y += interligne * 1.5f, width, height * 3);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_021"), y += interligne * 4, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_022"), y += interligne * 1.5f, width, height * 3);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_023"), y += interligne * 3.5f, width, height * 2);

            pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(LanguageContentBL.Translate("PdfRTO_024"), y += interligne * 3, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_025"), y += interligne * 1.5f, width, height);
            pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(LanguageContentBL.Translate("PdfRTO_026"), y += interligne * 1.5f, width, height);

            #endregion

            #region page 4

            pdfGen.CreatePage();
            y = 0;
            //Signature
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature"), 0);

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature_Etabs"), 100, 500, 20, 80);


            pdfGen.AddRecueil_Notes_Rectangle(130, 35, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 40);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 40);
            }

            pdfGen.AddReceuil_DetailText_Justify_CalibriBoldItalic_Label(LanguageContentBL.Translate("Pdf_Signature_Client"), 100, 500, 20, 340);
            pdfGen.AddRecueil_Notes_Rectangle(130, 280, 200, 120);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 285);
                pdfGen.AddReceuil_DetailText_Left_Arial_Label(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 285);
            }

            #endregion

            //Force download if pathFileName is not set
            if (forceDownload)
            {
                pdfGen.GeneratePdfToWeb("RTO.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
        }