Summary: How can I reduce the amount of time it takes to convert tifs to pdfs using itextsharp
?
Background: I\'m convertin
//Testing shows that this line takes the lion's share (80%) of the time involved.
iTextSharp.text.Image img =
iTextSharp.text.Image.GetInstance(bm, null, true);
Might be stupid suggestion (don't have a large testset right now to try it locally), but give me the benefit of the doubt:
You're looping through a multitiff here, selecting frame after frame. bm is this (huge, 6.5M) image, in memory. I don't know enough about iTextSharps internal image handling, but maybe you can help here by just providing a single page image here? Can you try creating a new Bitmap of the desired size, drawing bm on it (look at the options to the Graphics object for properties related to speed: InterpolationMode for example) and passing in this single image instead of the huge thing for each call?