Greetings,
I'm looping through a dataset of 17 records, each record represents a page of an image.
All is well except that I get an extra blank page after each page resulting in 34 pages.
Here is a snippet of my code:
MemoryStream ms = new MemoryStream();
ms.Write(bytes, 0, bytes.Length);
Image image = Image.FromStream(ms);
int imgWdth = image.Width;
int imgHt = image.Height;
if (imgWdth > imgHt)
pdfdoc.PageSettings.Orientation = PdfPageOrientation.Landscape;
pdfdoc.PageSettings.Margins.All = 0.0f;
PdfPage pdfpg = pdfdoc.Pages.Add();
PdfImage pdfimg = PdfImage.FromImage(image);
pdfimg.PhysicalDimension.ToSize();
pdfimg.Draw(pdfpg, 0, 0);