kevinhint,
I would recommending trying the RasterImageResize class. I compared its speed to ResizeCommand, and the act of scaling one of your PDFs by a factor of 0.5 was ~25x faster using RasterImageResize (4 ms vs 100+ ms).
This might not be a universal truth, and its also going to be machine dependent, but I would give this alternative a shot.
Here's a code snippet:
---------------------------------------------------------------
string directory = @"C:\Users\justinf\Downloads\MissingLines\";
string pdf = @"LifeApp08-68509.pdf";
string destFileName = directory + "test.tif";
RasterCodecs codecs = new RasterCodecs();
RasterImage srcImage = codecs.Load(directory + pdf);
int destWidth = srcImage.Width / 2;
int destHeight = srcImage.Height / 2;
RasterImage destImage = new RasterImage(RasterMemoryFlags.Conventional,
destWidth,
destHeight,
srcImage.BitsPerPixel,
srcImage.Order,
srcImage.ViewPerspective,
srcImage.GetPalette(),
IntPtr.Zero,
0);
RasterImageResize resize = new RasterImageResize();
byte[] buffer = new byte[destImage.BytesPerLine];
// Start the resize process
resize.Start(
srcImage,
destWidth,
destHeight,
srcImage.BitsPerPixel,
srcImage.Order,
srcImage.DitheringMethod,
RasterSizeFlags.None,
srcImage.GetPalette());
destImage.Access();
// get the rows for the resized image, one by one
for (int row = 0; row < destImage.Height; row++)
{
resize.ResizeBuffer(row, 0, buffer, 0, destImage.BytesPerLine);
destImage.SetRow(row, buffer, 0, destImage.BytesPerLine);
}
destImage.Release();
resize.Stop();
// Save the destination image
codecs.Save(destImage, destFileName, RasterImageFormat.CcittGroup4, 1);
---------------------------------------------------------------
If speed is still an issue, you may want to consider parallel computing using the LEADTOOLS Distributed Computing SDK to handle jobs in parallel on multiple machine. The Distributed Computing SDK is available as an add on to our Document Imaging SDK.
https://www.leadtools.com/sdk/distributed-computing/default.htm