2

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.

Marcus
  • 81
  • 9
  • *"'name' table does NOT exist"* - that sounds like a font in the pdf is incomplete. Please share the stack trace of the error to confirm. Please share the pdf in question for a more detailed analysis. – mkl Apr 13 '19 at 07:48
  • Solution found, is sufficient to enable unicode while creating pdf and ensure the characters are created with unicode option. – Marcus Apr 14 '19 at 13:04

0 Answers0