PDFClown parse error while converting pdf to jpeg

564 Views Asked by At

I have a problem while converting a pdf document while using PDFClown in .NET environment. The pdf is succesfully created (I use MigrDoc for the rendering) and I can open it but when I use this function to convert it to jpeg images an exception is raised:

using (File file = new File(System.IO.Path.GetFullPath(filename)))
{
            org.pdfclown.documents.Document document = file.Document;
            Pages pages = document.Pages;

            //rasterization of the page
            int pageCount = pages.Count;
            for(int i = 0; i < pageCount; i++)
            {
                Page page = pages[i];
                System.Drawing.SizeF imageSize = page.Size;
                Renderer renderer = new Renderer();
                System.Drawing.Image image = renderer.Render(page, imageSize);

                //save the image in the bin folder
                string output = i.ToString() + ".jpg";
                image.Save(output, System.Drawing.Imaging.ImageFormat.Jpeg);

            }
}

I get the following error:

org.pdfclown.util.parsers.ParseException: ''name' table does NOT exist.'

At line System.Drawing.Image image = renderer.Render(page, imageSize);

I've tried find several solution but nothing works. Do you have any suggestion on how to solve this problem? I've installed the PDFClown package directly from nuget.

0

There are 0 best solutions below