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 : Tuesday, July 28, 2015 5:44:08 AM(UTC)
hgarnett

Groups: Registered
Posts: 6


I am using Leadtools version 17.5 and Visual C++. We have several clients using our software with Leadtools through Citrix, but we are having problems with one specific client. They are printing using the Citrix Universal Print Driver. I can try to get more specific info from the client about their Citrix install, but I don't have access to their actual environment. This printing process works successfully for non-Citrix full client installs, and for a client who uses Citrix but not the Universal Print Driver.

The issue we are seeing is that when the client attempts to print after selecting a valid Citrix printer (something like PRINTER1 on SERVER (from BOX) in session NUMBER), one of two things occurs. If the user has a default printer set up in Citrix, the printout will print to that printer, instead of the one selected. If the user does not have a default Citrix printer, the application crashes. The users can view images fine and create new ones, but they cannot print. This did not happen with the printing system we used previously to LeadTools. I have done a lot of checking and logging and to me it looks like the correct printer is being set in the code, but for some reason it cannot be used. Can anyone offer some advice on this issue?

Depending on the file, we use both LeadTool's built-in printing functions and Windows printing functions. Either results in the same problem.

To print overlay files, which we define as a background image covered in generated text, we use the printing functionality of LBitmapWindow. An excerpt from our code:
LBitmapWindow *m_pLTWindow = new LBitmapWindow();
m_hWnd = m_pLTWindow->CreateWnd(pControl->m_hWnd, 1001, WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP | WS_CLIPSIBLINGS);
if(m_hWnd == NULL)
return FALSE;
...
BOOL bSet = SetDefaultPrinter(m_strPrinterName);//newly provided printer
if(bSet)
m_pLTWindow->Print()->Print();
else
return FALSE;
To print a standard image like a scanned image, we use Windows printing functionality with Leadtools integration. An excerpt:
BOOL bSet = SetDefaultPrinter(((printParams*)lpParam)->strPrinterName);//newly provided printer
if(!bSet)
return FALSE;

LPrint printer;
HDC hdcPrinter = printer.GetPrinterDC();
if(hdcPrinter == NULL)
return FALSE;

...

// Print the image
for(int i = nStartPage; i <= nEndPage; i++)
{
// Load up the image...
loadedBitmap.Load(((printParams*)lpParam)->strFileName.GetBuffer(), fileInfo.BitsPerPixel, fileInfo.Order, i);
printer.SetBitmap(&loadedBitmap);

if(i > 1)
StartPage(hdcPrinter);

if(!printer.PrintFast(hdcPrinter, 1, 1, nWidth, nHeight, (i==nEndPage)))
return FALSE;
if(i < nEndPage)
EndPage(hdcPrinter);
}

 

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 : Thursday, July 30, 2015 5:03:27 AM(UTC)
Faris Shahin

Groups: Registered, Tech Support
Posts: 26


In order to see if the problem is LEAD-related, I've created an application that prints its own window using the printer you select. The only functions used here are Windows APIs. Please test it at your side with the machine that has the problem and inform me with your findings. Does it work or does it act the same way as your LEAD-based application?
File Attachment(s):
SimplePrint.zip (10kb) downloaded 36 time(s).
Faris Shahin
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Tuesday, August 4, 2015 10:59:48 AM(UTC)
hgarnett

Groups: Registered
Posts: 6


Hello, thanks for the application. I have gotten feedback from my client that the correct printer was printed to via Citrix when this program was used. The user did receive an error message: The variable 'hdcPrinter' is being used without being initialized, but the printout occurred successfully.
 
#4 Posted : Sunday, August 9, 2015 4:18:37 AM(UTC)
Faris Shahin

Groups: Registered, Tech Support
Posts: 26


I have updated the project to use the minimum requirement to print using LEADTOOLS. Before testing, make sure that you're using your license file and developer key. Please test it and inform me with your findings. Does the modified application show the problem or not?
File Attachment(s):
SimplePrint_MinimalLT.zip (113kb) downloaded 33 time(s).
Faris Shahin
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#5 Posted : Friday, August 14, 2015 11:04:38 AM(UTC)
hgarnett

Groups: Registered
Posts: 6


Hello, thanks for your continuing assistance. I've built the project for myself and the page loads and prints, but it will not display the image. I get an error message on L_LoadBitmap, error -356 which is ERROR_CMP_FILTER_MISSING. I suspect that I've missed an include somewhere but I can't figure out where it is, even after looking through documentation. I don't remember doing anything with filters during the original coding process.

I was able to print the non-image successfully and can pass it on to my client to try the same thing if you don't think that viewing the image is a big deal. The real problem is the printing, after all. Please let me know, and thanks again.
 
#6 Posted : Friday, August 14, 2015 12:57:44 PM(UTC)
hgarnett

Groups: Registered
Posts: 6


Hello, an update. I managed to get the image display working by copying all of the DLLs into the working directory. I am going to pass this application to my client for further testing and I will let you know what happens.
 
#7 Posted : Sunday, August 16, 2015 12:40:53 AM(UTC)
Faris Shahin

Groups: Registered, Tech Support
Posts: 26


You don't need to copy all DLLs to the working directory. To be able to load CMP images, you'll need to only copy the Lfcmpu.dll for 32-bit applications or Lfcmpx.dll for 64-bit applications. Refer to "Files To Be Included With Your Application" in our online documentation for more information about which DLLs are needed.
Faris Shahin
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#8 Posted : Thursday, August 20, 2015 6:42:34 AM(UTC)
hgarnett

Groups: Registered
Posts: 6


Hello again. Thanks for that clarification on required files. I provided the client with the new SimplePrint exe and the required files, after successfully testing locally, and they reported to me that with this new exe, the printouts are going to the default Citrix printer or crashing if no default Citrix printer has been assigned to the user. So this is back to the original reported problem with just the minimal build of LeadTools.

This definitely leads me to believe there is some kind of issue with LeadTools here. Can you please let me know how I can get a fix for this issue?
 
#9 Posted : Wednesday, August 26, 2015 6:39:06 AM(UTC)
Faris Shahin

Groups: Registered, Tech Support
Posts: 26


I want you to run one more test with the attached application. This application does not use LEADTOOLS (or even load our DLLs at all) except when the user clicks "Yes" in the message box that appears when he prints. In other words, the user can either print using Windows alone or additionally print using LEADTOOLS. You'll only need to ship Ltkrnu.dll and Ltdisu.dll with this project. Also, change the path to the license file and the developer key before deploying the project.
To test properly on the user's computer, make sure you do NOT add any LEADTOOLS LIB files to the project so that only delayed loading is used at runtime.
File Attachment(s):
SimplePrint_LTandWin.zip (9kb) downloaded 34 time(s).
Faris Shahin
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#10 Posted : Monday, September 14, 2015 4:09:31 AM(UTC)
hgarnett

Groups: Registered
Posts: 6


Hello again, sorry for the delay. I provided the new test application to my client and they said that this time Leadtools worked correctly and printed to the printer that they chose. I'm not sure why loading dynamically would change the behavior of the app. What then is your suggestion for going forward with this?
 
#11 Posted : Tuesday, September 15, 2015 4:22:53 AM(UTC)
Faris Shahin

Groups: Registered, Tech Support
Posts: 26


To be honest I'm not sure why this happens.
Try to make sure the computer does not have any other copies of LEADTOOLS DLL files.
If that doesn't solve it, we can try to dig deeper and run tests at our side, so please open and email case for this by sending a message to support@leadtools.com
Faris Shahin
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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-2019, Yet Another Forum.NET
This page was generated in 0.286 seconds.