utilizando iTextSharp.text;
utilizando iTextSharp.text.pdf;
string appPath = AppDomain.CurrentDomain.BaseDirectory;
Documento doc = nuevo Documento (nuevo Rectángulo (390, 400), 0, 0, 0, 0); // Ancho del papel 390 alto 400
PdfWriter.GetInstance (doc, nuevo FileStream (appPath + "/DPD_15505984238198.pdf", FileMode.Create));
doc.Open ();
// Agregar imágenes a pdf
string filesPath = appPath + (appPath.EndsWith ("\\")? "": "\\") + "GzImage \\";
string gzImage = ReportPage.GetSession ("gzImage");
Image image = Image.GetInstance (filesPath + gzImage);
porcentaje de flotación = 1;
// Aquí están el ancho y alto originales de la imagen.
float resizedWidht = image.Width;
float resizedHeight = image.Height;
// Aquí usa el porcentaje calculado para reducir la imagen
image.ScalePercent (porcentaje * 100);
// La distancia de gzX a la izquierda y la distancia de gzY a la parte inferior
int gzX = Int32.Parse (ReportPage.GetSession ("gzX"));
int gzY = Int32.Parse (ReportPage.GetSession ("gzY"));
image.SetAbsolutePosition (gzX, gzY);
document.Add (imagen);