I'm sure I'm making some kind of silly mistake here, but when converting a tiff file to PDF, the colours become reversed. I can't figure out why. Here's my code:
Document document = new Document(PageSize.A4, 50, 50, 50, 50);
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("Image.pdf", FileMode.Create));
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(@"C:\Temp\338814-00.tif");
int total = bm.GetFrameCount(FrameDimension.Page);
document.Open();
PdfContentByte cb = writer.DirectContent;
for (int k = 0; k < total; ++k)
{
bm.SelectActiveFrame(FrameDimension.Page, k);
MemoryStream ms = new MemoryStream();
bm.Save(ms, ImageFormat.Tiff);
Image img = Image.GetInstance(ms.ToArray());
img.ScalePercent(72f / (float)img.DpiX * 100);
img.SetAbsolutePosition(0, 0);
cb.AddImage(img);
document.NewPage();
}
document.Close();
Thanks.