////////////////////////////////////////////////////////////////////
        // Draw heading
        ////////////////////////////////////////////////////////////////////

        private void DrawTwoLinesOfHeading
        (
            PdfContents Contents
        )
        {
            // page heading
            // Arguments: Font: ArialBold, size: 36 points, Position: X = 4.25", Y = 9.5"
            // Text Justify: Center (text center will be at X position)
            // Stoking color: R=128, G=0, B=255 (text outline)
            // Nonstroking color: R=255, G=0, B=128 (text body)
            Contents.DrawText(Comic, 40.0, 4.25, 9.25, TextJustify.Center, 0.02, Color.FromArgb(128, 0, 255), Color.FromArgb(255, 0, 128), "PDF FILE WRITER");

            // save graphics state
            Contents.SaveGraphicsState();

            // change nonstroking (fill) color to purple
            Contents.SetColorNonStroking(Color.Purple);

            // Draw second line of heading text
            // arguments: Handwriting font, Font size 30 point, Position X=4.25", Y=9.0"
            // Text Justify: Center (text center will be at X position)
            Contents.DrawText(Comic, 30.0, 4.25, 8.75, TextJustify.Center, "Example");
//		Contents.TranslateScaleRotate(4.25, 8.75, 1.5, Math.PI / 6);
//		Contents.DrawText(Comic, 30.0, 0, 0, TextJustify.Center, "Example");

            // restore graphics sate (non stroking color will be restored to default)
            Contents.RestoreGraphicsState();
            return;
        }
        ////////////////////////////////////////////////////////////////////
        // Draw example of a text box
        ////////////////////////////////////////////////////////////////////

        private static void DrawCustomerNameAddress(CustomerInformation customer)
        {
            // save graphics state
            Contents.SaveGraphicsState();

            // set coordinate
            Contents.Translate(1.3, 16.2);

            // Define constants
            const Double Width    = 18;
            const Double Height   = 8;
            const Double FontSize = 10;

            // Create text box object with no first line indent
            TextBox customerContact = new TextBox(Width, 0);

            // add text to the text box
            customerContact.AddText(ArialNormal, FontSize, customer.GetName() + "\n");
            customerContact.AddText(ArialNormal, FontSize, customer.GetAddress()[0] + "\n");
            customerContact.AddText(ArialNormal, FontSize, customer.GetAddress()[1] + "\n");
            customerContact.AddText(ArialNormal, FontSize, customer.GetAddress()[2] + "\n");

            // Draw the text box
            Double PosY = Height;

            Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.015, 0.05, TextBoxJustify.Left, customerContact);

            // restore graphics state
            Contents.RestoreGraphicsState();
            return;
        }
Exemplo n.º 3
0
        void DrawSubtotal(PdfContents content)
        {
            string betrag;

            content.DrawText(fontDefault, 10D, xSummary, lastPosition - 5, DrawStyle.Normal, "Zwischensumme:");
            betrag = string.Format("{0:N2}", zwischenSumme);
            content.DrawText(fontDefault, 10D, xRightMargin - 1, lastPosition - 5, TextJustify.Right, DrawStyle.Underline, System.Drawing.Color.Black, betrag);
        }
        ////////////////////////////////////////////////////////////////////
        // Draw frame around example area
        ////////////////////////////////////////////////////////////////////

        private void DrawFrameAndBackgroundWaterMark
        (
            PdfContents Contents
        )
        {
            // save graphics state
            Contents.SaveGraphicsState();

            // Draw frame around the page
            // Set line width to 0.02"
            Contents.SetLineWidth(0.02);

            // set frame color dark blue
            Contents.SetColorStroking(Color.DarkBlue);

            // use water mark tiling pattern to fill the frame
            Contents.SetPatternNonStroking(WaterMark);

            // rectangle position: x=1.0", y=1.0", width=6.5", height=9.0"
            Contents.DrawRectangle(1.0, 1.0, 6.5, 9.0, PaintOp.CloseFillStroke);

            // restore graphics sate
            Contents.RestoreGraphicsState();

            // draw article name under the frame
            // Note: the \u00a4 is character 164 that was substituted during Font resource definition
            // this character is a solid circle it is normally unicode 9679 or \u25cf in the Arial family
            Contents.DrawText(ArialNormal, 9.0, 1.1, 0.85, "PdfFileWriter \u00a4 PDF File Writer C# Class Library \u00a4 Author: Uzi Granot");
            return;
        }
Exemplo n.º 5
0
        public void writePDF()
        {
            PdfDocument document = new PdfDocument(PaperType.A4, false, UnitOfMeasure.cm);

            // Step 3: Add new empty page
            PdfPage Page = new PdfPage(document);

            // Step 4: Add contents object to the page object
            PdfContents Contents = new PdfContents(Page);

            // Step 5: add graphics and text contents to the contents object
            TextBox Box = new TextBox(10, 5);

            // add text to the text box

            PdfFont font = new PdfFont(document, "Arial", FontStyle.Bold, true);

            Box.AddText(font, 12.0,
                        "This area is an example of displaying text that is too long to fit within a " +
                        "fixed width area. The text is displayed justified to right edge. You define a " +
                        "text box with the required width and first line indent. You add text to this " +
                        "box. The box will divide the text into lines. Each line is made of segments " +
                        "of text. For each segment, you define font, font size, drawing style and color. " +
                        "After loading all the text, the program will draw the formatted text.\n");
            Double PosY = 1.4;

            Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.015, 0.05, true, Box);

            // Step 6: create pdf file
            // argument: PDF file name
            string FileName = @"D:\MyPDFFile.pdf";

            document.CreateFile(FileName);
        }
Exemplo n.º 6
0
        /*
         * private Item FindItem(List<Item> source, string key) {
         *
         *  foreach (Item item in source)
         *  {
         *      if (item.Key == key)
         *      {
         *          return item;
         *      }
         *  }
         *  return null;
         * }
         */
        /*
         * private void DrawTime()
         * {
         *  Item timeitem = FindItem(PdfPassJson.EventTicket.HeaderFields, "datetime");
         *  string time = timeitem?.Label;
         *  string date = timeitem?.Value;
         *  DrawProperty(time, date, TextJustify.Right, 7.9, 10.6);
         *  return;
         * }
         */
        private void DrawProperty(string label, string value, TextJustify textalign, double posX, double posY)
        {
            // translate coordinate origin to the center of the picture
            Contents.SetColorNonStroking(Color.Black);

            Contents.DrawText(ArialNormal, 16.0, posX, posY, textalign, label);

            // save graphics state
            Contents.SaveGraphicsState();

            // change nonstroking (fill) color to purple
            Contents.SetColorNonStroking(Color.White);

            // Draw second line of heading text
            // arguments: Handwriting font, Font size 30 point, Position X=4.25", Y=9.0"
            // Text Justify: Center (text center will be at X position)
            Contents.DrawText(ArialNormal, 24.0, posX, posY - 0.4, textalign, value);

            // restore graphics sate (non stroking color will be restored to default)
            Contents.RestoreGraphicsState();
            return;
        }
        public void OnePage
        (
            int Cols,
            int Rows
        )
        {
            // Add new page
            PdfPage Page = new PdfPage(Document);

            // Add contents to page
            PdfContents Contents = new PdfContents(Page);

            double Left   = CenterX - 0.5 * Cols;
            double Right  = CenterX + 0.5 * Cols;
            double Top    = CenterY + 0.5 * Rows;
            double Bottom = CenterY - 0.5 * Rows;

            Contents.DrawText(ArialFont, FontSize, CenterX, Top + Descent + 0.2, TextJustify.Center, Cols == Rows ? "Square" : "Rectangle");

            // save state
            Contents.SaveGraphicsState();

            Contents.SetLineWidth(0.1);
            Contents.SetColorStroking(Color.Black);
            Contents.SetColorNonStroking(Color.LightBlue);
            Contents.DrawRectangle(Left, Bottom, Cols, Rows, PaintOp.CloseFillStroke);
            Contents.RestoreGraphicsState();

            Contents.SaveGraphicsState();
            Contents.SetLineWidth(0.04);
            for (int Row = 0; Row <= Rows; Row++)
            {
                Contents.DrawLine(Left - 0.25, Bottom + Row, Right, Bottom + Row);
                Contents.DrawText(ArialFont, FontSize, Left - 0.35, Bottom + Row - Descent, TextJustify.Right, Row.ToString());
            }

            for (int Col = 0; Col <= Cols; Col++)
            {
                Contents.DrawLine(Left + Col, Bottom - 0.25, Left + Col, Top);
                Contents.DrawText(ArialFont, FontSize, Left + Col, Bottom - 0.25 - FontHeight, TextJustify.Center, Col.ToString());
            }

            for (int Index = 0; Index < Rows * Cols; Index++)
            {
                int Row = Index / Cols;
                int Col = Index % Cols;
                Contents.DrawText(ArialFont, FontSize, Left + 0.5 + Col, Top - 0.5 - Descent - Row, TextJustify.Center, (Index + 1).ToString());
            }

            Contents.DrawText(ArialFont, FontSize, CenterX, Bottom - 1.0, TextJustify.Center, "Area");
            Contents.DrawText(ArialFont, FontSize, CenterX, Bottom - 1.4, TextJustify.Center, string.Format("{0} X {1} = {2}", Rows, Cols, Rows * Cols));

            // restore graphics state
            Contents.RestoreGraphicsState();
            return;
        }
Exemplo n.º 8
0
        void DrawSummary(PdfContents content, Offer offer)
        {
            content.SaveGraphicsState();

            // Textbox für Nettopreishinweis, Zahlungs- und Lieferbedingungen
            var    livingInABox = new TextBox(125);
            var    nl           = Environment.NewLine;
            string nettopreise  = "Alle angegebenen Preise in Euro, zuzüglich der gesetzlich gültigen Mehrwertsteuer.";

            livingInABox.AddText(fontDefault, 8.0, nettopreise + nl);
            livingInABox.AddText(fontDefault, 8.0, this.myOffer.Zahlungsbedingungen + nl);
            livingInABox.AddText(fontDefault, 8.0, this.myOffer.Customer.FocText);
            double yPosition = lastPosition - 4;

            content.DrawText(10.5, ref yPosition, 0.0, 0, 0.0, 1.2, TextBoxJustify.Left, livingInABox);

            string betrag;

            // Nettosumme
            content.DrawText(fontDefault, 10D, xSummary, lastPosition - 5, DrawStyle.Normal, "Summe (netto):");
            betrag = string.Format("{0:N2}", offer.NetAmount);
            content.DrawText(fontDefault, 10D, xRightMargin - 1, lastPosition - 5, TextJustify.Right, DrawStyle.Normal, System.Drawing.Color.Black, betrag);

            // USt.
            content.DrawText(fontDefault, 10D, xSummary, lastPosition - 9.2, DrawStyle.Normal, "USt. Betrag: (19%):");
            betrag = string.Format("{0:N2}", offer.TaxAmount);
            content.DrawText(fontDefault, 10D, xRightMargin - 1, lastPosition - 9.2, TextJustify.Right, DrawStyle.Normal, System.Drawing.Color.Black, betrag);

            // Angebotsbetrag
            content.DrawText(fontDefault, 10D, xSummary, lastPosition - 13.4, DrawStyle.Normal, "Angebotsbetrag:");
            betrag = string.Format("{0:N2}", offer.OfferTotal);
            content.DrawText(fontDefault, 10D, xRightMargin - 1, lastPosition - 13.4, TextJustify.Right, DrawStyle.Underline, System.Drawing.Color.Black, betrag);
            content.DrawText(fontDefault, 8D, xSummary, lastPosition - 17.6, TextJustify.Left, DrawStyle.Normal, System.Drawing.Color.DarkGray, "(Alle ausgewiesenen Beträge in Euro)");

            content.RestoreGraphicsState();
        }
        ////////////////////////////////////////////////////////////////////
        // Draw example of order form
        ////////////////////////////////////////////////////////////////////

        private void DrawBookOrderForm
        (
            PdfContents Contents
        )
        {
            // Order form simulation
            // Define constants to make the code readable
            // Define constants
            const Double Width        = 3.05;
            const Double Height       = 3.65;
            const Double Margin       = 0.04;
            const Double FontSize     = 9.0;
            Double       LineSpacing  = ArialNormal.LineSpacing(FontSize);
            Double       Descent      = ArialNormal.Descent(FontSize);
            Double       ColWidth1    = ArialNormal.TextWidth(FontSize, "9999.99") + 2 * Margin;
            Double       ColWidth2    = ArialNormal.TextWidth(FontSize, "Qty") + 2 * Margin;
            Double       Col4LinePosX = Width - ColWidth1;
            Double       Col3LinePosX = Col4LinePosX - ColWidth2;
            Double       Col2LinePosX = Col3LinePosX - ColWidth1;
            Double       Col1TextPosX = Margin;
            Double       Col2TextPosX = Col3LinePosX - Margin;
            Double       Col3TextPosX = Col4LinePosX - Margin;
            Double       Col4TextPosX = Width - Margin;

            // save graphics state
            Contents.SaveGraphicsState();

            // form line width 0.01"
            Contents.SetLineWidth(0.01);

            // Initial vertical position for contents
            Double PosY1 = Height - LineSpacing - 2 * Margin;

            // bottom of the contents area of the form
            Double PosY2 = 2 * Margin + 3 * LineSpacing;

            // shift origin, bottom left of the form to X=4.35" and Y=1.1"
            Contents.Translate(4.35, 1.1);

            // draw outline rectangle
            Contents.DrawRectangle(0.0, 0.0, Width, Height, PaintOp.CloseStroke);

            // draw two horizontal lines. under table heading and above total
            Contents.DrawLine(0, PosY1, Width, PosY1);
            Contents.DrawLine(0, PosY2, Width, PosY2);

            // draw three vertical lines separating the columns
            Contents.DrawLine(Col2LinePosX, Height, Col2LinePosX, PosY2);
            Contents.DrawLine(Col3LinePosX, Height, Col3LinePosX, PosY2);
            Contents.DrawLine(Col4LinePosX, Height, Col4LinePosX, 0);

            // draw table heading
            Double PosY = PosY1 + Margin + Descent;

            Contents.DrawText(ArialNormal, FontSize, Col1TextPosX, PosY, "Description");
            Contents.DrawText(ArialNormal, FontSize, Col2TextPosX, PosY, TextJustify.Right, "Price");
            Contents.DrawText(ArialNormal, FontSize, Col3TextPosX, PosY, TextJustify.Right, "Qty");
            Contents.DrawText(ArialNormal, FontSize, Col4TextPosX, PosY, TextJustify.Right, "Total");

            // reset order total
            Double Total = 0;

            // define text box for book title and author
            TextBox Box = new TextBox(Col2LinePosX - 2 * Margin);

            // initial vertical position
            PosY = PosY1 - Margin;

            // loop for all items in the order
            // Order class is a atabase simulation for this example
            foreach (Order Book in Order.OrderList)
            {
                // clear the text box
                Box.Clear();

                // add book title and authors to the box
                Box.AddText(ArialNormal, FontSize, Book.Title);
                Box.AddText(ArialNormal, FontSize, ". By: ");
                Box.AddText(ArialNormal, FontSize, Book.Authors);

                // draw the title and authors.
                // on exit, PosY will be for next line
                Contents.DrawText(Col1TextPosX, ref PosY, PosY2, 0, Box);

                // move PosY up to allow drawing cost on the same line as the last text line of the box
                PosY += Descent;

                // draw price quantity and item's total
                Contents.DrawText(ArialNormal, FontSize, Col2TextPosX, PosY, TextJustify.Right, Book.Price.ToString("#.00"));
                Contents.DrawText(ArialNormal, FontSize, Col3TextPosX, PosY, TextJustify.Right, Book.Qty.ToString());
                Contents.DrawText(ArialNormal, FontSize, Col4TextPosX, PosY, TextJustify.Right, Book.Total.ToString("#.00"));

                // update PosY for next item
                PosY -= Descent + 0.5 * LineSpacing;

                // accumulate total
                Total += Book.Total;
            }

            // draw total before tax
            PosY = PosY2 - Margin - ArialNormal.Ascent(FontSize);
            Contents.DrawText(ArialNormal, FontSize, Col3TextPosX, PosY, TextJustify.Right, "Total before tax");
            Contents.DrawText(ArialNormal, FontSize, Col4TextPosX, PosY, TextJustify.Right, Total.ToString("#.00"));

            // draw tax (Ontario Canada HST)
            PosY -= LineSpacing;
            Contents.DrawText(ArialNormal, FontSize, Col3TextPosX, PosY, TextJustify.Right, "Tax (13%)");
            Double Tax = Math.Round(0.13 * Total, 2, MidpointRounding.AwayFromZero);

            Contents.DrawText(ArialNormal, FontSize, Col4TextPosX, PosY, TextJustify.Right, Tax.ToString("#.00"));

            // draw final total
            PosY -= LineSpacing;
            Contents.DrawText(ArialNormal, FontSize, Col3TextPosX, PosY, TextJustify.Right, "Total payable");
            Total += Tax;
            Contents.DrawText(ArialNormal, FontSize, Col4TextPosX, PosY, TextJustify.Right, Total.ToString("#.00"));

            // restore graphics state
            Contents.RestoreGraphicsState();
            return;
        }
        ////////////////////////////////////////////////////////////////////
        // Draw example of a text box
        ////////////////////////////////////////////////////////////////////

        private void DrawTextBox
        (
            PdfContents Contents
        )
        {
            // save graphics state
            Contents.SaveGraphicsState();

            // translate origin to PosX=1.1" and PosY=1.1" this is the bottom left corner of the text box example
            Contents.Translate(1.1, 1.1);
//		Contents.TranslateScaleRotate(7.4, 1.1, 1.0, Math.PI / 2);

            // Define constants
            // Box width 3.25"
            // Box height is 3.65"
            // Normal font size is 9.0 points.
            const Double Width    = 3.15;
            const Double Height   = 3.65;
            const Double FontSize = 9.0;

            // Create text box object width 3.25"
            // First line indent of 0.25"
            TextBox Box = new TextBox(Width, 0.25);

            // add text to the text box
            Box.AddText(ArialNormal, FontSize,
                        "This area is an example of displaying text that is too long to fit within a fixed width " +
                        "area. The text is displayed justified to right edge. You define a text box with the required " +
                        "width and first line indent. You add text to this box. The box will divide the text into " +
                        "lines. Each line is made of segments of text. For each segment, you define font, font " +
                        "size, drawing style and color. After loading all the text, the program will draw the formatted text.\n");
            Box.AddText(TimesNormal, FontSize + 1.0, "Example of multiple fonts: Times New Roman, ");
            Box.AddText(Comic, FontSize, "Comic Sans MS, ");
            Box.AddText(ArialNormal, FontSize, "Example of regular, ");
            Box.AddText(ArialBold, FontSize, "bold, ");
            Box.AddText(ArialItalic, FontSize, "italic, ");
            Box.AddText(ArialBoldItalic, FontSize, "bold plus italic. ");
            Box.AddText(ArialNormal, FontSize - 2.0, "Arial size 7, ");
            Box.AddText(ArialNormal, FontSize - 1.0, "size 8, ");
            Box.AddText(ArialNormal, FontSize, "size 9, ");
            Box.AddText(ArialNormal, FontSize + 1.0, "size 10. ");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Underline, "Underline, ");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Strikeout, "Strikeout. ");
            Box.AddText(ArialNormal, FontSize, "Subscript H");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Subscript, "2");
            Box.AddText(ArialNormal, FontSize, "O. Superscript A");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(ArialNormal, FontSize, "+B");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(ArialNormal, FontSize, "=C");
            Box.AddText(ArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(ArialNormal, FontSize, "\n");
            Box.AddText(Comic, FontSize, Color.Red, "Lets add some color, ");
            Box.AddText(Comic, FontSize, Color.Green, "green, ");
            Box.AddText(Comic, FontSize, Color.Blue, "blue, ");
            Box.AddText(Comic, FontSize, Color.Orange, "orange, ");
            Box.AddText(Comic, FontSize, DrawStyle.Underline, Color.Purple, "and purple.\n");

            // Draw the text box
            // Text left edge is at zero (note: origin was translated to 1.1")
            // The top text base line is at Height less first line ascent.
            // Text drawing is limited to vertical coordinate of zero.
            // First line to be drawn is line zero.
            // After each line add extra 0.015".
            // After each paragraph add extra 0.05"
            // Stretch all lines to make smooth right edge at box width of 3.15"
            // After all lines are drawn, PosY will be set to the next text line after the box's last paragraph
            Double PosY = Height;

            Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.015, 0.05, true, Box);

            // Create text box object width 3.25"
            // No first line indent
            Box = new TextBox(Width);

            // Add text as before.
            // No extra line spacing.
            // No right edge adjustment
            Box.AddText(ArialNormal, FontSize,
                        "In the examples above this area the text box was set for first line indent of " +
                        "0.25 inches. This paragraph has zero first line indent and no right justify.");
            Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.01, 0.05, false, Box);

            // Create text box object width 2.75
            // First line hanging indent of 0.5"
            Box = new TextBox(Width - 0.5, -0.5);

            // Add text
            Box.AddText(ArialNormal, FontSize,
                        "This paragraph is set to first line hanging indent of 0.5 inches. " +
                        "The left margin of this paragraph is 0.5 inches.");

            // Draw the text
            // left edge at 0.5"
            Contents.DrawText(0.5, ref PosY, 0.0, 0, 0.01, 0.05, false, Box);

            // restore graphics state
            Contents.RestoreGraphicsState();
            return;
        }
Exemplo n.º 11
0
        ////////////////////////////////////////////////////////////////////
        // Draw frame around example area
        ////////////////////////////////////////////////////////////////////

        private void DrawFrameAndBackgroundWaterMark()
        {
            // save graphics state
            Contents.SaveGraphicsState();

            // Draw frame around the page
            // Set line width to 0.02"
            Contents.SetLineWidth(0.02);

            // set frame color dark blue
            Contents.SetColorStroking(Color.DarkBlue);

            // use water mark tiling pattern to fill the frame
            Contents.SetPatternNonStroking(WaterMark);

            // rectangle position: x=1.0", y=1.0", width=6.5", height=9.0"
            Contents.DrawRectangle(1.0, 1.0, 6.5, 9.0, PaintOp.CloseFillStroke);

            // restore graphics sate
            Contents.RestoreGraphicsState();

            // draw article name under the frame
            // Note: the \u00a4 is character 164 that was substituted during Font resource definition
            // this character is a solid circle it is normally Unicode 9679 or \u25cf in the Arial family
            Contents.DrawText(ArialNormal, 9.0, 1.1, 0.85, "PdfFileWriter \u25cf PDF File Writer C# Class Library \u25cf Author: Uzi Granot");

            // draw web link to the article
            Contents.DrawWebLink(Page, ArialNormal, 9.0, 7.4, 0.85, TextJustify.Right, DrawStyle.Underline, Color.Blue, "Click to view article",
                                 "http://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library-Version");

            return;
        }
Exemplo n.º 12
0
        public void Test
        (
            bool Debug,
            string InputFileName
        )
        {
            // create document
            using (Document = new PdfDocument(PaperType.Letter, false, UnitOfMeasure.Inch, InputFileName))
            {
                // set document page mode to open the layers panel
                Document.InitialDocDisplay = InitialDocDisplay.UseLayers;

                // define font
                ArialFont = PdfFont.CreatePdfFont(Document, "Arial", FontStyle.Bold);

                // open layer control object (in PDF terms optional content object)
                PdfLayers Layers = new PdfLayers(Document, "PDF layers group");

                // set layer panel to incluse all layers including ones that are not visible
                Layers.ListMode = ListMode.AllPages;

                // Add new page
                PdfPage Page = new PdfPage(Document);

                // Add contents to page
                PdfContents Contents = new PdfContents(Page);

                // heading
                Contents.DrawText(ArialFont, 24, 4.25, 10, TextJustify.Center, "PDF File Writer Layer Test/Demo");

                // define layers
                PdfLayer DrawingTest    = new PdfLayer(Layers, "Drawing Test");
                PdfLayer Rectangle      = new PdfLayer(Layers, "Rectangle");
                PdfLayer HorLines       = new PdfLayer(Layers, "Horizontal Lines");
                PdfLayer VertLines      = new PdfLayer(Layers, "Vertical Lines");
                PdfLayer QRCodeLayer    = new PdfLayer(Layers, "QRCode barcode");
                PdfLayer Pdf417Layer    = new PdfLayer(Layers, "PDF417 barcode");
                PdfLayer NoBarcodeLayer = new PdfLayer(Layers, "No barcode");

                // combine three layers into one group of radio buttons
                QRCodeLayer.RadioButton    = "Barcode";
                Pdf417Layer.RadioButton    = "Barcode";
                NoBarcodeLayer.RadioButton = "Barcode";

                // set the order of layers in the layer pane
                Layers.DisplayOrder(DrawingTest);
                Layers.DisplayOrder(Rectangle);
                Layers.DisplayOrder(HorLines);
                Layers.DisplayOrder(VertLines);
                Layers.DisplayOrderStartGroup("Barcode group");
                Layers.DisplayOrder(QRCodeLayer);
                Layers.DisplayOrder(Pdf417Layer);
                Layers.DisplayOrder(NoBarcodeLayer);
                Layers.DisplayOrderEndGroup();

                // start a group layer
                Contents.LayerStart(DrawingTest);

                // sticky note annotation
                PdfAnnotation StickyNote = Page.AddStickyNote(2.0, 9.0, "My sticky note", StickyNoteIcon.Note);
                StickyNote.LayerControl = DrawingTest;

                // draw a single layer
                Contents.LayerStart(Rectangle);
                Contents.DrawText(ArialFont, 14, 1.0, 8.0, TextJustify.Left, "Draw rectangle");
                Contents.LayerEnd();

                // draw a single layer
                Contents.LayerStart(HorLines);
                Contents.DrawText(ArialFont, 14, 1.0, 7.5, TextJustify.Left, "Draw horizontal lines");
                Contents.LayerEnd();

                // draw a single layer
                Contents.LayerStart(VertLines);
                Contents.DrawText(ArialFont, 14, 1.0, 7.0, TextJustify.Left, "Draw vertical lines");
                Contents.LayerEnd();

                double Left   = 4.0;
                double Right  = 7.0;
                double Top    = 9.0;
                double Bottom = 6.0;

                // draw a single layer
                Contents.LayerStart(Rectangle);
                Contents.SaveGraphicsState();
                Contents.SetLineWidth(0.1);
                Contents.SetColorStroking(Color.Black);
                Contents.SetColorNonStroking(Color.LightBlue);
                Contents.DrawRectangle(Left, Bottom, 3.0, 3.0, PaintOp.CloseFillStroke);
                Contents.RestoreGraphicsState();
                Contents.LayerEnd();

                // save graphics state
                Contents.SaveGraphicsState();

                // draw a single layer
                Contents.SetLineWidth(0.02);
                Contents.LayerStart(HorLines);
                for (int Row = 1; Row < 6; Row++)
                {
                    Contents.DrawLine(Left, Bottom + 0.5 * Row, Right, Bottom + 0.5 * Row);
                }
                Contents.LayerEnd();

                // draw a single layer
                Contents.LayerStart(VertLines);
                for (int Col = 1; Col < 6; Col++)
                {
                    Contents.DrawLine(Left + 0.5 * Col, Bottom, Left + 0.5 * Col, Top);
                }
                Contents.LayerEnd();

                // restore graphics state
                Contents.RestoreGraphicsState();

                // terminate a group of layers
                Contents.LayerEnd();

                // define QRCode barcode
                QREncoder QREncoder = new QREncoder();
                QREncoder.ErrorCorrection = ErrorCorrection.M;
                QREncoder.Encode(QRCodeArticle);
                PdfImage QRImage = new PdfImage(Document);
                QRImage.LoadImage(QREncoder);

                // define PDF417 barcode
                Pdf417Encoder Pdf417Encoder = new Pdf417Encoder();
                Pdf417Encoder.ErrorCorrection = ErrorCorrectionLevel.AutoMedium;
                Pdf417Encoder.Encode(Pdf417Article);
                PdfImage Pdf417Image = new PdfImage(Document);
                Pdf417Image.LoadImage(Pdf417Encoder);

                // draw a single layer
                Contents.LayerStart(QRCodeLayer);
                Contents.DrawText(ArialFont, 14, 1.0, 2.5, TextJustify.Left, "QRCode Barcode");
                Contents.DrawImage(QRImage, 3.7, 2.5 - 1.75, 3.5);
                Contents.LayerEnd();

                // draw a single layer
                Contents.LayerStart(Pdf417Layer);
                Contents.DrawText(ArialFont, 14, 1.0, 2.5, TextJustify.Left, "PDF417 Barcode");
                Contents.DrawImage(Pdf417Image, 3.7, 2.5 - 1.75 * Pdf417Encoder.ImageHeight / Pdf417Encoder.ImageWidth, 3.5);
                Contents.LayerEnd();

                // draw a single layer
                Contents.LayerStart(NoBarcodeLayer);
                Contents.DrawText(ArialFont, 14, 1.0, 3.0, TextJustify.Left, "Display no barcode");
                Contents.LayerEnd();

                // create pdf file
                Document.CreateFile();

                // start default PDF reader and display the file
                Process Proc = new Process();
                Proc.StartInfo = new ProcessStartInfo(InputFileName);
                Proc.Start();
            }
            return;
        }
Exemplo n.º 13
0
        public void appendTopHeader(string title, string logoPath, bool includeSecondLine = true, string assessmentType = "")
        {
            drawY -= .7;
            string logoDir = Path.GetDirectoryName(logoPath);

            PdfImage logo       = new PdfImage(doc, logoPath);
            double   logoHeight = .6;
            double   logoWidth  = logoHeight * logo.WidthPix / logo.HeightPix;

            // standard (left) header logo
            cont.DrawImage(logo, firstColumnHeaderX, drawY - .2, logoWidth, logoHeight);

            // right header logo
            string logoRight = Path.Combine(logoDir, "logo-right.png");

            if (File.Exists(logoRight))
            {
                PdfImage logoR = new PdfImage(doc, logoRight);
                cont.DrawImage(logoR, secondColumnHeaderX + 1.7, drawY + .05, logoWidth, logoHeight);
            }

            //cont.DrawText(logoFont, 50.0, firstColumnHeaderX, drawY, sisred, "AAIDD");
            double titleSize = includeSecondLine ? 10.0 : 15.0;
            double titleY    = includeSecondLine ? drawY + .15 : drawY + .07;

            cont.DrawText(boldFont, titleSize, 3.6, titleY, title);
            if (includeSecondLine)
            {
                // customize header text for SIS-A/C
                if (!String.IsNullOrEmpty(assessmentType))
                {
                    if (assessmentType == "SIS-A")
                    {
                        cont.DrawText(contentFont, 7.5, 3.6, drawY, "Confidential Interview and Profile Results for the Supports Intensity Scale Adult Version     : SIS-A");
                        cont.DrawText(contentFont, 5, 7.63, drawY + .03, "TM");
                        cont.DrawText(contentFont, 5, 8.09, drawY + .03, "TM");
                    }
                    if (assessmentType == "SIS-C")
                    {
                        cont.DrawText(contentFont, 7.5, 3.6, drawY, "Confidential Interview and Profile Results for the Supports Intensity Scale Children's Version     : SIS-C");
                        cont.DrawText(contentFont, 5, 7.85, drawY + .03, "TM");
                        cont.DrawText(contentFont, 5, 8.33, drawY + .03, "TM");
                    }
                }
                else
                {
                    cont.DrawText(contentFont, 7.5, 3.6, drawY, "Confidential Interview and Profile Results for the Supports Intensity Scale");
                }
            }
        }
Exemplo n.º 14
0
        public FileInfo CreateOfferDocument(Offer offer, bool asOrder = false, bool withPreview = true)
        {
            ResetVars();
            myOffer = offer;
            PdfDocument  doc;
            PdfPage      page;
            PdfContents  content;
            PdfImage     img;
            double       lineSpacing;
            double       descent;
            const double fontSize = 10.0;
            bool         isOffer  = (this.myOffer.Bestellkennzeichen | asOrder);

            string fullName = Path.Combine(CatalistRegistry.Application.OfferFilePath, offer.OfferId + ".pdf");

            doc       = new PdfDocument(PaperType.A4, false, UnitOfMeasure.mm, fullName);
            doc.Debug = false;
            page      = new PdfPage(doc);
            content   = new PdfContents(page);
            content.SetLineWidth(0.03);

            fontDefault    = new PdfFont(doc, "Calibri", System.Drawing.FontStyle.Regular, true);
            myFontBold     = new PdfFont(doc, "Calibri", System.Drawing.FontStyle.Bold, true);
            fontFooter     = new PdfFont(doc, "Calibri Light", System.Drawing.FontStyle.Regular, true);
            fontFooterBold = new PdfFont(doc, "Calibri Light", System.Drawing.FontStyle.Bold, true);
            fontPriceTotal = new PdfFont(doc, "Calibri Light", System.Drawing.FontStyle.Bold, true);

            lineSpacing = fontDefault.LineSpacing(fontSize);
            descent     = fontDefault.Descent(fontSize);

            // Header
            string imagePath = Path.Combine(CatalistRegistry.Application.PicturePath, "briefkopf.png");

            img = new PdfImage(doc, imagePath);
            content.DrawImage(img, 5, pageHeight - 27.9 - 5, 199.6, 27.4);
            content.DrawLine(xLeftMargin - 5, pageHeight - 27.9 - 5 - 2, xRightMargin + 5, pageHeight - 27.9 - 5 - 2);

            string absender = @"Cut & Print Media GmbH & Co. KG · Osterheide 9 · 49124 Georgsmarienhütte";

            content.DrawText(fontDefault, fontSize - 4, 18, pageHeight - 49.5, absender);
            content.DrawLine(18, pageHeight - 50.5, 84.5, pageHeight - 50.5, 0.1);
            content.DrawText(fontDefault, fontSize + 2, 18, pageHeight - 55, offer.Customer.CompanyName1);
            content.DrawText(fontDefault, fontSize + 2, 18, pageHeight - 65, offer.Customer.Street);
            string zipCity = string.Format("{0} {1}", offer.Customer.ZipCode, offer.Customer.City);

            content.DrawText(fontDefault, fontSize + 2, 18, pageHeight - 71, zipCity);

            string vorgang = isOffer ? "Bestellung" : "Angebot";

            content.DrawText(fontDefault, fontSize + 2, xVLine3 + 5, pageHeight - 55, "Kunden-Nr.:");
            content.DrawText(fontDefault, fontSize + 2, xVLine5 - 13, pageHeight - 55, offer.CustomerId.Substring(0, 5));
            content.DrawText(fontDefault, fontSize + 2, xVLine3 + 5, pageHeight - 60, vorgang + " Nr.:");
            content.DrawText(fontDefault, fontSize + 2, xVLine5 - 13, pageHeight - 60, offer.OfferId);
            content.DrawText(fontDefault, fontSize + 2, xVLine3 + 5, pageHeight - 65, "Datum:");
            content.DrawText(fontDefault, fontSize + 2, xVLine5 - 13, pageHeight - 65, offer.ChangeDate.ToShortDateString());
            content.DrawText(fontDefault, fontSize + 2, xVLine3 + 5, pageHeight - 70, "Bearbeitet von:");
            content.DrawText(fontDefault, fontSize + 2, xVLine5 - 13, pageHeight - 70, offer.ChangeUser);

            content.DrawText(myFontBold, fontSize + 2, 10, pageHeight - 96.5, vorgang + " " + offer.OfferId);

            var table = new PdfTable(page, content, fontDefault, 9);

            table.TableStartEvent += tab_TableStartEvent;
            table.TableEndEvent   += tab_TableEndEvent;
            table.TableArea        = new PdfRectangle(10D, 35D, 200D, pageHeight - 40);
            table.RowTopPosition   = pageHeight - 100D;           // 10cm vom oberen Rand
            table.SetColumnWidth(9D, 34D, 86D, 13D, 19D, 19D);
            table.HeaderOnEachPage = true;

            table.Header[colPos].Style           = table.HeaderStyle;
            table.Header[colPos].Style.Alignment = System.Drawing.ContentAlignment.MiddleRight;
            table.Header[colPos].Value           = "Pos.";

            table.Header[colArtNr].Value  = "Artikel-Nr.";
            table.Header[colArtBez].Value = "Artikelbezeichnung";

            table.Header[colMenge].Style           = table.HeaderStyle;
            table.Header[colMenge].Style.Alignment = System.Drawing.ContentAlignment.MiddleRight;
            table.Header[colMenge].Value           = "Menge";

            table.Header[colPreis].Style           = table.HeaderStyle;
            table.Header[colPreis].Style.Alignment = System.Drawing.ContentAlignment.MiddleRight;
            table.Header[colPreis].Value           = "Einzelpreis";

            table.Header[colGesamt].Style           = table.HeaderStyle;
            table.Header[colGesamt].Style.Alignment = System.Drawing.ContentAlignment.MiddleRight;
            table.Header[colGesamt].Value           = "Gesamtpreis";

            table.DefaultHeaderStyle.Font          = myFontBold;
            table.DefaultHeaderStyle.Alignment     = System.Drawing.ContentAlignment.TopLeft;
            table.DefaultHeaderStyle.MultiLineText = false;

            table.DefaultCellStyle.Font      = fontDefault;
            table.DefaultCellStyle.FontSize  = 9;
            table.DefaultCellStyle.Alignment = System.Drawing.ContentAlignment.TopLeft;

            table.Cell[colPos].Style           = table.CellStyle;
            table.Cell[colPos].Style.Alignment = System.Drawing.ContentAlignment.TopRight;

            table.Cell[colArtNr].Style = table.CellStyle;
            table.Cell[colArtNr].Style.TextBoxTextJustify = TextBoxJustify.Left;

            table.Cell[colArtBez].Style = table.CellStyle;
            table.Cell[colArtBez].Style.TextBoxTextJustify = TextBoxJustify.Left;

            table.Cell[colMenge].Style           = table.CellStyle;
            table.Cell[colMenge].Style.Format    = "#,##0";
            table.Cell[colMenge].Style.Alignment = System.Drawing.ContentAlignment.TopRight;

            table.Cell[colPreis].Style           = table.CellStyle;
            table.Cell[colPreis].Style.Format    = "#,##0.00";
            table.Cell[colPreis].Style.Alignment = System.Drawing.ContentAlignment.TopRight;

            table.Cell[colGesamt].Style = table.CellStyle;
            table.Cell[colGesamt].Style.ForegroundColor = System.Drawing.Color.DarkRed;
            table.Cell[colGesamt].Style.Format          = "#,##0.00";
            table.Cell[colGesamt].Style.Alignment       = System.Drawing.ContentAlignment.TopRight;

            int dCount = offer.OfferDetails.Count;

            for (int i = 0; i < dCount; i++)
            {
                lastRow |= i == dCount - 1;

                table.Cell[colPos].Value   = offer.OfferDetails[i].Position;
                table.Cell[colArtNr].Value = offer.OfferDetails[i].Artikelnummer;
                TextBox txtBezeichnung = table.Cell[colArtBez].CreateTextBox();
                txtBezeichnung.AddText(myFontBold, 9, offer.OfferDetails[i].Artikelname);
                if (!isOffer)
                {
                    txtBezeichnung.AddText(fontDefault, 9, string.Format("\n\n{0}", offer.OfferDetails[i].Artikeltext.Replace("\t", " ")));
                }
                table.Cell[colMenge].Value = string.Format("{0:#,##0} {1}", offer.OfferDetails[i].Menge, offer.OfferDetails[i].Einheit);

                if (!isOffer)
                {
                    table.Cell[colPreis].Value  = offer.OfferDetails[i].Kundenpreis;
                    table.Cell[colGesamt].Value = offer.OfferDetails[i].Zeilensumme;
                    zwischenSumme += offer.OfferDetails[i].Zeilensumme;
                }
                else
                {
                    table.Cell[colPreis].Value  = "-";
                    table.Cell[colGesamt].Value = "-";
                }
                table.DrawRow(offer.OfferDetails[i].NeueSeite);
            }
            table.Close();

            try
            {
                doc.CreateFile();
                if (File.Exists(fullName) && withPreview)
                {
                    // Datei in das lokale TEMP Verzeichnis kopieren
                    var    temp            = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    string prefix          = asOrder ? "B" : "A";
                    var    tempFilename    = string.Format("{0}{1}.pdf", prefix, DateTime.Now.ToString("yyyy-MM-dd_hh.mm.ss"));
                    var    tempFileAndPath = Path.Combine(temp, tempFilename);
                    File.Copy(fullName, tempFileAndPath);
                    var proc = new Process();
                    proc.StartInfo = new ProcessStartInfo(tempFileAndPath);
                    proc.Start();
                }

                return(new FileInfo(fullName));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 15
0
        void DrawFooter(PdfContents content, PdfFont font)
        {
            content.SaveGraphicsState();
            // Persönlich haftende Gesellschafterin
            content.DrawText(this.myFontBold, 8, 5, 20.5, "Persönlich haftende Gesellschafterin");
            content.DrawText(font, 8, 5, 17, "Cut & Print Media GmbH & Co. KG");
            content.DrawText(font, 8, 5, 14, "Geschäftsführer: Felix Deutz");
            content.DrawText(font, 8, 5, 11, "USt.-ID: DE 814 912 333");
            content.DrawText(font, 8, 5, 8, "HRA 200901");
            content.DrawText(font, 8, 5, 5, "http://www.cut-print.de");

            // Handelsregister
            content.DrawText(this.myFontBold, 8, xFTab1, 20.5, "Handelsregister");
            content.DrawText(font, 8, xFTab1, 17, "Amtsgericht Osnabrück");
            content.DrawText(font, 8, xFTab1, 14, "HRB 201534");
            content.DrawText(font, 8, xFTab1, 11, "St-Nr.: 65/207/16220");

            // Bankverbindung
            content.DrawText(this.myFontBold, 8, xFTab2, 20.5, "Bankverbindung");
            content.DrawText(font, 8, xFTab2, 17, "Volksbank Georgsmarienhütte");
            content.DrawText(font, 8, xFTab2, 14, "BLZ: 265 659 28");
            content.DrawText(font, 8, xFTab2, 11, "Konto: 500 5555 000");
            content.DrawText(font, 8, xFTab2, 8, "IBAN: DE06 265 659 28 500 5555 000");
            content.DrawText(font, 8, xFTab2, 5, "SWIFT Code: GENODEF1HGM");

            // AGB
            content.DrawText(this.myFontBold, 8, xFTab3, 20.5, "AGB");
            content.DrawText(font, 8, xFTab3, 17, "Für alle unsere Angebote, Kaufverträge");
            content.DrawText(font, 8, xFTab3, 14, "und rechtsgeschäftlichen Erklärungen");
            content.DrawText(font, 8, xFTab3, 11, "gelten unsere allgemeinen");
            content.DrawText(font, 8, xFTab3, 8, "Geschäftsbedingungen");
        }
Exemplo n.º 16
0
        // Draw example of a text box
        private static void DrawTextBox(PdfDocument document, PdfPage page)
        {
            PdfContents zContents = new PdfContents(page);

            PdfFont zArialNormal = new PdfFont(document, "Arial", FontStyle.Regular, true);

            zArialNormal.CharSubstitution(945, 950, 161);

            // Save graphics state:
            zContents.SaveGraphicsState();

            // translate origin to PosX=1.1" and PosY=1.1" this is the bottom left corner of the text box example
            zContents.Translate(1.1, 1.1);

            // Define constants
            // Box width 3.25"
            // Box height is 3.65"
            // Normal font size is 9.0 points.
            const Double Width    = 3.15;
            const Double Height   = 3.65;
            const Double FontSize = 9.0;

            // Create text box object width 3.25"
            // First line indent of 0.25"
            TextBox Box = new TextBox(Width, 0.25);

            // add text to the text box
            Box.AddText(zArialNormal, FontSize,
                        "This area is an example of displaying text that is too long to fit within a fixed width " +
                        "area. The text is displayed justified to right edge. You define a text box with the required " +
                        "width and first line indent. You add text to this box. The box will divide the text into " +
                        "lines. Each line is made of segments of text. For each segment, you define font, font " +
                        "size, drawing style and color. After loading all the text, the program will draw the formatted text.\n");

            Box.AddText(zArialNormal, FontSize - 2.0, "Arial size 7, ");
            Box.AddText(zArialNormal, FontSize - 1.0, "size 8, ");
            Box.AddText(zArialNormal, FontSize, "size 9, ");
            Box.AddText(zArialNormal, FontSize + 1.0, "size 10. ");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Underline, "Underline, ");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Strikeout, "Strikeout. ");
            Box.AddText(zArialNormal, FontSize, "Subscript H");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Subscript, "2");
            Box.AddText(zArialNormal, FontSize, "O. Superscript A");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(zArialNormal, FontSize, "+B");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(zArialNormal, FontSize, "=C");
            Box.AddText(zArialNormal, FontSize, DrawStyle.Superscript, "2");
            Box.AddText(zArialNormal, FontSize, "\n");

            Box.AddText(zArialNormal, FontSize, "\n");

            // Draw the text box
            // Text left edge is at zero (note: origin was translated to 1.1")
            // The top text base line is at Height less first line ascent.
            // Text drawing is limited to vertical coordinate of zero.
            // First line to be drawn is line zero.
            // After each line add extra 0.015".
            // After each paragraph add extra 0.05"
            // Stretch all lines to make smooth right edge at box width of 3.15"
            // After all lines are drawn, PosY will be set to the next text line after the box's last paragraph
            Double PosY = Height;

            zContents.DrawText(0.0, ref PosY, 0.0, 0, 0.015, 0.05, TextBoxJustify.FitToWidth, Box);

            // Create text box object width 3.25"
            // No first line indent
            Box = new TextBox(Width);

            // Add text as before.
            // No extra line spacing.
            // No right edge adjustment
            Box.AddText(zArialNormal, FontSize,
                        "In the examples above this area the text box was set for first line indent of " +
                        "0.25 inches. This paragraph has zero first line indent and no right justify.");
            zContents.DrawText(0.0, ref PosY, 0.0, 0, 0.01, 0.05, TextBoxJustify.Left, Box);

            // Create text box object width 2.75
            // First line hanging indent of 0.5"
            Box = new TextBox(Width - 0.5, -0.5);

            // Add text
            Box.AddText(zArialNormal, FontSize,
                        "This paragraph is set to first line hanging indent of 0.5 inches. " +
                        "The left margin of this paragraph is 0.5 inches.");

            // Draw the text
            // left edge at 0.5"
            zContents.DrawText(0.5, ref PosY, 0.0, 0, 0.01, 0.05, TextBoxJustify.Left, Box);

            // restore graphics state
            zContents.RestoreGraphicsState();
        }
Exemplo n.º 17
0
        ////////////////////////////////////////////////////////////////////
        // create base contents for all pages
        ////////////////////////////////////////////////////////////////////
        /// <summary>
        /// ovde se kreira naslov svake strane, zaglavlje tabele kao i same ivice tabela
        /// </summary>
        public void CreateBaseContents()
        {
            // create unattached contents
            BaseContents = new PdfContents(Document);

            // save graphics state
            BaseContents.SaveGraphicsState();


            // restore graphics state
            BaseContents.RestoreGraphicsState();

            BaseContents.DrawText(ArialBold, 14, 0.5 * PageWidth, 11.5, TextJustify.Center, "IZVEŠTAJ O ISPITIVANJU MEHANIČKIH OSOBINA");

            //draw logo
            PdfImage Image2 = new PdfImage(Document, System.Environment.CurrentDirectory + "\\logoLjig.png");

            //BaseContents.DrawImage(Image1, 0.95, p1.Y - 3.8, ImageSize.Width - 1, ImageSize.Height);
            BaseContents.DrawImage(Image2, 8.5, 7.7, 1.4, 0.7);


            BaseContents.DrawText(ArialNormal, 8, 0.48, 7.85, TextJustify.Left, "BR. ZB. IZVEŠTAJA ");
            BaseContents.DrawLine(1.6, 8.0, 2.3, 8.0);
            BaseContents.DrawLine(1.6, 7.8, 2.3, 7.8);
            BaseContents.DrawLine(1.6, 8.0, 1.6, 7.8);
            BaseContents.DrawLine(2.3, 8.0, 2.3, 7.8);
            BaseContents.DrawText(ArialNormal, 8, 1.6, 7.85, TextJustify.Left, _sumReport.Records[0].BrzbIzvestaja);

            //horizontal lines
            BaseContents.DrawLine(0.45, 7.6, 10.8, 7.6);
            //BaseContents.DrawLine(0.45, 7.4, 10.8, 7.4);
            BaseContents.DrawLine(0.45, 7.2, 10.8, 7.2);
            BaseContents.DrawLine(0.45, 7.0, 10.8, 7.0);
            BaseContents.DrawLine(0.45, 6.8, 10.8, 6.8);
            BaseContents.DrawLine(0.45, 6.6, 10.8, 6.6);
            BaseContents.DrawLine(0.45, 6.4, 10.8, 6.4);
            BaseContents.DrawLine(0.45, 6.2, 10.8, 6.2);
            BaseContents.DrawLine(0.45, 6.0, 10.8, 6.0);
            BaseContents.DrawLine(0.45, 5.8, 10.8, 5.8);
            BaseContents.DrawLine(0.45, 5.6, 10.8, 5.6);
            BaseContents.DrawLine(0.45, 5.4, 10.8, 5.4);
            BaseContents.DrawLine(0.45, 5.2, 10.8, 5.2);
            BaseContents.DrawLine(0.45, 5.0, 10.8, 5.0);
            BaseContents.DrawLine(0.45, 4.8, 10.8, 4.8);
            BaseContents.DrawLine(0.45, 4.6, 10.8, 4.6);
            BaseContents.DrawLine(0.45, 4.4, 10.8, 4.4);
            BaseContents.DrawLine(0.45, 4.2, 10.8, 4.2);
            BaseContents.DrawLine(0.45, 4.0, 10.8, 4.0);
            BaseContents.DrawLine(0.45, 3.8, 10.8, 3.8);
            BaseContents.DrawLine(0.45, 3.6, 10.8, 3.6);
            BaseContents.DrawLine(0.45, 3.4, 10.8, 3.4);
            BaseContents.DrawLine(0.45, 3.2, 10.8, 3.2);
            BaseContents.DrawLine(0.45, 3.0, 10.8, 3.0);
            BaseContents.DrawLine(0.45, 2.8, 10.8, 2.8);
            BaseContents.DrawLine(0.45, 2.6, 10.8, 2.6);
            BaseContents.DrawLine(0.45, 2.4, 10.8, 2.4);
            BaseContents.DrawLine(0.45, 2.2, 10.8, 2.2);
            BaseContents.DrawLine(0.45, 2.0, 10.8, 2.0);
            BaseContents.DrawLine(0.45, 1.8, 10.8, 1.8);
            BaseContents.DrawLine(0.45, 1.6, 10.8, 1.6);
            BaseContents.DrawLine(0.45, 1.4, 10.8, 1.4);
            BaseContents.DrawLine(0.45, 1.2, 10.8, 1.2);
            //BaseContents.DrawLine(0.45, 1.0, 10.8, 1.0);//31st row
            //BaseContents.DrawLine(0.45, 0.8, 10.8, 0.8);//32nd row
            //BaseContents.DrawLine(0.45, 0.6, 10.8, 0.6);//33th row
            //BaseContents.DrawLine(0.45, 0.4, 10.8, 0.4);//34th row

            //vertical two lines
            //BaseContents.DrawLine(0.45, 7.6, 0.45, 0.4);//this is for 34 rows per page
            //BaseContents.DrawLine(10.8, 7.6, 10.8, 0.4);

            BaseContents.DrawLine(0.45, 7.6, 0.45, 1.2);
            BaseContents.DrawLine(10.8, 7.6, 10.8, 1.2);

            //header
            BaseContents.DrawLine(0.75, 7.6, 0.75, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 0.48, 7.42, TextJustify.Left, "RED.");
            BaseContents.DrawText(ArialNormal, 8, 0.48, 7.24, TextJustify.Left, "BR.");
            BaseContents.DrawLine(1.45 + 0.2125, 7.6, 1.45 + 0.2125, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 1.00, 7.42, TextJustify.Left, "BROJ" /*"POLAZNI"*/);
            BaseContents.DrawText(ArialNormal, 8, 1.00, 7.24, TextJustify.Left, "UZORKA" /*"KVALITET"*/);
            BaseContents.DrawLine(2.15 + 2 * 0.2125, 7.6, 2.15 + 2 * 0.2125, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 1.95, 7.32, TextJustify.Left, "ŠARŽA" /*"NAZIVNA"*/);
            //BaseContents.DrawText(ArialNormal, 8, 1.75, 7.24, TextJustify.Left, "DEBLJINA");
            //BaseContents.DrawLine(3.8, 7.6, 3.8, 7.2);
            //BaseContents.DrawText(ArialNormal, 8, 2.67, 7.42, TextJustify.Left, "ISPITIVAČ");
            BaseContents.DrawLine(4.5 - 0.7125, 7.6, 4.5 - 0.7125, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 2.95, 7.42, TextJustify.Left, "POLAZNI" /*"BROJ"*/);
            BaseContents.DrawText(ArialNormal, 8, 2.95, 7.24, TextJustify.Left, "KVALITET" /*"UZORKA"*/);
            BaseContents.DrawLine(4.6, 7.6, 4.6, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 3.95, 7.42, TextJustify.Left, "NAZIVNA" /*"ŠARŽA"*/);
            BaseContents.DrawText(ArialNormal, 8, 3.95, 7.24, TextJustify.Left, "DEBLJINA" /*"ŠARŽA"*/);
            //BaseContents.DrawLine(8.5, 7.6, 8.5, 7.2);//vertical line na kraju mehanicko tehnickih osobina
            BaseContents.DrawLine(8.5, 7.4, 8.5, 7.2); // samo za A ne za sve jel smo dodali Z
            BaseContents.DrawLine(4.6, 7.4, 9.4, 7.4); //horizontal line
            BaseContents.DrawText(ArialNormal, 8.5, 6.0, 7.45, TextJustify.Left, "MEHANIČKO-TEHNIČKE OSOBINE");


            BaseContents.DrawText(ArialNormal, 8, 7.45 /*4.65*/, 7.24, TextJustify.Left, "Rm[MPa]");
            BaseContents.DrawLine(5.2 + 0.00, 7.4, 5.2 + 0.00, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 4.65 /*5.28*/, 7.24, TextJustify.Left, "R");
            BaseContents.DrawText(ArialNormal, 6.5, 4.73 /*5.36*/, 7.24, TextJustify.Left, "p0.2");
            BaseContents.DrawText(ArialNormal, 8, 4.92 /*5.55*/, 7.24, TextJustify.Left, "[MPa]");
            BaseContents.DrawLine(5.9 + 0.00, 7.4, 5.9 + 0.00, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 5.28 /*5.98*/, 7.24, TextJustify.Left, "R");
            BaseContents.DrawText(ArialNormal, 6.5, 5.36 /*6.05*/, 7.24, TextJustify.Left, "t0.5");
            BaseContents.DrawText(ArialNormal, 8, 5.55 /*6.24*/, 7.24, TextJustify.Left, "[MPa]");
            BaseContents.DrawLine(6.6 + 2 * 0.00, 7.4, 6.6 + 2 * 0.00, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 6.0 /*6.7*/, 7.24, TextJustify.Left, "ReL[MPa]");
            BaseContents.DrawLine(7.3 + 3 * 0.00, 7.4, 7.3 + 3 * 0.00, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 6.7 /*7.41*/, 7.24, TextJustify.Left, "ReH[MPa]");
            BaseContents.DrawLine(8.0 + 4 * 0.00, 7.4, 8.0 + 4 * 0.00, 7.2);
            //BaseContents.DrawLine(8.7, 7.4, 8.7, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 8.05, 7.24, TextJustify.Left, "A[%]");
            BaseContents.DrawLine(9.0 + 4 * 0.00, 7.6, 9.0 + 4 * 0.00, 7.2);//za kraj mehanicko tehnickih osobina vertikalna linija
            BaseContents.DrawText(ArialNormal, 8, 9.15, 7.24, TextJustify.Left, "KV[J]");
            BaseContents.DrawLine(9.6 + 4 * 0.00, 7.4, 9.6 + 4 * 0.00, 7.2);
            BaseContents.DrawText(ArialNormal, 8, 9.75, 7.24, TextJustify.Left, "KU[J]");
            BaseContents.DrawLine(10.2 + 4 * 0.00, 7.4, 10.2 + 4 * 0.00, 7.2);
            //BaseContents.DrawLine(9.4, 7.4, 9.4, 7.2);
            //BaseContents.DrawText(ArialNormal, 8, 9.0, 7.24, TextJustify.Left, "At");
            //BaseContents.DrawLine(10.8, 7.6, 10.8, 7.4);//vertical line
            BaseContents.DrawLine(9.4, 7.4, 10.8, 7.4);//horizontal line
            //BaseContents.DrawText(ArialNormal, 8, 9.45, 7.42, TextJustify.Left, "FAKTOR");
            //BaseContents.DrawLine(10.2, 7.6, 10.2, 7.2);//faktor
            BaseContents.DrawText(ArialNormal, 8, 10.5, 7.24, TextJustify.Left, "n");
            BaseContents.DrawText(ArialNormal, 8, 8.6, 7.24, TextJustify.Left, "Z[%]");
            //BaseContents.DrawText(ArialNormal, 8, 0.5, 7.05, TextJustify.Left, "NAPOMENATEST");


            //BaseContents.DrawLine(0.75, 7.4, 0.75, 7.2);
            //BaseContents.DrawLine(1.45, 7.4, 1.45, 7.2);
            //BaseContents.DrawLine(2.15, 7.4, 2.15, 7.2);
            //BaseContents.DrawLine(3.8, 7.4, 3.8, 7.2);

            BaseContents.DrawText(ArialNormal, 8, 0.45, 0.25, TextJustify.Left, "VERIFIKOVAO");
            BaseContents.DrawLine(1.3, 0.2, 5, 0.2);//horizontal line

            BaseContents.DrawText(ArialNormal, 8, 7, 0.25, TextJustify.Left, "ISPITIVAČ");
            BaseContents.DrawLine(7.8, 0.4, 9.8, 0.4);
            BaseContents.DrawLine(7.8, 0.2, 7.8, 0.4);
            BaseContents.DrawLine(9.8, 0.2, 9.8, 0.4);
            BaseContents.DrawLine(7.8, 0.2, 9.8, 0.2);
            BaseContents.DrawText(ArialNormal, 8, 7.8 + 0.01, 0.25, TextJustify.Left, _sumReport.Records[0].Ispitivac);//u jednom zbirnom izvestaju treba da ima samo jedan ispitivac

            // exit
            return;
        }
Exemplo n.º 18
0
        ////////////////////////////////////////////////////////////////////
        // Create charting examples PDF document
        ////////////////////////////////////////////////////////////////////

        public void Test
        (
            Boolean Debug,
            String FileName
        )
        {
            // Step 1: Create empty document
            // Arguments: page width: 8.5”, page height: 11”, Unit of measure: inches
            // Return value: PdfDocument main class
            Document = new PdfDocument(PaperType.Letter, false, UnitOfMeasure.Inch, FileName);

            // Debug property
            // By default it is set to false. Use it for debugging only.
            // If this flag is set, PDF objects will not be compressed, font and images will be replaced
            // by text place holder. You can view the file with a text editor but you cannot open it with PDF reader.
            Document.Debug = Debug;

            // for encryption test
//		Document.SetEncryption("Password", Permission.All & ~Permission.Print);

            ArialNormal = new PdfFont(Document, "Arial", FontStyle.Regular, true);
            Comic       = new PdfFont(Document, "Comic Sans MS", FontStyle.Bold, true);

            // Step 3: Add new page
            Page = new PdfPage(Document);

            // Step 4:Add contents to page
            PdfContents Contents = new PdfContents(Page);

            // save graphics state
            Contents.SaveGraphicsState();

            // Draw frame around the page
            // Set line width to 0.02"
            Contents.SetLineWidth(0.02);

            // set frame color dark blue
            Contents.SetColorStroking(Color.DarkBlue);
            Contents.SetColorNonStroking(Color.FromArgb(240, 250, 250));

            // rectangle position: x=1.0", y=1.0", width=6.5", height=9.0"
            Contents.DrawRectangle(1.0, 1.0, 6.5, 9.0, PaintOp.CloseFillStroke);
            Contents.DrawLine(1.0, 8.5, 7.5, 8.5);
            Contents.DrawLine(1.0, 6.0, 7.5, 6.0);
            Contents.DrawLine(1.0, 3.5, 7.5, 3.5);

            // page heading
            Contents.DrawText(Comic, 40.0, 4.25, 9.25, TextJustify.Center, 0.02, Color.FromArgb(128, 0, 255), Color.FromArgb(255, 0, 128), "PDF FILE WRITER");

            // change nonstroking (fill) color to purple
            Contents.SetColorNonStroking(Color.Purple);

            // Draw second line of heading text
            // arguments: Handwriting font, Font size 30 point, Position X=4.25", Y=9.0"
            // Text Justify: Center (text center will be at X position)
            Contents.DrawText(Comic, 30.0, 4.25, 8.75, TextJustify.Center, "Media Example");

            // create embedded media file
            Example1();
            Example2();

            // restore graphics sate (non stroking color will be restored to default)
            Contents.RestoreGraphicsState();

            // create the PDF file
            Document.CreateFile();

            // start default PDF reader and display the file
            Process Proc = new Process();

            Proc.StartInfo = new ProcessStartInfo(FileName);
            Proc.Start();

            // exit
            return;
        }
Exemplo n.º 19
0
        /// <summary>
        /// ovde se samo popunjavaju odgovarajuce vrednosti na osnovu sadrzaja odgorvarajuceg XML fajla
        /// samo ide DrawText u ovoj metodi
        /// </summary>
        public void CreatePagesContents()
        {
            int pagenumber         = (_sumReport.Records.Count + numOfRemarks) / numOfRowPerPage + 1;
            int ordNumber          = 1;
            int currNumberOfRemark = 0;
            int ii = 72;

            for (int i = 0; i < pagenumber; i++)
            {
                Contents = AddPageToDocument(1);
                for (int j = 0; j < numOfRowPerPage; j++)
                {
                    if (rows.Count == i * numOfRowPerPage + j)
                    {
                        break;
                    }

                    if (rows[i * numOfRowPerPage + j] == true)
                    {
                        Contents.DrawLine(0.75, 0.1 * (ii - 2 * j), 0.75, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(1.45 + 0.2125, 0.1 * (ii - 2 * j), 1.45 + 0.2125, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(2.15 + 2 * 0.2125, 0.1 * (ii - 2 * j), 2.15 + 2 * 0.2125, 0.1 * (ii - 2 * j - 2));
                        //Contents.DrawLine(3.8, 0.1 * (ii - 2 * j), 3.8, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(4.5 - 0.7125, 0.1 * (ii - 2 * j), 4.5 - 0.7125, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(4.6, 0.1 * (ii - 2 * j), 4.6, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(5.2, 0.1 * (ii - 2 * j), 5.2, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(5.9 + 0.00, 0.1 * (ii - 2 * j), 5.9 + 0.00, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(6.6 + 2 * 0.00, 0.1 * (ii - 2 * j), 6.6 + 2 * 0.00, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(7.3 + 3 * 0.00, 0.1 * (ii - 2 * j), 7.3 + 3 * 0.00, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(8.0 + 4 * 0.00, 0.1 * (ii - 2 * j), 8.0 + 4 * 0.00, 0.1 * (ii - 2 * j - 2));
                        //Contents.DrawLine(8.7, 0.1 * (ii - 2 * j), 8.7, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(8.5, 0.1 * (ii - 2 * j), 8.5, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(10.2, 0.1 * (ii - 2 * j), 10.2, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(9.60, 0.1 * (ii - 2 * j), 9.60, 0.1 * (ii - 2 * j - 2));
                        Contents.DrawLine(9.0, 0.1 * (ii - 2 * j), 9.0, 0.1 * (ii - 2 * j - 2));

                        Contents.DrawText(ArialNormal, 8, 0.50 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, ordNumber.ToString());
                        //Contents.DrawText(ArialNormal, 8, 0.80 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].PolazniKvalitet);
                        Contents.DrawText(ArialNormal, 8, 0.80 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrUzorka);
                        //Contents.DrawText(ArialNormal, 8, 1.50 + 0.2125 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].NazivnaDebljina);
                        Contents.DrawText(ArialNormal, 8, 1.50 + 0.2125 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Sarza);
                        //Contents.DrawText(ArialNormal, 8, 2.15 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Ispitivac);
                        //Contents.DrawText(ArialNormal, 8, 2.20 + 2 * 0.2125 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrUzorka);
                        Contents.DrawText(ArialNormal, 8, 2.20 + 2 * 0.2125 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].PolazniKvalitet);
                        //Contents.DrawText(ArialNormal, 8, 4.55 - 0.7425 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Sarza);
                        Contents.DrawText(ArialNormal, 8, 4.55 - 0.7425 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].NazivnaDebljina);
                        Contents.DrawText(ArialNormal, 8, 7.35 /*4.65*/ + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Rm);
                        Contents.DrawText(ArialNormal, 8, 4.65 /*5.25*/ + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Rp02);
                        Contents.DrawText(ArialNormal, 8, 5.25 /*5.95*/ + 0.00 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Rt05);
                        Contents.DrawText(ArialNormal, 8, 5.95 /*6.65*/ + 2 * 0.00 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].ReL);
                        Contents.DrawText(ArialNormal, 8, 6.65 /*7.35*/ + 3 * 0.00 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].ReH);
                        Contents.DrawText(ArialNormal, 8, 8.05 + 4 * 0.00 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].A);
                        //Contents.DrawText(ArialNormal, 8, 8.7 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].At);
                        Contents.DrawText(ArialNormal, 8, 10.25, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].N);
                        Contents.DrawText(ArialNormal, 8, 8.55 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].Z);
                        if (_sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrUzorka.EndsWith("/1") == true)
                        {
                            Contents.DrawText(ArialNormal, 8, 9.05, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, KV(_sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrzbIzvestaja, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrUzorka));
                            Contents.DrawText(ArialNormal, 8, 9.65, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, KU(_sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrzbIzvestaja, _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark].BrUzorka));
                        }
                        ordNumber++;
                    }
                    else
                    {
                        Contents.DrawText(ArialBold, 8, 0.45 + 0.01, 0.1 * (ii - 2 * j - 2) + 0.05, TextJustify.Left, "Napomena za br. uzorka " + _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark - 1].BrUzorka + ":" + _sumReport.Records[i * numOfRowPerPage + j - currNumberOfRemark - 1].Napomena);
                        currNumberOfRemark++;
                    }
                    ////rest of vertical lines
                    //for (int ii = 72; ii >= 6; )
                    //{
                    //    BaseContents.DrawLine(0.75, 0.1 * ii, 0.75, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(1.45, 0.1 * ii, 1.45, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(2.15, 0.1 * ii, 2.15, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(3.8, 0.1 * ii, 3.8, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(4.5, 0.1 * ii, 4.5, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(5.2, 0.1 * ii, 5.2, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(5.9, 0.1 * ii, 5.9, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(6.6, 0.1 * ii, 6.6, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(7.3, 0.1 * ii, 7.3, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(8.0, 0.1 * ii, 8.0, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(8.7, 0.1 * ii, 8.7, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(9.4, 0.1 * ii, 9.4, 0.1 * (ii - 2));
                    //    BaseContents.DrawLine(10.1, 0.1 * ii, 10.1, 0.1 * (ii - 2));
                    //    i = i - 2;
                    //}
                }
            }
            //Contents.DrawText(ArialBold, 14, 0.05 * PageWidth, PageHeight - Margin - (HeadingHeight - ArialBold.CapHeight(24)) / 2, TextJustify.Left, "IZVEŠTAJ O ISPITIVANJU MEHANIČKIH OSOBINA");
        }