コード例 #1
0
 private void createTemplate()
 {
     ContentByte.SaveState();
     _template    = ContentByte.CreateTemplate(_chartWidth, ChartHeight);
     ChartHeight -= Margin;
     _template.SaveState();
 }
コード例 #2
0
 private void createTemplate()
 {
     ContentByte.SaveState();
     _template     = ContentByte.CreateTemplate(ChartWidth, _chartHeight);
     _chartHeight -= Margin;
     ChartWidth   -= _maxValueWidth;
     _template.SaveState();
 }
コード例 #3
0
        private void AddFooter()
        {
            ContentByte.SetLineWidth(1f);

            ContentByte.MoveTo(LX, BY + 25);
            ContentByte.LineTo(LX + 150, BY + 25);
            ContentByte.Stroke();
            GetColumnText(new Paragraph(GetText("podpis pacienta")), LX + 38, BY + 30, false);

            ContentByte.MoveTo(RX - 150, BY + 25);
            ContentByte.LineTo(RX, BY + 25);
            ContentByte.Stroke();
            GetColumnText(new Paragraph(GetText("podpis lekára")), RX - 104, BY + 30, false);
        }
コード例 #4
0
ファイル: PDFCreator.cs プロジェクト: xmatakt/DP
        /// <summary>
        /// Add labeled TextBox rectangle into PDF document
        /// </summary>
        /// <param name="label">Label of the TextBox</param>
        /// <param name="currentY">Y position of the TextBox</param>
        /// <param name="textBoxHeight">TextBox height</param>
        /// <param name="lineWidth">TextBox border width</param>
        /// <param name="spacingAfterLabel">Size of the gap between label and TextBox</param>
        /// <param name="borderColor">Border color of the TextBox rectangle</param>
        /// <returns>Returns actual Y position in the PDF document</returns>
        internal float AddTextBox(string label, float currentY, float textBoxHeight, float lineWidth, float spacingAfterLabel, System.Drawing.Color borderColor)
        {
            //simulate the creation of columnText to get its height
            ColumnText ct = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, true);

            //if there is no space for labeled TextBox, add new page to PDF document
            if (AddPage(currentY, spacingAfterLabel + (currentY - ct.YLine) + textBoxHeight))
            {
                currentY = NewPage();
            }
            ct       = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, false);
            currentY = ct.YLine - spacingAfterLabel;

            ContentByte.SetLineWidth(lineWidth);
            ContentByte.SetColorStroke(new BaseColor(borderColor));
            ContentByte.Rectangle(LX, currentY, RX - RX / 3, -textBoxHeight);
            ContentByte.Stroke();
            currentY -= textBoxHeight;

            return(NewPage(currentY, 0));
        }
コード例 #5
0
ファイル: PDFCreator.cs プロジェクト: xmatakt/DP
        /// <summary>
        /// Add CheckBoxes into PDF document
        /// </summary>
        /// <param name="choices">CheckBox options</param>
        /// <param name="label">Label for the CheckBox group</param>
        /// <param name="note">Note for the CheckBox group</param>
        /// <param name="currentY">Y position of the upper left corner of the CheckBox group</param>
        /// <param name="size">Size of the CheckBox square</param>
        /// <param name="lineWidth">CheckBox square border width</param>
        /// <param name="spacingAfterLabel">Spacing between label and the CheckBox group</param>
        /// <param name="borderColor">Border color of the CheckBox square</param>
        /// <returns>Actual Y position in the PDF document</returns>
        internal float AddCheckBoxes(string[] choices, string label, string note, float currentY, float size, float lineWidth,
                                     float spacingAfterLabel, System.Drawing.Color borderColor)
        {
            //simulate the creation of columnText to get its height
            ColumnText ct = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, true);

            //if there is no space for label and the first CheckBox, add new page to PDF document
            if (AddPage(currentY, spacingAfterLabel + (currentY - ct.YLine) + size))
            {
                currentY = NewPage();
            }

            ct       = GetColumnText(new Paragraph(GetBoldText(label)), LX, currentY, false);
            currentY = ct.YLine - spacingAfterLabel;

            ContentByte.SetLineWidth(lineWidth);
            ContentByte.SetColorStroke(new BaseColor(borderColor));

            foreach (var choice in choices)
            {
                currentY = NewPage(currentY, size + spacingAfterLabel);

                ContentByte.Rectangle(LX, currentY, size, -size);
                ContentByte.Stroke();

                ct        = GetColumnText(new Paragraph(GetCheckBoxText(choice)), LX + size + spacingAfterLabel, currentY + size - 4f, false);
                currentY -= (size + spacingAfterLabel);
            }

            ct = GetColumnText(new Paragraph(GetNoteText(note)), LX, currentY + size - 1.5f, true);
            if (AddPage(currentY, spacingAfterLabel + (currentY - ct.YLine)))
            {
                currentY = NewPage();
            }

            ct = GetColumnText(new Paragraph(GetNoteText(note)), LX, currentY + size - 1.5f, false);

            return(NewPage(currentY, 0));
        }
コード例 #6
0
 private void restoreStates()
 {
     _template.RestoreState();
     ContentByte.RestoreState();
 }
コード例 #7
0
 private void createTemplate()
 {
     ContentByte.SaveState();
     _template = ContentByte.CreateTemplate(_initialChartWidth, _initialChartHeight);
     _template.SaveState();
 }