PDF to Image using GflAx: Image generated is incomplete

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

missChex13
Posts: 2
Joined: Fri Apr 23, 2010 2:27 am

PDF to Image using GflAx: Image generated is incomplete

Post by missChex13 »

Hi all! I'm a bit new to using GflAx, and I'm using it for a project in C#. For that project, I need to generate thumbnail of the first page of a PDF file. This is the main code I used:

Code: Select all

string file = "C:\\Users\\me\\Desktop\\PDFtest\\mouse.pdf";
string image = "C:\\Users\\me\\Desktop\\PDFtest\\omg.jpg";

            try
            {
                GflAx.GflAxClass g = new GflAx.GflAxClass();
                g.EpsDpi = 150;
                g.LoadBitmap(file);
                g.SaveFormat = GflAx.AX_SaveFormats.AX_JPEG;
                g.SaveBitmap(image);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: "+ex);
            }
I modified the code I got from this site: http://homeofcox-cs.blogspot.com/2008/1 ... ormat.html.
The PDF I'm trying to generate thumbnails from is kind of like a Powerpoint presentation in PDF format, so the pages are kind of horizontal. However, the pic I generate is vertical and the image itself is not complete. Here is a link to that image: http://i42.tinypic.com/4ub0jm.jpg.
I've tried using the LoadThumbnail() method to no avail.
Thanks in advance!
missChex13
Posts: 2
Joined: Fri Apr 23, 2010 2:27 am

Re: PDF to Image using GflAx: Image generated is incomplete

Post by missChex13 »

Anyone there? :)
fonzie1860
Posts: 4
Joined: Tue Dec 28, 2010 11:31 am

Re: PDF to Image using GflAx: Image generated is incomplete

Post by fonzie1860 »

Hi,

I'm facing the same problem. No hints what could cause this error?

thx, Axel
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: PDF to Image using GflAx: Image generated is incomplete

Post by xnview »

Which version of ghostscript do you use?
Pierre.
fonzie1860
Posts: 4
Joined: Tue Dec 28, 2010 11:31 am

Re: PDF to Image using GflAx: Image generated is incomplete

Post by fonzie1860 »

Pierre,

thanks for the relpy. I tried it with Ghostscipt 9.00 and 8.71. With both versions the same result.

Axel
fonzie1860
Posts: 4
Joined: Tue Dec 28, 2010 11:31 am

Re: PDF to Image using GflAx: Image generated is incomplete

Post by fonzie1860 »

Tried further Version 8.63 and 8.60. With version 8.60 i get the same result, with 8.63 no image is generated.

Axel
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: PDF to Image using GflAx: Image generated is incomplete

Post by xnview »

could you send me the pdf?
Pierre.
fonzie1860
Posts: 4
Joined: Tue Dec 28, 2010 11:31 am

Re: PDF to Image using GflAx: Image generated is incomplete

Post by fonzie1860 »

Hello Pierre,

I did some more testing, you are right, it's a problem with my test pdf (I'll send you,it's too big to attach) . With other pdfs it works perfect. Thanks for your help.

Axel