iTextSharp.text.pdf.PdfContentByte.SetHorizontalScaling C# (CSharp) Метод

SetHorizontalScaling() публичный Метод

public SetHorizontalScaling ( float value ) : void
value float
Результат void
        public void SetHorizontalScaling(float value)
        {
            if (!inText && autoControlTextBlocks) {
                BeginText(true);
            }
            state.scale = value;
            content.Append(value).Append(" Tz").Append_i(separator);
        }

Usage Example

Пример #1
0
        private static void WriteTextToDocument(BaseFont bf,Rectangle tamPagina,
            PdfContentByte over,PdfGState gs,string texto)
        {
            over.SetGState(gs);

            over.SetRGBColorFill(220, 220, 220);

            over.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_STROKE);

            over.SetFontAndSize(bf, 46);

            Single anchoDiag =

                (Single)Math.Sqrt(Math.Pow((tamPagina.Height - 120), 2)

                + Math.Pow((tamPagina.Width - 60), 2));

            Single porc = (Single)100

                * (anchoDiag / bf.GetWidthPoint(texto, 46));

            over.SetHorizontalScaling(porc);

            double angPage = (-1)

            * Math.Atan((tamPagina.Height - 60) / (tamPagina.Width - 60));

            over.SetTextMatrix((float)Math.Cos(angPage),

                       (float)Math.Sin(angPage),

                       (float)((-1F) * Math.Sin(angPage)),

                       (float)Math.Cos(angPage),

                       30F,

                       (float)tamPagina.Height - 60);

            over.ShowText(texto);
        }
PdfContentByte