示例#1
0
        protected NameValueCollection GetPostData()
        {
            var data = new NameValueCollection();

            data[Parameters.GlobalPostbackType] = GlobalPostbackType.ToString();
            data[Parameters.OfferId]            = OfferId.ToString();
            data[Parameters.OfferName]          = OfferName;
            data[Parameters.IpAddress]          = Ip;
            data[Parameters.CountryCode]        = CountryCode;
            data[Parameters.SubId]        = SubId;
            data[Parameters.Payout]       = Payout.ToClearString();
            data[Parameters.CurrencyCode] = CurrencyCode;

            if (Age != -1)
            {
                data[Parameters.Age] = Age.ToString();
            }

            data[Parameters.Gender] = Gender.ToString();
            if (!string.IsNullOrEmpty(SubId2))
            {
                data[Parameters.SubId2] = SubId2;
            }
            if (!string.IsNullOrEmpty(SubId3))
            {
                data[Parameters.SubId3] = SubId3;
            }

            return(data);
        }
示例#2
0
        public void Customize(IHtmlToPdfOptions options)
        {
            options.FooterHeaderReplace.Add("languageId", OffersLanguageHelpers.getCurrentUIlanguageID().ToString());
            options.FooterHeaderReplace.Add("languageCode", LanguageId);
            options.FooterHeaderReplace.Add("offerId", OfferId.ToString());

            // you may customize HTML to PDF converter (WKHTML) parameters here, e.g.
            //options.MarginLeft = "2cm";
            //options.MarginRight = "1cm";
            //options.MarginTop = "1cm";
            //options.MarginBottom = "1cm";
            var uriForProtocol = new Uri(options.Url.ToString()).GetLeftPart(UriPartial.Authority);

            options.CustomArgs.Add("--header-html");
            options.CustomArgs.Add(uriForProtocol + "/Offers/Offers/Header");
            options.CustomArgs.Add("--footer-html");
            options.CustomArgs.Add(uriForProtocol + "/Offers/Offers/Footer");

            // options.CustomArgs.Add("--disable-smart-shrinking");
        }