예제 #1
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.button1 = new System.Windows.Forms.Button();
     this._pdf    = new C1.C1Pdf.C1PdfDocument();
     this.SuspendLayout();
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(8, 8);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(200, 40);
     this.button1.TabIndex = 0;
     this.button1.Text     = "Build Table";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // _pdf
     //
     this._pdf.FontType = C1.C1Pdf.FontTypeEnum.Embedded;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(216, 61);
     this.Controls.Add(this.button1);
     this.Name          = "Form1";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "C1Pdf: Character Table";
     this.ResumeLayout(false);
 }
예제 #2
0
        private void _btnCreate_Click(object sender, System.EventArgs e)
        {
            C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument(System.Drawing.Printing.PaperKind.A4);
            pdf.Compression                   = C1.C1Pdf.CompressionEnum.None;
            pdf.Security.UserPassword         = _txtUser.Text;
            pdf.Security.OwnerPassword        = _txtOwner.Text;
            pdf.Security.AllowPrint           = _chkAllowPrint.Checked;
            pdf.Security.AllowCopyContent     = _chkAllowCopy.Checked;
            pdf.Security.AllowEditAnnotations = _chkAllowEditAnnot.Checked;
            pdf.Security.AllowEditContent     = _chkAllowEditContent.Checked;

            RectangleF rc = pdf.PageRectangle;

            rc.Inflate(-72, -72);
            pdf.DrawRectangle(Pens.Black, rc, new SizeF(72, 72));
            rc.Inflate(-72, -72);

            Font   font = new Font("Tahoma", 12);
            string text = string.Format("Owner password is '{0}'\r\nUser password is '{1}'", _txtOwner.Text, _txtUser.Text);

            pdf.DrawString(text, font, Brushes.Black, rc);

            string fileName = Path.GetDirectoryName(Application.ExecutablePath) + @"\security.pdf";

            pdf.Save(fileName);
            Process.Start(fileName);
        }
예제 #3
0
        bool ExportDocument()
        {
            // get pdf file name
            using (SaveFileDialog dlg = new SaveFileDialog())
            {
                dlg.Filter = "Portable Document File (*.pdf)|*.pdf";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    // create preview document
                    PrintDocument          doc  = Editor.PrintDocument;
                    PrintController        pc   = doc.PrintController;
                    PreviewPrintController pcpv = new PreviewPrintController();
                    doc.PrintController = pcpv;
                    doc.Print();
                    doc.PrintController = pc;

                    // create pdf document
                    using (C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument())
                    {
                        // add pages to pdf document
                        bool firstPage = true;
                        foreach (PreviewPageInfo page in pcpv.GetPreviewPageInfo())
                        {
                            pdf.PageSize = new SizeF(
                                page.PhysicalSize.Width * 0.72f,
                                page.PhysicalSize.Height * 0.72f);
                            if (!firstPage)
                            {
                                pdf.NewPage();
                            }
                            pdf.DrawImage(page.Image, pdf.PageRectangle);
                            firstPage = false;
                        }

                        // save pdf file
                        try
                        {
                            pdf.Save(dlg.FileName);
                            string       msg = string.Format(Resources.ExportPdf_msg, Path.GetFileName(dlg.FileName));
                            DialogResult dr  = MessageBox.Show(this, msg, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                            if (dr == DialogResult.Yes)
                            {
                                Process.Start(dlg.FileName);
                            }
                            return(true);
                        }
                        catch (Exception x)
                        {
                            string msg = x.Message;
                            MessageBox.Show(this, msg, Application.ProductName);
                            return(false);
                        }
                    }
                }
            }

            // failed
            return(false);
        }
예제 #4
0
            // ** event handlers
            public void Save(string fileName)
            {
                // create new pdf document
                C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument();

                // add pages to document
                for (int page = 0; page < _images.Count; page++)
                {
                    DrawPageImage(pdf, page);
                }

                // done
                pdf.Save(fileName);
            }
예제 #5
0
        private void CreatePDF()
        {
            _c1pdf = new C1.C1Pdf.C1PdfDocument();
            //start document
            _c1pdf.Clear();
            TEMP_DIR = Server.MapPath("../Temp");
            if (Directory.Exists(TEMP_DIR))
            {

            }
            else
            {
                Directory.CreateDirectory(TEMP_DIR);

            }
            //prepare to draw with Gdi-like commands
            int penWidth = 0;
            int penRGB = 0;
            Rectangle rc = new Rectangle(50, 50, 300, 200);
            string text = "Hello world of .NET Graphics and PDF.\r\nNice to meet you.";
            Font font = new Font("Times New Roman", 16, FontStyle.Italic | FontStyle.Underline);

            //start, c1, c2, end1, c3, c4, end
            PointF[] bezierPoints = new PointF[]
			{
				new PointF(110f, 200f), new PointF(120f, 110f), new PointF(135f, 150f),
				new PointF(150f, 200f), new PointF(160f, 250f), new PointF(165f, 200f),
				new PointF(150f, 100f)
			};

            //draw to pdf document
            C1.C1Pdf.C1PdfDocument g = _c1pdf;
            g.FillPie(Brushes.Red, rc, 0, 20f);
            g.FillPie(Brushes.Green, rc, 20f, 30f);
            g.FillPie(Brushes.Blue, rc, 60f, 12f);
            g.FillPie(Brushes.Gold, rc, -80f, -20f);
            for (float sa = 0; sa < 360; sa += 40)
            {
                Color penColor = Color.FromArgb(penRGB, penRGB, penRGB);
                Pen pen = new Pen(penColor, penWidth++);
                penRGB = penRGB + 20;
                g.DrawArc(pen, rc, sa, 40f);
            }
            g.DrawRectangle(Pens.Red, rc);
            g.DrawBeziers(Pens.Blue, bezierPoints);
            g.DrawString(text, font, Brushes.Black, rc);
        }
예제 #6
0
        private void CreatePDF()
        {
            _c1pdf = new C1.C1Pdf.C1PdfDocument();
            //start document
            _c1pdf.Clear();
            TEMP_DIR = Server.MapPath("../Temp");
            if (Directory.Exists(TEMP_DIR))
            {
            }
            else
            {
                Directory.CreateDirectory(TEMP_DIR);
            }
            //prepare to draw with Gdi-like commands
            int       penWidth = 0;
            int       penRGB   = 0;
            Rectangle rc       = new Rectangle(50, 50, 300, 200);
            string    text     = "Hello world of .NET Graphics and PDF.\r\nNice to meet you.";
            Font      font     = new Font("Times New Roman", 16, FontStyle.Italic | FontStyle.Underline);

            //start, c1, c2, end1, c3, c4, end
            PointF[] bezierPoints = new PointF[]
            {
                new PointF(110f, 200f), new PointF(120f, 110f), new PointF(135f, 150f),
                new PointF(150f, 200f), new PointF(160f, 250f), new PointF(165f, 200f),
                new PointF(150f, 100f)
            };

            //draw to pdf document
            C1.C1Pdf.C1PdfDocument g = _c1pdf;
            g.FillPie(Brushes.Red, rc, 0, 20f);
            g.FillPie(Brushes.Green, rc, 20f, 30f);
            g.FillPie(Brushes.Blue, rc, 60f, 12f);
            g.FillPie(Brushes.Gold, rc, -80f, -20f);
            for (float sa = 0; sa < 360; sa += 40)
            {
                Color penColor = Color.FromArgb(penRGB, penRGB, penRGB);
                Pen   pen      = new Pen(penColor, penWidth++);
                penRGB = penRGB + 20;
                g.DrawArc(pen, rc, sa, 40f);
            }
            g.DrawRectangle(Pens.Red, rc);
            g.DrawBeziers(Pens.Blue, bezierPoints);
            g.DrawString(text, font, Brushes.Black, rc);
        }
예제 #7
0
            private void DrawPageImage(C1.C1Pdf.C1PdfDocument pdf, int index)
            {
                // get image bounds
                RectangleF rcBounds = pdf.PageRectangle;

                rcBounds.Inflate(-72, -72);

                // calculate zoom factor
                if (index == 0)
                {
                    // get size of largest image
                    SizeF szMax = Size.Empty;
                    foreach (Image page in _images)
                    {
                        szMax.Height = Math.Max(szMax.Height, page.Height);
                        szMax.Width  = Math.Max(szMax.Width, page.Width);
                    }

                    // get size of page bounds
                    SizeF szPage = rcBounds.Size;

                    // calculate zoom so largest image doesn't overflow the page
                    _zoom = 1;
                    float zh = szPage.Width / szMax.Width;
                    float zv = szPage.Height / szMax.Height;
                    if (zh < 1 || zv < 1)
                    {
                        _zoom = Math.Min(zh, zv);
                    }
                }

                // draw grid image
                RectangleF rc  = rcBounds;
                Image      img = _images[index] as Image;

                rc.Width  = (int)(img.Width * _zoom);
                rc.Height = (int)(img.Height * _zoom);
                if (index > 0)
                {
                    pdf.NewPage();
                }
                pdf.DrawImage(img, rc);
            }
예제 #8
0
            // ** event handlers
            public void Save(string fileName)
            {
#if not_C1FlexGridPrinter
                // create new pdf document
                C1.C1Pdf.C1PdfDocument pdf = new C1.C1Pdf.C1PdfDocument();

                // add pages to document
                for (int page = 0; page < _images.Count; page++)
                {
                    DrawPageImage(pdf, page);
                }

                // done
                pdf.Save(fileName);
#else
                // adjust printout for better export:
                _printer.PrintInfo.AutoColWidths   = true;
                _printer.PrintInfo.RepeatFixedCols = false;
                C1.C1Preview.C1PrintDocument doc = _printer.MakeDocument();
                doc.Export(fileName);
#endif
            }
예제 #9
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this._c1rPortrait  = new C1.C1Report.C1Report();
     this._c1rLandscape = new C1.C1Report.C1Report();
     this._c1pdf        = new C1.C1Pdf.C1PdfDocument();
     this.button1       = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this._c1rPortrait)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this._c1rLandscape)).BeginInit();
     this.SuspendLayout();
     //
     // _c1rPortrait
     //
     this._c1rPortrait.ReportDefinition = "<!--Report *** Portrait ***--><Report version=\"2.5.20043.144\"><Name>Portrait</Nam" +
                                          "e><DataSource><RecordSource>Products</RecordSource></DataSource><Layout><Orienta" +
                                          "tion>1</Orientation></Layout><Font><Name>Times New Roman</Name><Size>9</Size></F" +
                                          "ont><Groups /><Sections><Section><Name>Detail</Name><Type>0</Type><Height>3705</" +
                                          "Height></Section><Section><Name>Header</Name><Type>1</Type><Height>800</Height><" +
                                          "/Section><Section><Name>Footer</Name><Type>2</Type><Visible>0</Visible></Section" +
                                          "><Section><Name>PageHeader</Name><Type>3</Type><Height>600</Height></Section><Se" +
                                          "ction><Name>PageFooter</Name><Type>4</Type><Height>500</Height></Section></Secti" +
                                          "ons><Fields><Field><Name>titleLbl</Name><Section>0</Section><Text>Address</Text>" +
                                          "<Width>9360</Width><Height>3510</Height><Align>7</Align><ForeColor>128</ForeColo" +
                                          "r><Font><Bold>-1</Bold><Name>Times New Roman</Name><Size>36</Size></Font></Field" +
                                          "><Field><Name>ftrLeft</Name><Section>4</Section><Text>Now()</Text><Calculated>-1" +
                                          "</Calculated><Top>30</Top><Width>4680</Width><Height>300</Height><Align>0</Align" +
                                          "><Font><Name>Arial</Name><Size>9</Size></Font></Field><Field><Name>ftrRight</Nam" +
                                          "e><Section>4</Section><Text>\"Page \" &amp; [Page] &amp; \" of \" &amp; [Pages]</Tex" +
                                          "t><Calculated>-1</Calculated><Left>4680</Left><Top>30</Top><Width>4680</Width><H" +
                                          "eight>300</Height><Align>2</Align><Font><Name>Arial</Name><Size>9</Size></Font><" +
                                          "/Field><Field><Name>divLine</Name><Section>3</Section><Top>540</Top><Width>9360<" +
                                          "/Width><Height>60</Height><BackColor>0</BackColor><BackStyle>1</BackStyle></Fiel" +
                                          "d></Fields></Report>";
     this._c1rPortrait.ReportName = "Portrait";
     //
     // _c1rLandscape
     //
     this._c1rLandscape.ReportDefinition = "<!--Report *** Landscape ***--><Report version=\"2.5.20043.144\"><Name>Landscape</N" +
                                           "ame><DataSource><ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C" +
                                           ":\\Program Files\\ComponentOne Studio.Net 2.0\\Common\\NWind.mdb;Persist Security Info=Fal" +
                                           "se</ConnectionString><RecordSource>Products</RecordSource></DataSource><Layout><" +
                                           "Width>12345</Width><Orientation>2</Orientation></Layout><Font><Name>Times New Ro" +
                                           "man</Name><Size>9</Size></Font><Groups /><Sections><Section><Name>Detail</Name><" +
                                           "Type>0</Type><Height>500</Height></Section><Section><Name>Header</Name><Type>1</" +
                                           "Type><Height>800</Height></Section><Section><Name>Footer</Name><Type>2</Type><Vi" +
                                           "sible>0</Visible></Section><Section><Name>PageHeader</Name><Type>3</Type><Height" +
                                           ">600</Height></Section><Section><Name>PageFooter</Name><Type>4</Type><Height>500" +
                                           "</Height></Section></Sections><Fields><Field><Name>titleLbl</Name><Section>1</Se" +
                                           "ction><Text>Products Report</Text><Top>200</Top><Width>9360</Width><Height>600</" +
                                           "Height><Align>6</Align><ForeColor>128</ForeColor><Font><Bold>-1</Bold><Name>Time" +
                                           "s New Roman</Name><Size>20</Size></Font></Field><Field><Name>ftrLeft</Name><Sect" +
                                           "ion>4</Section><Text>Now()</Text><Calculated>-1</Calculated><Top>30</Top><Width>" +
                                           "4680</Width><Height>300</Height><Align>0</Align><Font><Name>Arial</Name><Size>9<" +
                                           "/Size></Font></Field><Field><Name>ftrRight</Name><Section>4</Section><Text>\"Page" +
                                           " \" &amp; [Page] &amp; \" of \" &amp; [Pages]</Text><Calculated>-1</Calculated><Lef" +
                                           "t>7380</Left><Top>30</Top><Width>4680</Width><Height>300</Height><Align>2</Align" +
                                           "><Font><Name>Arial</Name><Size>9</Size></Font></Field><Field><Name>CategoryIDLbl" +
                                           "</Name><Section>3</Section><Text>CategoryID</Text><Top>100</Top><Width>652</Widt" +
                                           "h><Height>400</Height><Align>3</Align><ForeColor>128</ForeColor><WordWrap>0</Wor" +
                                           "dWrap><Font><Bold>-1</Bold><Name>Arial</Name><Size>10</Size></Font></Field><Fiel" +
                                           "d><Name>DiscontinuedLbl</Name><Section>3</Section><Text>Discontinued</Text><Left" +
                                           ">665</Left><Top>100</Top><Width>326</Width><Height>400</Height><Align>3</Align><" +
                                           "ForeColor>128</ForeColor><WordWrap>0</WordWrap><Font><Bold>-1</Bold><Name>Arial<" +
                                           "/Name><Size>10</Size></Font></Field><Field><Name>ProductIDLbl</Name><Section>3</" +
                                           "Section><Text>ProductID</Text><Left>1005</Left><Top>100</Top><Width>652</Width><" +
                                           "Height>400</Height><Align>3</Align><ForeColor>128</ForeColor><WordWrap>0</WordWr" +
                                           "ap><Font><Bold>-1</Bold><Name>Arial</Name><Size>10</Size></Font></Field><Field><" +
                                           "Name>ProductNameLbl</Name><Section>3</Section><Text>ProductName</Text><Left>1670" +
                                           "</Left><Top>100</Top><Width>1956</Width><Height>400</Height><Align>3</Align><For" +
                                           "eColor>128</ForeColor><WordWrap>0</WordWrap><Font><Bold>-1</Bold><Name>Arial</Na" +
                                           "me><Size>10</Size></Font></Field><Field><Name>QuantityPerUnitLbl</Name><Section>" +
                                           "3</Section><Text>QuantityPerUnit</Text><Left>6340</Left><Top>100</Top><Width>195" +
                                           "6</Width><Height>400</Height><Align>3</Align><ForeColor>128</ForeColor><WordWrap" +
                                           ">0</WordWrap><Font><Bold>-1</Bold><Name>Arial</Name><Size>10</Size></Font></Fiel" +
                                           "d><Field><Name>ReorderLevelLbl</Name><Section>3</Section><Text>ReorderLevel</Tex" +
                                           "t><Left>8310</Left><Top>100</Top><Width>652</Width><Height>400</Height><Align>3<" +
                                           "/Align><ForeColor>128</ForeColor><WordWrap>0</WordWrap><Font><Bold>-1</Bold><Nam" +
                                           "e>Arial</Name><Size>10</Size></Font></Field><Field><Name>SupplierIDLbl</Name><Se" +
                                           "ction>3</Section><Text>SupplierID</Text><Left>8976</Left><Top>100</Top><Width>65" +
                                           "2</Width><Height>400</Height><Align>3</Align><ForeColor>128</ForeColor><WordWrap" +
                                           ">0</WordWrap><Font><Bold>-1</Bold><Name>Arial</Name><Size>10</Size></Font></Fiel" +
                                           "d><Field><Name>UnitPriceLbl</Name><Section>3</Section><Text>UnitPrice</Text><Lef" +
                                           "t>9641</Left><Top>100</Top><Width>1086</Width><Height>400</Height><Align>3</Alig" +
                                           "n><ForeColor>128</ForeColor><WordWrap>0</WordWrap><Font><Bold>-1</Bold><Name>Ari" +
                                           "al</Name><Size>10</Size></Font></Field><Field><Name>UnitsInStockLbl</Name><Secti" +
                                           "on>3</Section><Text>UnitsInStock</Text><Left>10742</Left><Top>100</Top><Width>65" +
                                           "2</Width><Height>400</Height><Align>3</Align><ForeColor>128</ForeColor><WordWrap" +
                                           ">0</WordWrap><Font><Bold>-1</Bold><Name>Arial</Name><Size>10</Size></Font></Fiel" +
                                           "d><Field><Name>UnitsOnOrderLbl</Name><Section>3</Section><Text>UnitsOnOrder</Tex" +
                                           "t><Left>11407</Left><Top>100</Top><Width>652</Width><Height>400</Height><Align>3" +
                                           "</Align><ForeColor>128</ForeColor><WordWrap>0</WordWrap><Font><Bold>-1</Bold><Na" +
                                           "me>Arial</Name><Size>10</Size></Font></Field><Field><Name>CategoryIDCtl</Name><S" +
                                           "ection>0</Section><Text>CategoryID</Text><Calculated>-1</Calculated><Top>100</To" +
                                           "p><Width>652</Width><Height>300</Height><Align>2</Align></Field><Field><Name>Dis" +
                                           "continuedCtl</Name><Section>0</Section><Text>Discontinued</Text><Calculated>-1</" +
                                           "Calculated><Left>665</Left><Top>100</Top><Width>326</Width><Height>300</Height><" +
                                           "Align>0</Align></Field><Field><Name>ProductIDCtl</Name><Section>0</Section><Text" +
                                           ">ProductID</Text><Calculated>-1</Calculated><Left>1005</Left><Top>100</Top><Widt" +
                                           "h>652</Width><Height>300</Height><Align>2</Align></Field><Field><Name>ProductNam" +
                                           "eCtl</Name><Section>0</Section><Text>ProductName</Text><Calculated>-1</Calculate" +
                                           "d><Left>1665</Left><Top>105</Top><Width>4635</Width><Height>300</Height><Align>0" +
                                           "</Align><CanGrow>-1</CanGrow></Field><Field><Name>QuantityPerUnitCtl</Name><Sect" +
                                           "ion>0</Section><Text>QuantityPerUnit</Text><Calculated>-1</Calculated><Left>6340" +
                                           "</Left><Top>100</Top><Width>1956</Width><Height>300</Height><Align>0</Align><Can" +
                                           "Grow>-1</CanGrow></Field><Field><Name>ReorderLevelCtl</Name><Section>0</Section>" +
                                           "<Text>ReorderLevel</Text><Calculated>-1</Calculated><Left>8310</Left><Top>100</T" +
                                           "op><Width>652</Width><Height>300</Height><Align>2</Align></Field><Field><Name>Su" +
                                           "pplierIDCtl</Name><Section>0</Section><Text>SupplierID</Text><Calculated>-1</Cal" +
                                           "culated><Left>8976</Left><Top>100</Top><Width>652</Width><Height>300</Height><Al" +
                                           "ign>2</Align></Field><Field><Name>UnitPriceCtl</Name><Section>0</Section><Text>U" +
                                           "nitPrice</Text><Calculated>-1</Calculated><Left>9641</Left><Top>100</Top><Width>" +
                                           "1086</Width><Height>300</Height><Align>2</Align></Field><Field><Name>UnitsInStoc" +
                                           "kCtl</Name><Section>0</Section><Text>UnitsInStock</Text><Calculated>-1</Calculat" +
                                           "ed><Left>10742</Left><Top>100</Top><Width>652</Width><Height>300</Height><Align>" +
                                           "2</Align></Field><Field><Name>UnitsOnOrderCtl</Name><Section>0</Section><Text>Un" +
                                           "itsOnOrder</Text><Calculated>-1</Calculated><Left>11407</Left><Top>100</Top><Wid" +
                                           "th>652</Width><Height>300</Height><Align>2</Align></Field><Field><Name>divLine</" +
                                           "Name><Section>3</Section><Top>540</Top><Width>12210</Width><Height>60</Height><B" +
                                           "ackColor>0</BackColor><BackStyle>1</BackStyle></Field></Fields></Report>";
     this._c1rLandscape.ReportName = "Landscape";
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(16, 16);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(160, 48);
     this.button1.TabIndex = 0;
     this.button1.Text     = "Go";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(192, 77);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this.button1
     });
     this.Name = "Form1";
     this.Text = "Form1";
     ((System.ComponentModel.ISupportInitialize)(this._c1rPortrait)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this._c1rLandscape)).EndInit();
     this.ResumeLayout(false);
 }
예제 #10
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this._txtOwner            = new System.Windows.Forms.TextBox();
     this._txtUser             = new System.Windows.Forms.TextBox();
     this._chkAllowPrint       = new System.Windows.Forms.CheckBox();
     this.label1               = new System.Windows.Forms.Label();
     this.label2               = new System.Windows.Forms.Label();
     this._chkAllowCopy        = new System.Windows.Forms.CheckBox();
     this._chkAllowEditContent = new System.Windows.Forms.CheckBox();
     this._chkAllowEditAnnot   = new System.Windows.Forms.CheckBox();
     this.groupBox1            = new System.Windows.Forms.GroupBox();
     this._btnCreate           = new System.Windows.Forms.Button();
     this.c1PdfDocument1       = new C1.C1Pdf.C1PdfDocument();
     this.groupBox1.SuspendLayout();
     this.SuspendLayout();
     //
     // _txtOwner
     //
     this._txtOwner.Location = new System.Drawing.Point(104, 16);
     this._txtOwner.Name     = "_txtOwner";
     this._txtOwner.Size     = new System.Drawing.Size(120, 20);
     this._txtOwner.TabIndex = 0;
     this._txtOwner.Text     = "";
     //
     // _txtUser
     //
     this._txtUser.Location = new System.Drawing.Point(104, 48);
     this._txtUser.Name     = "_txtUser";
     this._txtUser.Size     = new System.Drawing.Size(120, 20);
     this._txtUser.TabIndex = 0;
     this._txtUser.Text     = "";
     //
     // _chkAllowPrint
     //
     this._chkAllowPrint.Checked    = true;
     this._chkAllowPrint.CheckState = System.Windows.Forms.CheckState.Checked;
     this._chkAllowPrint.Location   = new System.Drawing.Point(16, 24);
     this._chkAllowPrint.Name       = "_chkAllowPrint";
     this._chkAllowPrint.Size       = new System.Drawing.Size(136, 16);
     this._chkAllowPrint.TabIndex   = 1;
     this._chkAllowPrint.Text       = "Print";
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(8, 16);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(96, 16);
     this.label1.TabIndex = 2;
     this.label1.Text     = "Owner Password";
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(8, 48);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(96, 16);
     this.label2.TabIndex = 2;
     this.label2.Text     = "User Password";
     //
     // _chkAllowCopy
     //
     this._chkAllowCopy.Checked    = true;
     this._chkAllowCopy.CheckState = System.Windows.Forms.CheckState.Checked;
     this._chkAllowCopy.Location   = new System.Drawing.Point(16, 48);
     this._chkAllowCopy.Name       = "_chkAllowCopy";
     this._chkAllowCopy.Size       = new System.Drawing.Size(136, 16);
     this._chkAllowCopy.TabIndex   = 1;
     this._chkAllowCopy.Text       = "Copy Content";
     //
     // _chkAllowEditContent
     //
     this._chkAllowEditContent.Checked    = true;
     this._chkAllowEditContent.CheckState = System.Windows.Forms.CheckState.Checked;
     this._chkAllowEditContent.Location   = new System.Drawing.Point(16, 96);
     this._chkAllowEditContent.Name       = "_chkAllowEditContent";
     this._chkAllowEditContent.Size       = new System.Drawing.Size(136, 16);
     this._chkAllowEditContent.TabIndex   = 1;
     this._chkAllowEditContent.Text       = "Edit Content";
     //
     // _chkAllowEditAnnot
     //
     this._chkAllowEditAnnot.Checked    = true;
     this._chkAllowEditAnnot.CheckState = System.Windows.Forms.CheckState.Checked;
     this._chkAllowEditAnnot.Location   = new System.Drawing.Point(16, 72);
     this._chkAllowEditAnnot.Name       = "_chkAllowEditAnnot";
     this._chkAllowEditAnnot.Size       = new System.Drawing.Size(136, 16);
     this._chkAllowEditAnnot.TabIndex   = 1;
     this._chkAllowEditAnnot.Text       = "Edit Annotations";
     //
     // groupBox1
     //
     this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
         this._chkAllowPrint,
         this._chkAllowCopy,
         this._chkAllowEditAnnot,
         this._chkAllowEditContent
     });
     this.groupBox1.Location = new System.Drawing.Point(16, 88);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(208, 120);
     this.groupBox1.TabIndex = 3;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Permissions";
     //
     // _btnCreate
     //
     this._btnCreate.Location = new System.Drawing.Point(16, 224);
     this._btnCreate.Name     = "_btnCreate";
     this._btnCreate.Size     = new System.Drawing.Size(208, 24);
     this._btnCreate.TabIndex = 4;
     this._btnCreate.Text     = "Create Document";
     this._btnCreate.Click   += new System.EventHandler(this._btnCreate_Click);
     //
     // c1PdfDocument1
     //
     this.c1PdfDocument1.DocumentInfo.Author           = "Peter Downes Fisher";
     this.c1PdfDocument1.DocumentInfo.Creator          = "Sample App";
     this.c1PdfDocument1.DocumentInfo.Keywords         = "Security, protection, encryption";
     this.c1PdfDocument1.DocumentInfo.Producer         = "ComponentOne C1Pdf";
     this.c1PdfDocument1.DocumentInfo.Subject          = "Security";
     this.c1PdfDocument1.DocumentInfo.Title            = "Pdf Security Sample";
     this.c1PdfDocument1.Security.AllowCopyContent     = true;
     this.c1PdfDocument1.Security.AllowEditAnnotations = true;
     this.c1PdfDocument1.Security.AllowEditContent     = true;
     this.c1PdfDocument1.Security.AllowPrint           = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(240, 262);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this._btnCreate,
         this.groupBox1,
         this.label1,
         this._txtOwner,
         this._txtUser,
         this.label2
     });
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Name            = "Form1";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "C1Pdf Security";
     this.groupBox1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
예제 #11
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.tabControl1 = new System.Windows.Forms.TabControl();
     this.tabPage1    = new System.Windows.Forms.TabPage();
     this.c1Chart1    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart2    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart3    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart5    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart6    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart4    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart7    = new C1.Win.C1Chart.C1Chart();
     this.c1Chart8    = new C1.Win.C1Chart.C1Chart();
     this.tabPage2    = new System.Windows.Forms.TabPage();
     this.c1Chart3D1  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D2  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D3  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D4  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D6  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D5  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D7  = new C1.Win.C1Chart3D.C1Chart3D();
     this.c1Chart3D8  = new C1.Win.C1Chart3D.C1Chart3D();
     this.button1     = new System.Windows.Forms.Button();
     this._c1pdf      = new C1.C1Pdf.C1PdfDocument();
     this.label1      = new System.Windows.Forms.Label();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart5)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart6)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart7)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart8)).BeginInit();
     this.tabPage2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D6)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D5)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D7)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D8)).BeginInit();
     this.SuspendLayout();
     //
     // tabControl1
     //
     this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Location      = new System.Drawing.Point(10, 9);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(670, 406);
     this.tabControl1.TabIndex      = 0;
     //
     // tabPage1
     //
     this.tabPage1.Controls.Add(this.c1Chart1);
     this.tabPage1.Controls.Add(this.c1Chart2);
     this.tabPage1.Controls.Add(this.c1Chart3);
     this.tabPage1.Controls.Add(this.c1Chart5);
     this.tabPage1.Controls.Add(this.c1Chart6);
     this.tabPage1.Controls.Add(this.c1Chart4);
     this.tabPage1.Controls.Add(this.c1Chart7);
     this.tabPage1.Controls.Add(this.c1Chart8);
     this.tabPage1.Location = new System.Drawing.Point(4, 25);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Size     = new System.Drawing.Size(662, 377);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text     = "2D Charts";
     //
     // c1Chart1
     //
     this.c1Chart1.Location = new System.Drawing.Point(10, 9);
     this.c1Chart1.Name     = "c1Chart1";
     this.c1Chart1.PropBag  = resources.GetString("c1Chart1.PropBag");
     this.c1Chart1.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart1.TabIndex = 0;
     //
     // c1Chart2
     //
     this.c1Chart2.Location = new System.Drawing.Point(192, 9);
     this.c1Chart2.Name     = "c1Chart2";
     this.c1Chart2.PropBag  = resources.GetString("c1Chart2.PropBag");
     this.c1Chart2.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart2.TabIndex = 0;
     //
     // c1Chart3
     //
     this.c1Chart3.Location = new System.Drawing.Point(374, 9);
     this.c1Chart3.Name     = "c1Chart3";
     this.c1Chart3.PropBag  = resources.GetString("c1Chart3.PropBag");
     this.c1Chart3.Size     = new System.Drawing.Size(183, 176);
     this.c1Chart3.TabIndex = 0;
     //
     // c1Chart5
     //
     this.c1Chart5.Location = new System.Drawing.Point(10, 194);
     this.c1Chart5.Name     = "c1Chart5";
     this.c1Chart5.PropBag  = resources.GetString("c1Chart5.PropBag");
     this.c1Chart5.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart5.TabIndex = 0;
     //
     // c1Chart6
     //
     this.c1Chart6.Location = new System.Drawing.Point(192, 194);
     this.c1Chart6.Name     = "c1Chart6";
     this.c1Chart6.PropBag  = resources.GetString("c1Chart6.PropBag");
     this.c1Chart6.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart6.TabIndex = 0;
     //
     // c1Chart4
     //
     this.c1Chart4.Location = new System.Drawing.Point(374, 194);
     this.c1Chart4.Name     = "c1Chart4";
     this.c1Chart4.PropBag  = resources.GetString("c1Chart4.PropBag");
     this.c1Chart4.Size     = new System.Drawing.Size(183, 175);
     this.c1Chart4.TabIndex = 0;
     //
     // c1Chart7
     //
     this.c1Chart7.Location = new System.Drawing.Point(557, 194);
     this.c1Chart7.Name     = "c1Chart7";
     this.c1Chart7.PropBag  = resources.GetString("c1Chart7.PropBag");
     this.c1Chart7.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart7.TabIndex = 0;
     //
     // c1Chart8
     //
     this.c1Chart8.Location = new System.Drawing.Point(557, 9);
     this.c1Chart8.Name     = "c1Chart8";
     this.c1Chart8.PropBag  = resources.GetString("c1Chart8.PropBag");
     this.c1Chart8.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart8.TabIndex = 0;
     //
     // tabPage2
     //
     this.tabPage2.Controls.Add(this.c1Chart3D1);
     this.tabPage2.Controls.Add(this.c1Chart3D2);
     this.tabPage2.Controls.Add(this.c1Chart3D3);
     this.tabPage2.Controls.Add(this.c1Chart3D4);
     this.tabPage2.Controls.Add(this.c1Chart3D6);
     this.tabPage2.Controls.Add(this.c1Chart3D5);
     this.tabPage2.Controls.Add(this.c1Chart3D7);
     this.tabPage2.Controls.Add(this.c1Chart3D8);
     this.tabPage2.Location = new System.Drawing.Point(4, 25);
     this.tabPage2.Name     = "tabPage2";
     this.tabPage2.Size     = new System.Drawing.Size(761, 377);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text     = "3D Charts";
     //
     // c1Chart3D1
     //
     this.c1Chart3D1.Location = new System.Drawing.Point(10, 9);
     this.c1Chart3D1.Name     = "c1Chart3D1";
     this.c1Chart3D1.PropBag  = resources.GetString("c1Chart3D1.PropBag");
     this.c1Chart3D1.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart3D1.TabIndex = 0;
     //
     // c1Chart3D2
     //
     this.c1Chart3D2.Location = new System.Drawing.Point(192, 9);
     this.c1Chart3D2.Name     = "c1Chart3D2";
     this.c1Chart3D2.PropBag  = resources.GetString("c1Chart3D2.PropBag");
     this.c1Chart3D2.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart3D2.TabIndex = 0;
     //
     // c1Chart3D3
     //
     this.c1Chart3D3.Location = new System.Drawing.Point(374, 9);
     this.c1Chart3D3.Name     = "c1Chart3D3";
     this.c1Chart3D3.PropBag  = resources.GetString("c1Chart3D3.PropBag");
     this.c1Chart3D3.Size     = new System.Drawing.Size(183, 176);
     this.c1Chart3D3.TabIndex = 0;
     //
     // c1Chart3D4
     //
     this.c1Chart3D4.Location = new System.Drawing.Point(10, 194);
     this.c1Chart3D4.Name     = "c1Chart3D4";
     this.c1Chart3D4.PropBag  = resources.GetString("c1Chart3D4.PropBag");
     this.c1Chart3D4.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart3D4.TabIndex = 0;
     //
     // c1Chart3D6
     //
     this.c1Chart3D6.Location = new System.Drawing.Point(192, 194);
     this.c1Chart3D6.Name     = "c1Chart3D6";
     this.c1Chart3D6.PropBag  = resources.GetString("c1Chart3D6.PropBag");
     this.c1Chart3D6.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart3D6.TabIndex = 0;
     //
     // c1Chart3D5
     //
     this.c1Chart3D5.Location = new System.Drawing.Point(374, 194);
     this.c1Chart3D5.Name     = "c1Chart3D5";
     this.c1Chart3D5.PropBag  = resources.GetString("c1Chart3D5.PropBag");
     this.c1Chart3D5.Size     = new System.Drawing.Size(183, 175);
     this.c1Chart3D5.TabIndex = 0;
     //
     // c1Chart3D7
     //
     this.c1Chart3D7.Location = new System.Drawing.Point(557, 9);
     this.c1Chart3D7.Name     = "c1Chart3D7";
     this.c1Chart3D7.PropBag  = resources.GetString("c1Chart3D7.PropBag");
     this.c1Chart3D7.Size     = new System.Drawing.Size(182, 176);
     this.c1Chart3D7.TabIndex = 0;
     //
     // c1Chart3D8
     //
     this.c1Chart3D8.Location = new System.Drawing.Point(557, 194);
     this.c1Chart3D8.Name     = "c1Chart3D8";
     this.c1Chart3D8.PropBag  = resources.GetString("c1Chart3D8.PropBag");
     this.c1Chart3D8.Size     = new System.Drawing.Size(182, 175);
     this.c1Chart3D8.TabIndex = 0;
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(10, 425);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(153, 37);
     this.button1.TabIndex = 1;
     this.button1.Text     = "Create PDF";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // _c1pdf
     //
     this._c1pdf.Security.OwnerPassword = "******";
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(182, 434);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(576, 18);
     this.label1.TabIndex = 2;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
     this.ClientSize        = new System.Drawing.Size(689, 476);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.tabControl1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Name            = "Form1";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "C1Charts in PDF";
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart5)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart6)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart7)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart8)).EndInit();
     this.tabPage2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D6)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D5)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D7)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.c1Chart3D8)).EndInit();
     this.ResumeLayout(false);
 }
예제 #12
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this._flex     = new C1.Win.C1FlexGrid.C1FlexGrid();
     this._btnPrint = new System.Windows.Forms.Button();
     this.label1    = new System.Windows.Forms.Label();
     this.label2    = new System.Windows.Forms.Label();
     this._rpp      = new System.Windows.Forms.TextBox();
     this._cpp      = new System.Windows.Forms.TextBox();
     this._pdf      = new C1.C1Pdf.C1PdfDocument();
     ((System.ComponentModel.ISupportInitialize)(this._flex)).BeginInit();
     this.SuspendLayout();
     //
     // _flex
     //
     this._flex.ColumnInfo       = "10,1,0,0,0,95,Columns:";
     this._flex.Dock             = System.Windows.Forms.DockStyle.Fill;
     this._flex.Location         = new System.Drawing.Point(0, 45);
     this._flex.Name             = "_flex";
     this._flex.Rows.DefaultSize = 17;
     this._flex.Size             = new System.Drawing.Size(511, 326);
     this._flex.TabIndex         = 0;
     //
     // _btnPrint
     //
     this._btnPrint.Location = new System.Drawing.Point(351, 7);
     this._btnPrint.Name     = "_btnPrint";
     this._btnPrint.Size     = new System.Drawing.Size(123, 26);
     this._btnPrint.TabIndex = 1;
     this._btnPrint.Text     = "Export to Pdf";
     this._btnPrint.Click   += new System.EventHandler(this._btnPrint_Click);
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.Location  = new System.Drawing.Point(8, 12);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(82, 17);
     this.label1.TabIndex  = 2;
     this.label1.Text      = "Rows/page:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label2
     //
     this.label2.AutoSize  = true;
     this.label2.Location  = new System.Drawing.Point(191, 12);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(75, 17);
     this.label2.TabIndex  = 2;
     this.label2.Text      = "Cols/page:";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // _rpp
     //
     this._rpp.Location = new System.Drawing.Point(96, 9);
     this._rpp.Name     = "_rpp";
     this._rpp.Size     = new System.Drawing.Size(44, 22);
     this._rpp.TabIndex = 3;
     this._rpp.Text     = "20";
     //
     // _cpp
     //
     this._cpp.Location = new System.Drawing.Point(272, 9);
     this._cpp.Name     = "_cpp";
     this._cpp.Size     = new System.Drawing.Size(44, 22);
     this._cpp.TabIndex = 3;
     this._cpp.Text     = "3";
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
     this.ClientSize        = new System.Drawing.Size(511, 371);
     this.Controls.Add(this._rpp);
     this.Controls.Add(this.label1);
     this.Controls.Add(this._btnPrint);
     this.Controls.Add(this._flex);
     this.Controls.Add(this.label2);
     this.Controls.Add(this._cpp);
     this.Name          = "Form1";
     this.Padding       = new System.Windows.Forms.Padding(0, 45, 0, 0);
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "C1FlexGrid: Pdf Export";
     this.Load         += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this._flex)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #13
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this._c1pdf      = new C1.C1Pdf.C1PdfDocument();
     this.button1     = new System.Windows.Forms.Button();
     this.button2     = new System.Windows.Forms.Button();
     this.button3     = new System.Windows.Forms.Button();
     this.pictureBox1 = new System.Windows.Forms.PictureBox();
     this.listBox1    = new System.Windows.Forms.ListBox();
     this.button4     = new System.Windows.Forms.Button();
     this.statusBar1  = new System.Windows.Forms.StatusBar();
     this.SuspendLayout();
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(8, 72);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(168, 24);
     this.button1.TabIndex = 0;
     this.button1.Text     = "Show all Metafiles";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // button2
     //
     this.button2.Location = new System.Drawing.Point(8, 40);
     this.button2.Name     = "button2";
     this.button2.Size     = new System.Drawing.Size(168, 24);
     this.button2.TabIndex = 0;
     this.button2.Text     = "RTF text";
     this.button2.Click   += new System.EventHandler(this.button2_Click);
     //
     // button3
     //
     this.button3.Location = new System.Drawing.Point(8, 8);
     this.button3.Name     = "button3";
     this.button3.Size     = new System.Drawing.Size(168, 24);
     this.button3.TabIndex = 0;
     this.button3.Text     = "Arcs and Pies";
     this.button3.Click   += new System.EventHandler(this.button3_Click);
     //
     // pictureBox1
     //
     this.pictureBox1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                 | System.Windows.Forms.AnchorStyles.Left)
                                | System.Windows.Forms.AnchorStyles.Right);
     this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.pictureBox1.Location    = new System.Drawing.Point(184, 8);
     this.pictureBox1.Name        = "pictureBox1";
     this.pictureBox1.Size        = new System.Drawing.Size(336, 424);
     this.pictureBox1.SizeMode    = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex    = 1;
     this.pictureBox1.TabStop     = false;
     //
     // listBox1
     //
     this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                             | System.Windows.Forms.AnchorStyles.Left);
     this.listBox1.BorderStyle           = System.Windows.Forms.BorderStyle.FixedSingle;
     this.listBox1.IntegralHeight        = false;
     this.listBox1.Location              = new System.Drawing.Point(8, 128);
     this.listBox1.Name                  = "listBox1";
     this.listBox1.Size                  = new System.Drawing.Size(168, 304);
     this.listBox1.TabIndex              = 2;
     this.listBox1.DoubleClick          += new System.EventHandler(this.button4_Click);
     this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
     //
     // button4
     //
     this.button4.Location = new System.Drawing.Point(8, 104);
     this.button4.Name     = "button4";
     this.button4.Size     = new System.Drawing.Size(168, 24);
     this.button4.TabIndex = 0;
     this.button4.Text     = "Show selected Metafile";
     this.button4.Click   += new System.EventHandler(this.button4_Click);
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 431);
     this.statusBar1.Name     = "statusBar1";
     this.statusBar1.Size     = new System.Drawing.Size(528, 22);
     this.statusBar1.TabIndex = 3;
     this.statusBar1.Text     = "Ready";
     //
     // Form1
     //
     this.AcceptButton      = this.button4;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(528, 453);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this.button4,
         this.listBox1,
         this.pictureBox1,
         this.button1,
         this.button2,
         this.button3,
         this.statusBar1
     });
     this.Name          = "Form1";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "C1Pdf Advanced features";
     this.Load         += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
예제 #14
0
        //=============================================================================
        // test arcs and pies
        private void button3_Click(object sender, System.EventArgs e)
        {
            _c1pdf.Clear();
            _c1pdf.Compression = C1.C1Pdf.CompressionEnum.None;

            int       penWidth = 0;
            int       penRGB   = 0;
            Rectangle rc       = new Rectangle(0, 0, 300, 200);

            string text = "Hello world of .NET Graphics and PDF.\r\nNice to meet you.";
            Font   font = new Font("Times New Roman", 12, FontStyle.Italic | FontStyle.Underline);

            // start, c1, c2, end1, c3, c4, end
            PointF[] bezierPoints = new PointF[]
            {
                new PointF(10f, 100f), new PointF(20f, 10f), new PointF(35f, 50f),
                new PointF(50f, 100f), new PointF(60f, 150f), new PointF(65f, 100f),
                new PointF(50f, 50f)
            };

            // draw to .NET Graphics object
            Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);

            using (Graphics g = Graphics.FromImage(bmp))
            {
                g.FillRectangle(Brushes.White, 0, 0, bmp.Width, bmp.Height);
                g.FillPie(Brushes.Red, rc, 0, 20f);
                g.FillPie(Brushes.Green, rc, 20f, 30f);
                g.FillPie(Brushes.Blue, rc, 60f, 12f);
                g.FillPie(Brushes.Gold, rc, -80f, -20f);
                for (float sa = 0; sa < 360; sa += 40)
                {
                    Color penColor = Color.FromArgb(penRGB, penRGB, penRGB);
                    Pen   pen      = new Pen(penColor, penWidth++);
                    penRGB = penRGB + 20;
                    g.DrawArc(pen, rc, sa, 40f);
                }
                g.DrawRectangle(Pens.Red, rc);
                g.DrawBeziers(Pens.Blue, bezierPoints);
                g.DrawString(text, font, Brushes.Black, rc);
                g.Dispose();
            }
            this.pictureBox1.Image = bmp;
            this.pictureBox1.Refresh();

            // draw to pdf document
            penWidth = 0;
            penRGB   = 0;
            if (true)
            {
                C1.C1Pdf.C1PdfDocument g = _c1pdf;
                g.FillPie(Brushes.Red, rc, 0, 20f);
                g.FillPie(Brushes.Green, rc, 20f, 30f);
                g.FillPie(Brushes.Blue, rc, 60f, 12f);
                g.FillPie(Brushes.Gold, rc, -80f, -20f);
                for (float sa = 0; sa < 360; sa += 40)
                {
                    Color penColor = Color.FromArgb(penRGB, penRGB, penRGB);
                    Pen   pen      = new Pen(penColor, penWidth++);
                    penRGB = penRGB + 20;
                    g.DrawArc(pen, rc, sa, 40f);
                }
                g.DrawRectangle(Pens.Red, rc);
                g.DrawBeziers(Pens.Blue, bezierPoints);
                g.DrawString(text, font, Brushes.Black, rc);
            }

            // show pdf document
            SaveAndShow(@"c:\temp\test\arcpie.pdf");
        }