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);
}