Exemplo n.º 1
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");
 }
Exemplo n.º 2
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");
 }
Exemplo 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");
 }
Exemplo n.º 4
0
 public void FillImage(float x, float y, float w, float h, PdfXObject xobj)
 {
     InnerWrite("ET\nq\n" + PdfNumber.doubleOut(((float)w) / 1000f) + " 0 0 "
                + PdfNumber.doubleOut(((float)h) / 1000f) + " "
                + PdfNumber.doubleOut(((float)x) / 1000f) + " "
                + PdfNumber.doubleOut(((float)(y - h)) / 1000f) + " cm\n" + "/" + xobj.Name.Name
                + " Do\nQ\nBT\n");
 }
Exemplo n.º 5
0
 public void PrintContentTo(Fonet.Pdf.PdfContentStream contentStream)
 {
     if (_useEmDiff)
     {
         //-------
         contentStream.InnerWrite(PdfNumber.doubleOut(_emDiff));
         contentStream.InnerWrite(" ");
     }
     else
     {
         contentStream.InnerWrite("1 0 0 1 " + PdfNumber.doubleOut(_x / 1000f) +
                                  " " + PdfNumber.doubleOut(_y / 1000f) + " Tm ["); //left open?
     }
     //-------------------------------
     contentStream.InnerWrite(startText.ToString());
     contentStream.InnerWrite(_tmpstBuilder.ToString());
     contentStream.InnerWrite(endText.ToString());
     //-------------------------------
     //close text object ?
 }
Exemplo n.º 6
0
 public void ClipImage(float cx1, float cy1, float cx2, float cy2,
                       float imgX, float imgY, float imgW, float imgH, PdfXObject xobj)
 {
     InnerWrite("ET\nq\n" +
                // clipping
                PdfNumber.doubleOut(cx1) + " " + PdfNumber.doubleOut(cy1) + " m\n" +
                PdfNumber.doubleOut(cx2) + " " + PdfNumber.doubleOut(cy1) + " l\n" +
                PdfNumber.doubleOut(cx2) + " " + PdfNumber.doubleOut(cy2) + " l\n" +
                PdfNumber.doubleOut(cx1) + " " + PdfNumber.doubleOut(cy2) + " l\n" +
                "W\n" +
                "n\n" +
                // image matrix
                PdfNumber.doubleOut(((float)imgW) / 1000f) + " 0 0 " +
                PdfNumber.doubleOut(((float)imgH) / 1000f) + " " +
                PdfNumber.doubleOut(((float)imgX) / 1000f) + " " +
                PdfNumber.doubleOut(((float)imgY - imgH) / 1000f) + " cm\n" +
                "s\n" +
                // the image itself
                "/" + xobj.Name.Name + " Do\nQ\nBT\n");
 }
Exemplo n.º 7
0
 public void SetLetterSpacing(float letterspacing)
 {
     InnerWrite(PdfNumber.doubleOut(letterspacing) + " Tc\n");
 }
Exemplo n.º 8
0
 public void SetFont(string fontname, int size)
 {
     InnerWrite("/" + fontname + " " +
                PdfNumber.doubleOut(size / 1000f) + " Tf\n");
 }