예제 #1
0
 public void DrawLine(float x1, float y1, float x2, float y2, float th, PdfColor stroke)
 {
     InnerWrite("ET\nq\n" + stroke.getColorSpaceOut(false)
                + PdfNumber.doubleOut(x1 / 1000f) + " " + PdfNumber.doubleOut(y1 / 1000f) + " m "
                + PdfNumber.doubleOut(x2 / 1000f) + " " + PdfNumber.doubleOut(y2 / 1000f) + " l "
                + PdfNumber.doubleOut(th / 1000f) + " w S\n" + "Q\nBT\n");
 }
예제 #2
0
 public void DrawAndFillRect(float x, float y, float w, float h, PdfColor stroke, PdfColor fill)
 {
     InnerWrite("ET\nq\n" + fill.getColorSpaceOut(true)
                + stroke.getColorSpaceOut(false) + PdfNumber.doubleOut(x / 1000f)
                + " " + PdfNumber.doubleOut(y / 1000f) + " " + PdfNumber.doubleOut(w / 1000f) + " "
                + PdfNumber.doubleOut(h / 1000f) + " re b\n" + "Q\nBT\n");
 }
예제 #3
0
 public void DrawRect(float x, float y, float w, float h, PdfColor stroke)
 {
     InnerWrite("ET\nq\n" + stroke.getColorSpaceOut(false)
                + PdfNumber.doubleOut(x / 1000f) + " " + PdfNumber.doubleOut(y / 1000f) + " "
                + PdfNumber.doubleOut(w / 1000f) + " " + PdfNumber.doubleOut(h / 1000f) + " re s\n"
                + "Q\nBT\n");
 }
예제 #4
0
        /**
        * add a filled rectangle to the current stream
        *
        * @param x the x position of left edge in millipoints
        * @param y the y position of top edge in millipoints
        * @param w the width in millipoints
        * @param h the height in millipoints
        * @param fill the fill color/gradient
        */

        private void AddFilledRect(int x, int y, int w, int h,
                                   PdfColor fill) {
            CloseText();
            currentStream.Write("ET\nq\n" + fill.getColorSpaceOut(true)
                + PdfNumber.doubleOut(x/1000f) + " " + PdfNumber.doubleOut(y/1000f) + " "
                + PdfNumber.doubleOut(w/1000f) + " " + PdfNumber.doubleOut(h/1000f) + " re f\n"
                + "Q\nBT\n");
        }
예제 #5
0
        /**
        * add a rectangle to the current stream
        *
        * @param x the x position of left edge in millipoints
        * @param y the y position of top edge in millipoints
        * @param w the width in millipoints
        * @param h the height in millipoints
        * @param stroke the stroke color/gradient
        */

        private void AddRect(int x, int y, int w, int h, PdfColor stroke) {
            CloseText();
            currentStream.Write("ET\nq\n" + stroke.getColorSpaceOut(false)
                + PdfNumber.doubleOut(x/1000f) + " " + PdfNumber.doubleOut(y/1000f) + " "
                + PdfNumber.doubleOut(w/1000f) + " " + PdfNumber.doubleOut(h/1000f) + " re s\n"
                + "Q\nBT\n");
        }
예제 #6
0
        /**
        * add a line to the current stream
        *
        * @param x1 the start x location in millipoints
        * @param y1 the start y location in millipoints
        * @param x2 the end x location in millipoints
        * @param y2 the end y location in millipoints
        * @param th the thickness in millipoints
        * @param rs the rule style
        * @param r the red component
        * @param g the green component
        * @param b the blue component
        */

        private void AddLine(int x1, int y1, int x2, int y2, int th, int rs,
                             PdfColor stroke) {
            CloseText();
            currentStream.Write("ET\nq\n" + stroke.getColorSpaceOut(false)
                + SetRuleStylePattern(rs) + PdfNumber.doubleOut(x1/1000f) + " "
                + PdfNumber.doubleOut(y1/1000f) + " m " + PdfNumber.doubleOut(x2/1000f) + " "
                + PdfNumber.doubleOut(y2/1000f) + " l " + PdfNumber.doubleOut(th/1000f) + " w S\n"
                + "Q\nBT\n");
        }
예제 #7
0
 public void SetFontColor(PdfColor c)
 {
     InnerWrite(c.getColorSpaceOut(true));
 }