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

Notification

Icon
Error

  • 2 Pages
  • 1
  • 2
  • >
Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 19, 2008 1:53:15 PM(UTC)
johnreichert

Groups: Registered
Posts: 47


I am having trouble using the LEAD PDF capabilities in my web service.  We are using LEAD v15.  I get the message "PDF Capability Required" message that it seems from the number of posts, that many others are getting. 

I am trying to install my web service on a machine that does not have a development environment (i.e. no VS2005 or LEAD SDK).  I have tried the steps outlined in the "Implementing PDF Plug in Features" help topic but still get the "Capability" error message.

To simplify the description of my problem, I tried keeping everything on my development machine.  Here is a summary of what I did, and what does and doensn't work:

If I
don't set the codecs.options.pdf.initialpathload to a value and load a pdf file with RasterCodecs.load everything works as expected.

In order to simulate deploying the web service to a non-development box, I tried setting the
codecs.options.pdf.initialpath value to point to a specific location containing a copy the PDF redistribution files.  I copied the files from C:\Program Files\LEAD Technologies\LEADTOOLS 15\Bin\Common\PDF" to a directory under the web service top level directory.

This is the part that I am having trouble getting working.  The web service is setup is as follows:

- Web service located in C:\WebServices\ImageServer
- PDF files under C:\WebService\ImageServer\PDF

My program looks something like:

   Try

    RasterSupport.Unlock(RasterSupportType.Document, "xxxxxxxx")
    RasterCodecs.Startup()
    Dim theImage As RasterImage
    Dim codecs As New RasterCodecs
    Dim pdfMain As String = System.AppDomain.CurrentDomain.BaseDirectory & "PDF\"
    codecs.Options.Pdf.InitialPath = pdfMain & "Lib;" & pdfMain & "Fonts;" & pdfMain & "Resource"
    codecs.Options.Jpeg.Save.QualityFactor = JPEG_QUALITY_FACTOR

    theImage = codecs.Load(imageFile)
    .
    .
    .
  Catch....

What value should I be setting
codecs.Options.Pdf.InitialPath to?  In the example above, just setting the value of InitialPath causes the web service to choke so badly that the Try/Catch does not even trap the error.  VS2005 throws up a nasty error box in the web service (when I am stepping through the service in debug mode).

I also tried setting InitialPath to
System.AppDomain.CurrentDomain.BaseDirectory & "PDF\".  This does not cause the program to fail as described above, but then I get the PDF Capability Required message on the codecs.load statement.

Note that I verified that
System.AppDomain.CurrentDomain.BaseDirectory points to my top level web service folder.  I also confirmed that the ASPNET user has rights to the PDF folder.

Do I need to execute
RasterSupport.Unlock(RasterSupportType.BarcodesPdfRead, "xxxxxxx"), too?  If so, why does the web service work with PDF files when I don't set codecs.options.pdf.initialPath to anything?

Is there anything else I need to do to get this to work?  Any ideas?

Thank you,

John
 

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 : Tuesday, February 19, 2008 10:45:51 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

John,

You should unlock PDF support to use it. The reason it works without unlocking it is probably because you have the nag edition of the kernel DLL (Leadtools.DLL in .NET 15)

I'm not sure why this is happening on your machine, but does it contain more than copy of Leadtools.DLL? If not, can you reproduce the problem in a Windows forms application or does it only happen in a web service.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Wednesday, February 20, 2008 7:15:36 AM(UTC)
johnreichert

Groups: Registered
Posts: 47



Maen -

I will try unlocking PDF support to see if that helps.

In the mean time, I tried the same thing in a fat client application as you suggested.  I get an error when I try to set the options.pdf.InitialPath  as follows:

Dim pdfMain As String =  _
   "C:\Documents and Settings\JReichert\My Documents\Product\7_2\ApolloPathPACS\ApolloImageServer\PDF\"
codecs.Options.Pdf.InitialPath = pdfMain & "Lib;" & pdfMain & "Fonts;" & pdfMain & "Resource"

Causes an error dialog box to display with the message: "An unhandled win32 exception occured in simple.exe [4660]."

The behavior is similar to the problem in the web service - the code is in a try/catch block, but the program bombs without the catch being triggered.

Note this is the same path that I reference in my Web service example.  I shortened the path in the problem description post to simplify the description.

If I change the value of pdfMain to "C:\PDF" (and copy the PDF folder with the redistributables to the "C:\", the InitialPath setting does not blow up.  Is there a problem with the length of the full directory name?

 
#4 Posted : Wednesday, February 20, 2008 10:29:44 AM(UTC)
johnreichert

Groups: Registered
Posts: 47



Maen -

I got everthing straightened out with the unlock keys.  I can get both the web service and fat client programs to load PDF files if I put the PDF redistrubution files in a folder named "C:\PDF" and set the InitialPath as follows:

Dim pdfMain As String =  "C:\PDF\"
codecs.Options.Pdf.InitialPath = pdfMain & "Lib;" & pdfMain & "Fonts;" & pdfMain & "Resource"

In both the web service and fat client trying to set the InitialPath to a long folder name causes the ""An unhandled win32 exception..." error that aborts the program before the try/catch block can catch the error.  Here is the exact command I am using to set InitialPath:

Dim pdfMain As String =  _
   "C:\Documents and Settings\JReichert\My Documents\Product\7_2\ApolloPathPACS\ApolloImageServer\PDF\"
codecs.Options.Pdf.InitialPath = pdfMain & "Lib;" & pdfMain & "Fonts;" & pdfMain & "Resource"


Can you confirm if the long folder name is a problem, or if I am doing something else that generates the error?

Thank you,

John

 
#5 Posted : Wednesday, February 20, 2008 11:37:46 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

When exactly do you get the exception error?

Do you get the error directly after setting the _codecs.Options.Pdf.InitialPath property?

What is the build number (version info) of the Leadtools.Codecs.DLL and Leadtools.Codecs.Pdf.DLL files on your machine?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#6 Posted : Thursday, February 21, 2008 4:57:43 AM(UTC)
johnreichert

Groups: Registered
Posts: 47



I get the error when the program executes the line

codecs.Options.Pdf.InitialPath = pdfMain & "Lib;" & pdfMain & "Fonts;" & pdfMain & "Resource"

after assigning the longer path name to pdfMain.

The version numbers, both
on the .dll
files in C:\Program Files\LEAD Technologies\LEADTOOLS
15\Bin\Dotnet\Win32 and in the bin directory under my web service top level folder
are as follows:

leadtools.codecs.dll - 15.0.0.16
leadtools.codecs.pdf.dll - 15.0.0.4

- John
 
#7 Posted : Thursday, February 21, 2008 11:36:00 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

Can you please try the same issue using the latest LEADTOOLS v15 .Net patches?

To obtain the latest patches, please send your LEADTOOLS v15 serial number to support@leadtools.com and ask about the latest LEADTOOLS v15 .Net patches. Don't forget to mention this forum in your email to support.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#8 Posted : Friday, February 22, 2008 6:22:26 AM(UTC)
johnreichert

Groups: Registered
Posts: 47



Maen -

I installed the updates but the program still exhibits the same behavior.

In the fat client program I dropped all the LEAD refereneces, and rereferenced the new files.  In my web service, the correct leadtools.dll shows up in my bin folder.  So, I am pretty confident that I installed the update correctly.

Are you able to duplicate this problem?

- John

 
#9 Posted : Sunday, February 24, 2008 12:35:53 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

I checked this issue on my side and the problem is not active.
If you set the InitialPath as follows, do you face the same problem?

codecs.Options.Pdf.InitialPath = "C:\Documents and Settings\JReichert\My Documents\Product\7_2\ApolloPathPACS\ApolloImageServer\PDF"

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#10 Posted : Tuesday, February 26, 2008 1:19:24 PM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen -

The change you suggested works in my fat client program and with the web service when I run the web service on my development box.

When I try to run my web service on a separate web server - with no development environment - I get the following message:

PDF Error - Either the files required for initializing the PDF engine were not found or they were found but incorrect.

I am confident that  the PDF directory is where I set it to in the InitialPath setting.

Thanks -

John
 
#11 Posted : Wednesday, February 27, 2008 2:18:10 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

To make sure your deployment server has the correct PDF engine, can you try to test a fat client program that uses LEADTOOLS to load PDF on that server?

Are you sure you are deploying the PDF engine correctly? Are you deploying the PdfDll32.dll and Leadtools.Codecs.Pdf.dll files?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#12 Posted : Wednesday, February 27, 2008 9:59:54 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen -

I am NOT sure that I am deploying the PDF engine correctly.  Can you provide me a complete list of steps to follow to deploy the PDF engine?

Here are the steps that I gathered (from 'Implementing PDF Plug in Features' and reading forum posts) we are supposed to follow to deploy a web service that uses LEAD to a web server:

1. Complile the web service - Visual Studio builds a bin directory that contains the files need to run the web service.  The following files appear in my web
service bin directory:

Leadtools.Annotations.dll
Leadtools.Annotations.xml
Leadtools.Codecs.Bmp.dll
Leadtools.Codecs.Cmp.dll
Leadtools.Codecs.dll
Leadtools.Codecs.Fax.dll
Leadtools.Codecs.Gif.dll
Leadtools.Codecs.Pdf.dll
Leadtools.Codecs.Sgi.dll
Leadtools.Codecs.Tif.dll
Leadtools.Codecs.xml
Leadtools.ColorConversion.dll
Leadtools.ColorConversion.xml
Leadtools.dll
Leadtools.Kernel.Annotations.dll
Leadtools.WinForms.dll
Leadtools.WinForms.xml
Leadtools.xml
(also, a dll and xml file for my web service)

2. Copy the the top level web service folder and entire bin folder to the web server.

3. Copy the LEAD PDF runtime files (as described in 'Implementing PDF Plug in Features') to a folder named PDF in the top level web service folder on the web server.  The web service sets the InitialPath to point to the PDF folder as follows:
codecs.Options.Pdf.InitialPath = webServiceHome + "PDF\"

4. Configure the web service in IIS and run.

Just to reiterate: after deploying the service as described above, everything works perfectly EXCEPT when I try to access a PDF file.  I get the message "Either the files required for initializing the PDF engine were not found or they were found but incorrect" when I try to access a PDF file.

I have not deployed a copy of PdfDll32.dll to the web server.  Can you tell me where to put it?  Note, I do not want to put files in the system32 directory on the web server.

Are there any other files I need to deploy or steps I need to follow?

Thank you,

John
 
#13 Posted : Wednesday, February 27, 2008 11:33:21 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen - I should note that I am sure that I am setting codecs.options.pdf.InitialPath to the correct value.  I include the InitialPath value in the error message that my web service displays.

- John
 
#14 Posted : Wednesday, February 27, 2008 10:54:22 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

The steps you list are correct, but you must also deploy PdfDll32.dll.
Please put it in the same folder that has all other LEADTOOLS DLLs. It does not need to be in the SYSTEM32 folder.

To test if the PDF engine is installed correctly, create a small WinForm program that uses the same LEADTOOLS DLLs to load a PDF, then copy its EXE to the same folder on the web server and run it from there. Does it work correctly and succeed in load a PDF file?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#15 Posted : Thursday, February 28, 2008 8:48:31 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen -

I created a WinForm program to load a pdf, copied the executable to my web service bin folder, and ran the program.  As expected, it did not work: it failed with the error message "Either the files required for initializing the PDF engine were not found or they were found but incorrect"

Next, I added the file
PdfDll32.dll to the web service bin folder.  I ran the WinForm executable again.  This time it did work.

My web service still fails with the error message
"Either the files required for initializing the PDF engine were not found or they were found but incorrect" when I try to access a PDF file, though.

However, when I put
PdfDll32.dll in the C:\Windows\System32 folder on the web server, the web service is able to load a PDF file.

I have attached a simple example that illustrates this problem. 
The attached zip file contains two projects/folders:

SimpleImageServer - image web service
Simple - client

To create the web service :
- Open the project in the SampleImageServer folder
- Add your unlock codes to the program
- Change the imageFile variable to point to a PDF image on your computer.  Make sure the ASPNET user has read access to the image.
- Execute/build the web service by pressing Ctrl-F5
- IE should pop up with some information about the web service.  Close IE.
- Add a virtual diretory to your IIS called SimpleImageServer  - point it to the SimpleImageServer folder.
- Make sure you add the ASPNET user to the security settings on the SimpleImageServer folder.

To run the test using the simple client:
- Open the project in the Simple folder
- Change the value of the simple.url variable to point to your web server
- Run the project

- Click the GO button
- On my system, I get the "Either the files required for initializing the PDF engine were not found or they were found but incorrect" unless PdfDll32.dll is in the C:\Windows\System32 directory.

Thanks -

John

File Attachment(s):
forLEAD20080228.zip (45kb) downloaded 28 time(s).
 
#16 Posted : Monday, March 3, 2008 5:26:04 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen -

Were you able to look at this issue any further?  I am not able to deploy a web service with PDF cababilities to a stand alone web server.

Thanks -

John
 
#17 Posted : Tuesday, March 4, 2008 2:36:13 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

I found a work around as follows:
1. Put PDFDLL32.DLL in the application's root folder, such as D:\SimpleImageServer
2. Before calling our codecs.Load("pdf file"), call this VB code:
ChDir("D:\SimpleImageServer")
 
This lets our PDF codec find the PDFDLL32.DLL file, and loading succeeds.

Please let me know if this helps.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#18 Posted : Tuesday, March 4, 2008 8:27:12 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen - I can confirm this does work.
 
#19 Posted : Thursday, March 6, 2008 11:25:03 AM(UTC)
johnreichert

Groups: Registered
Posts: 47


Maen - can you log this issue as a bug?  The file really should go in the bin folder.

Thanks -

John
 
#20 Posted : Sunday, March 9, 2008 6:11:29 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

Hello,

Did you try to put the PdfDll32.dll on the bin folder, and then use the ChDir function to change the working directory to the bin folder?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
  • 2 Pages
  • 1
  • 2
  • >
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.208 seconds.