Esempio n. 1
0
        private void btnAddWatermark2_Click(object sender, EventArgs e)
        {
            string tmpFile = DestinationFile;

            stopWatch.Reset();
            stopWatch.Start();
            Watermark.manipulatePdf(txtFilePath.Text, tmpFile, txtWatermark2.Text);
            stopWatch.Stop();
            lblITextSharpFirstPage.Text = "Milliseconds: " + stopWatch.Elapsed.Milliseconds;
            DialogResult dr = MessageBox.Show(MsgText, MsgCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                Process.Start(tmpFile);
            }
        }
Esempio n. 2
0
        private void btnAddWatermark_Click(object sender, EventArgs e)
        {
            iTextSharp.text.pdf.BaseFont bf = iTextSharp.text.pdf.BaseFont.CreateFont(iTextSharp.text.pdf.BaseFont.HELVETICA, iTextSharp.text.pdf.BaseFont.CP1252, false);

            stopWatch.Reset();
            stopWatch.Start();
            byte[] retValue = Watermark.AddWatermark(SourceFile, bf, txtWatermark.Text);
            stopWatch.Stop();
            lblITextSharpAllPages.Text = "Milliseconds: " + stopWatch.Elapsed.Milliseconds;
            string tmpFile = DestinationFile;

            File.WriteAllBytes(tmpFile, retValue);

            DialogResult dr = MessageBox.Show(MsgText, MsgCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                Process.Start(tmpFile);
            }
        }