Summary
This document provides steps for troubleshooting TWAIN with Citrix Presentation Server 4.0.
Procedure
TWAIN troubleshooting can be divided into two sections:
• Acquiring the scanner through an ICA session
• Acquiring the image through the scanning process.
Section 1: Acquiring the scanner through an ICA session
1. Ensure that the MetaFrame edition is set to Advanced or Enterprise.
2. Ensure that the MetaFrame version is set to 4.0.
3. Ensure that a version 9.0 or later Program Neighborhood client is used. Upgrade to the latest ICA client or downgrade the client to isolate client-side issues.
4. Test your scanner and application locally by disabling the Windows Image Acquisition (WIA) service. This will ensure that only TWAIN is being used for image acquisition.
5. A TWAIN-enabled application needs to be installed on the server to use this feature. Perform the same test from step 4 on the server console to verify that you can acquire images successfully on the console.
6. On the ICA Client device, ensure that these two files are installed:
Program Files\Citrix\ICA Client\VDTWN.dll
Program Files\Citrix\ICA Client\CtxTwnPA.exe
7. When you launch the TWAIN compliant application on the server (through an ICA session). Use Filemon or task manager to verify CtxTwnPA.exe is being launched on the client workstation when trying to acquire a scanner from the published application. This will help determine if the TWAIN calls are being redirected to the client.
8. For TWAIN redirection, some applications are not Terminal Services aware and look for Twain_32.dll in the \WINDOWS directory of the user profile (by default, C:\Documents and Settings\UserName\Windows). Copying Twain_32.dll into the \Windows directory of each user profile resolves this issue.
9. Use Filemon to verify that application is looking for Twain_32.dll and what folder it is trying to access.
10. Also, this may be corrected by adding the application to the Terminal Services application compatibility list with the following two flags specified (see Microsoft Knowledge Base Article 186499 for more information):
Windows 32-bit application: 0x00000008
Do not substitute user Windows directory: 0x00000400
11. To automate the process of enabling these flags on the server, copy the following text to a text editor and save it as a .reg file. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\Photoshop] “Flags”=dword:00000408
Note: You may need to combine these flags with other compatibility flags needed for the application.
This feature supports the following modes of TWAIN information transfer:
• Native
• Buffered Memory (most scanning software works by default in Buffered Memory mode).
Notes: The Disk File transfer mode is not supported.
An ICA session from a Win16 or WinCE device (HPC and WBT) DOES NOT currently support TWAIN redirection.
Section 2: Acquiring the image through the scanning process
After ensuring the scanner availability through above processes, follow the steps below for proper image acquisition through an ICA session.
1. Verify if it is application specific, does it happen only to their custom application or all the applications on the server. Microsoft Image Scanning utility can be a useful tool for verifying image acquisition process.
2. Try with color or grayscale and see if you are able to scan one way or the other.
3. Known Issue: When using TWAIN redirection, third-party published scanning applications may unexpectedly exit while receiving scan data from the client. This issue is limited to scanning in grayscale mode.
CTX108555 – Hotfix PSE400R01W2k3013 - For Citrix Presentation Server 4.0 for Windows Server 2003
CTX109090 – Hotfix PSE400R01W2K023 - For Citrix Presentation Server 4.0 for Windows 2000 Server
4. If this issue is happening with a custom application only, get input from your custom application developer with their feedback on scanning inconsistencies with their application.
More Information
CTX107059 – Advanced Concepts Guide
CTX107409 – TWAIN Redirection Support with Presentation Server 4.0
CTX106765 – Explaining Scanner Support with Citrix MetaFrame
CTX117445 – Some TWAIN enabled applications may appear to hang as dialog boxes can not be closed
CTX108392 – TWAIN Redirection Does Not Work Properly When Using Web Client Version 9.x