예제 #1
0
        private void btnGoto_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbPage.Text))
            {
                return;
            }
            int pageIndex = Int32.Parse(tbPage.Text);

            MoonPDF_DLL.MoonGotoPage(pageIndex);
        }
예제 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MoonPDF_DLL.InitMoonPDFEnvironment();
            int ret = MoonPDF_DLL.WindowCompentInit(pdfPanel.Handle);

            if (ret == -1)
            {
                MessageBox.Show("初始化PDF失败");
                return;
            }
        }
예제 #3
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog file = new OpenFileDialog();

            file.Filter = "pdf files(*.pdf)|*.pdf|All files(*.*)|*.*";
            file.ShowDialog();
            string text = file.FileName;

            MoonPDF_DLL.MoonPDFLoad(new StringBuilder(text));
            //重绘界面
            MoonPDF_DLL.MoonResizePDF(pdfPanel.Width, pdfPanel.Height);
        }
예제 #4
0
        private void pdfSplitThread()
        {
            string text  = splitFilePath;
            int    count = MoonPDF_DLL.MoonToolsGetPDFPageCount(new StringBuilder(text));
            //计算性能
            DateTime startTime = DateTime.Now;

            for (int i = 0; i < count; i++)
            {
                //获取路径
                StringBuilder sbPath = new StringBuilder();
                sbPath.Append(text.Substring(0, text.LastIndexOf('\\')));
                sbPath.Append("\\");
                sbPath.Append(i + 1);
                sbPath.Append(".pdf");
                MoonPDF_DLL.MoonToolsExtractPageToSave(new StringBuilder(text), sbPath, i + 1);
            }
            DateTime endTime = DateTime.Now;

            var tim = endTime - startTime;

            MessageBox.Show("总共花费:" + tim.TotalSeconds + "秒");
        }
예제 #5
0
 private void btnNSZXZ_Click(object sender, EventArgs e)
 {
     MoonPDF_DLL.MoonContrarotate();
 }
예제 #6
0
 private void btnSSZXX_Click(object sender, EventArgs e)
 {
     MoonPDF_DLL.MoonClockwiseRotation();
 }
예제 #7
0
 private void btnZoomOut_Click(object sender, EventArgs e)
 {
     MoonPDF_DLL.MoonZoomOut();
 }
예제 #8
0
 private void pdfPanel_Paint(object sender, PaintEventArgs e)
 {
     MoonPDF_DLL.MoonPaintPDF();
 }
예제 #9
0
 //pdf显示窗口大小被重置
 private void pdfPanel_Resize(object sender, EventArgs e)
 {
     MoonPDF_DLL.MoonResizePDF(((Control)sender).Width, ((Control)sender).Height);
 }
예제 #10
0
        private void BtnGetAnnotCount_Click(object sender, EventArgs e)
        {
            int count = MoonPDF_DLL.MoonGetAnnotationCount();

            MessageBox.Show(count.ToString());
        }
예제 #11
0
 private void btnAddAnnot_Click(object sender, EventArgs e)
 {
     MoonPDF_DLL.MoonAddTextAnnotation(new StringBuilder("测试注释"), new StringBuilder("冷月"), 0, 300, 350, 500, 550);
 }