Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Yet another PDF Capability Required post
Started by johnreichert at 02-19-2008 18:58. Topic has 21 replies.

Print Search « Previous Thread Next Thread »
  02-19-2008, 18:58
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Yet another PDF Capability Required post
Reply Quote
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

   Report 
  02-20-2008, 3:50
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-20-2008, 12:20
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote

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?


   Report 
  02-20-2008, 15:34
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote

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


   Report 
  02-21-2008, 4:42
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-21-2008, 10:02
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote

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

   Report 
  02-22-2008, 4:41
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-22-2008, 11:27
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote

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


   Report 
  02-24-2008, 5:40
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-26-2008, 18:24
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote
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

   Report 
  02-27-2008, 7:23
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-27-2008, 15:04
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-27-2008, 16:38
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post
Reply Quote
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

   Report 
  02-28-2008, 3:59
Maen Hasan is not online. Last active: 10/5/2008 10:18:54 AM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 1,744
Re: Yet another PDF Capability Required post
Reply Quote
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
   Report 
  02-28-2008, 13:53
johnreichert is not online. Last active: 1/3/2008 11:41:32 AM johnreichert

Top 75 Posts
Joined on 06-06-2007
Posts 31
Re: Yet another PDF Capability Required post

Attachment: forLEAD20080228.zip
Reply Quote
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


   Report 
Post
 Page 1 of 2 (22 items) 1 2 »
LEAD Support Fo... » Developer » PDF » Yet another PDF Capability Required post

Powered by Community Server, by Telligent Systems