Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, February 2, 2007 10:23:39 AM(UTC)

planza  
planza

Groups: Registered
Posts: 3


When I try to load a pdf image using the code below I get the following:

"Leadtools.RasterException: Either the files required for initializing the PDF engine were not found or they were found but they are incorrect"


This same code works on other machines, so I think that it is a dll version problem. I checked the paths that are specified in the code and they exist. All of the dll versions seem to be correct as well. Any ideas? Could it be a problem with the GS_LIB key in the registry pointing to different files or something (even though it is pointing to the same version of the files in my case)?

Code below:

 Public Shared Sub ConvertImage(ByVal SourceFileName As String, ByVal TargetFileName As String, ByVal ImageFormat As Leadtools.RasterImageFormat, ByVal bitsPerPixel As Integer)

        Dim mCodecs As RasterCodecs = New RasterCodecs
        Dim image As IRasterImage

        UnlockLeadTools()

        mCodecs.CodecsPath = CodecsPath
        mCodecs.Options.Pdf.InitialPath = PDFEnginePath

        mCodecs.Options.Pdf.Load.XResolution = 300
        mCodecs.Options.Pdf.Load.YResolution = 300

        mCodecs.Options.Load.XResolution = 300
        mCodecs.Options.Load.YResolution = 300

        'MsgBox("about to load image")
        Try


            MsgBox("about to load image")
            MsgBox(CodecsPath)
            MsgBox(PDFEnginePath)
            image = mCodecs.Load(SourceFileName.Trim)
            MsgBox("loaded image")
            MsgBox(CodecsPath)
            MsgBox(PDFEnginePath)
            'image = mCodecs.Load(SourceFileName, bitsperpixel, CodecsLoadByteOrder.RgbOrGray, 1,
            'mCodecs.Save(image, TargetFileName.Trim, ImageFormat, bitsPerPixel)
            'MsgBox("about to save")
            mCodecs.Save(image, TargetFileName.Trim, ImageFormat, bitsPerPixel, 1, image.PageCount, 1, CodecsSavePageMode.Overwrite)
            'MsgBox("done")
        Catch ex As Exception
            MsgBox(ex.ToString & vbCrLf & ex.Message)
            If Not image Is Nothing Then
                image.Dispose()
            End If
            Throw
        End Try

    End Sub
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, February 5, 2007 3:13:29 AM(UTC)

Qasem Lubani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)


In addition to the files from LEADTOOLS14.5\Redist\PDF, you also need Leadtools.Pdf.dll and Leadtools.Codecs.Pdf.dll


Are you sure all these files are identical on both the PC that works and the PC that fails?


Also, are you sure the value of PDFEnginePath is set correctly?
 
#3 Posted : Monday, February 5, 2007 5:01:38 AM(UTC)

planza  
planza

Groups: Registered
Posts: 3


The path to the PDF Engine files is correct. However, I did not have the leadtools.pdf.dll file in my codecs directory. I am going to try again with this in the codecs dir to see if this resolves the issue.

Thx,
P
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.082 seconds.