This project has moved. For the latest updates, please go here.

Create PDF very slow.

Sep 19, 2014 at 10:50 AM
Hello.

First, congratulations on the great work.

I have an application that transforms several images to a pdf file. These images are scanned at 300 dpi and compressed Tiff Group 4.
The final size of the images is small.

To create the pdf, use this code:
using (MagickImageCollection collection = new MagickImageCollection())
                    {
                        foreach (string fich in Directory.GetFiles(DIR_ESCAN))
                        {                        
                            //collection.AddRange(fich);
                            collection.Add(fich);
                        }

                        if (File.Exists(nombreFichero))
                            File.Delete(nombreFichero);

                        collection.Write(nombreFichero);
                        .........

                    }
The problem is that the process is very slow and I have seen that for every 50kb compressed image, a temporary image is created in AppData \ Local \ Temp + -70MB. These images, I guess are the images used by the process.
Can I do this process without these temporary files? Now the process is very slow for me.

I have another problem, but not always. The dll uses Ghostscript and ImageMagick on several PCs all works ok. In 2, when I'm calling the dll in my program for the first time, the program closes. If I reinstall those products, sometimes it is solved, other times I have to reinstall the PC.
In the other PC with the same software, everything works ok.

Thank you very much.

Sorry for my English
Coordinator
Sep 19, 2014 at 9:33 PM
Magick.NET will create those temporary files when it cannot allocate enough memory to store the image. The size of the file is not related to the amount of memory that is required to store an image. You can calculate it like this: width x height x number-of-channels (RGB = 3) x (8 bits or 16 bits). If you use the Q8 version of Magick.NET you only need half the amount of memory.

Are you installing ImageMagick on your machine? You don't need to do this. Are you using the latest version of Magick.NET an Ghostscript?
Sep 23, 2014 at 7:45 AM
I loaded the Q8 version and it works great .
Thank you