What I want to do is convert PDF to TIFF and then, these TIFF files, merge them.
I already can convert PDF to TIFF with this code (using ImageMagick):
Code: Select all
public void PDFToTIFF(string output)
{
MagickReadSettings settings = new MagickReadSettings();
// Settings the density to 500 dpi will create an image with a better quality
settings.Density = new Density(500);
string[] ficheiros = GetFiles();
foreach (string fich in ficheiros)
{
string fichwithout = Path.GetFileNameWithoutExtension(fich);
string path = Path.Combine(output, fichwithout);
using (MagickImageCollection images = new MagickImageCollection())
{
images.Read(fich);
foreach (MagickImage image in images)
{
settings.Height = image.Height;
settings.Width = image.Width;
image.Format = MagickFormat.Tiff;
image.Write(path + ".tiff");
image.Dispose();
}
images.Dispose();
}
}
}
I know how to do it using command line, but I don't know how to do it in C#. If someone knows or can help me, please answer this post.
Thank you in advance!
Sofia Rodrigues