//public frm_Click2Mail()
 //        {
 //      }
 public frm_Click2Mail(XmlDocument xml, string file, mode m, string username, string pw, SetupStationaryFields caller)
 {
     frm = caller;
     // This call is required by the designer.
     InitializeComponent();
     if (m == mode.live) {
     _url = _Lmainurl;
     } else {
     _url = _Smainurl;
     }
     _authinfo = username + ":" + pw;
     _XMLDOC = xml;
     _file = file;
     // Add any initialization after the InitializeComponent() call.
 }
Пример #2
0
        public static void Merge(string file, string OutFile, ref SetupStationaryFields.addresscollection aic)
        {
            using (FileStream stream = new FileStream(OutFile, FileMode.Create))
            {
                using (Document doc = new Document())
                {
                    using (PdfCopy pdf = new PdfCopy(doc, stream))
                    {
                        doc.Open();

                        PdfReader reader = null;
                        PdfImportedPage page = null;

                        //fixed typo
                        int ii = 0;
                        int count = 0;

                        foreach (SetupStationaryFields.addressitem ai in aic)
                        {

                            if ((!ai.ommitted))
                            {

                                reader = new PdfReader(file);
                                PdfReader.unethicalreading = true;
                                count = reader.NumberOfPages;
                                for (int i = 0; i <= reader.NumberOfPages - 1; i++)
                                {
                                    page = pdf.GetImportedPage(reader, i + 1);
                                    pdf.AddPage(page);
                                }

                                pdf.FreeReader(reader);
                                reader.Close();

                                ai.startpage = ((ii) * count) + 1;
                                ai.endpage = (ii * count) + count;
                                ii = ii + 1;

                            }
                        }
                    }
                }
                stream.Close();
            }
        }
        //public frm_Click2Mail()
//        {

        //      }

        public frm_Click2Mail(XmlDocument xml, string file, mode m, string username, string pw, SetupStationaryFields caller)
        {
            frm = caller;
            // This call is required by the designer.
            InitializeComponent();
            if (m == mode.live)
            {
                _url = _Lmainurl;
            }
            else
            {
                _url = _Smainurl;
            }
            _authinfo = username + ":" + pw;
            _XMLDOC   = xml;
            _file     = file;
            // Add any initialization after the InitializeComponent() call.
        }