Page 1 of 1

Unknown format

Posted: Fri Feb 10, 2012 5:25 pm
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

Re: Unknown format

Posted: Mon Feb 13, 2012 9:50 am
by xnview
Do you have ghostscript?

Re: Unknown format

Posted: Mon Feb 13, 2012 2:16 pm
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.

Re: Unknown format

Posted: Tue Feb 14, 2012 10:22 am
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