Unknown format

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

Moderators: XnTriq, xnview

Post Reply
anoho
Posts: 1
Joined: Fri Feb 10, 2012 5:21 pm

Unknown format

Post by anoho »

Hello,

I have an error when i pass a pdf file to loadbitmap function: unknown format.

Do you know the solution to convert pdf to png?

Here is the code:

Code: Select all

Dim inputDocument As PdfDocument = PdfReader.Open(strPdfFile, PdfDocumentOpenMode.ReadOnly)
            Dim numberPages As Integer = inputDocument.PageCount

            ' utilisation de la bibliothèque GFLAx pour convertir le rapport PDF en plusieurs images PNG
            Dim gflax__1 As New GflAx.GflAxClass()
            gflax__1.EpsDpi = dpi

            If numberPages = 1 Then
                gflax__1.LoadBitmap(strPdfFile)
                gflax__1.SaveFormat = GflAx.AX_SaveFormats.AX_PNG
                gflax__1.SaveBitmap(strPdfFile)
            Else
                For i As Integer = 1 To numberPages
                    gflax__1.Page = i
                    gflax__1.LoadBitmap(strPdfFile)
                    gflax__1.SaveFormat = GflAx.AX_SaveFormats.AX_PNG
                    gflax__1.SaveBitmap(((Path.GetDirectoryName(strPdfFile) & "\") _
                                         + Path.GetFileNameWithoutExtension(strPdfFile) & "_Page") _
                                         + i.ToString() & ".pdf")
                Next
            End If

            inputDocument.Close()
Thanks in advance
Anoho
User avatar
xnview
Author of XnView
Posts: 33911
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Unknown format

Post by xnview »

Do you have ghostscript?
Pierre.
User avatar
Nikolay Raspopov
Posts: 89
Joined: Thu Jun 24, 2004 4:25 pm
Location: Sarov, Russia
Contact:

Re: Unknown format

Post by Nikolay Raspopov »

Pierre, Is it possible to load pdf/ai/ps files using 64-bit GFL-library + Ghostscript 9? It can be done for 32-bit but 64-bit always failed.
Image
User avatar
xnview
Author of XnView
Posts: 33911
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Unknown format

Post by xnview »

Nikolay Raspopov wrote:Pierre, Is it possible to load pdf/ai/ps files using 64-bit GFL-library + Ghostscript 9? It can be done for 32-bit but 64-bit always failed.
I'll update GFLSDK soon
Pierre.
Post Reply