Hello,
thanks for your quick response.
I tried to read the pdf-Files with RasterCodecs into an image. Thats generally not a problem, but the problem is that the resolution has only one bit per pixel (bpp). Thats not acceptable.
I can load the file and the info-object says it has 24 bpp, but when I go on and try to save it either to a stream or a file and bpp is higher than 1 I get the exception "Invalid parameter passed".
Is it possible to get a higher resolution. My company is thinking about buying the license for Leadtools 17.5, but if its not possible to get a higher resolution we have to think about that.
Here my code to test the load and save of the pdf-file:
class Merge
{
private RasterCodecs codecs = new RasterCodecs();
private RasterImage fileImage;
private RasterImage allFilesImage;
private CodecsImageInfo info;
private string outfile = @"C:\TEMP\LeadtoolsTests\rasterMerge.pdf";
private string tmpfile;
private System.IO.MemoryStream myStream = new System.IO.MemoryStream();
public void start(string file1, string file2)
{
try
{
for (int i = 0; i < 2; i++)
{
tmpfile = @"C:\TEMP\input" + (i+1) + ".pdf";
info = codecs.GetInformation(tmpfile, true);
fileImage = codecs.Load(tmpfile, info.Width, info.Height, info.BitsPerPixel, RasterSizeFlags.Resample, CodecsLoadByteOrder.RgbOrGray);
codecs.Save(fileImage, myStream, RasterImageFormat.RasPdfG4, /*info.BitsPerPixel*/1, 1, info.TotalPages, 1, CodecsSavePageMode.Append);
}
info = codecs.GetInformation(myStream, true);
allFilesImage = codecs.Load(myStream, info.BitsPerPixel, CodecsLoadByteOrder.RgbOrGray, 1, info.TotalPages);
codecs.Save(allFilesImage, outfile, RasterImageFormat.RasPdfG4, info.BitsPerPixel);
}
catch (Exception ex)
{
throw;
}
}
}
Many thanks
M.Wagner