Scanjet N9120 Cannot load/save settings anymore

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
sebascomeau
Posts: 16
Joined: Fri Jan 31, 2014 5:31 pm

Scanjet N9120 Cannot load/save settings anymore

Post by sebascomeau »

We using the HP Scanjet N9120 to do our imaging. This scanner was only used by one desktop but we saved a profile that suit to our needs so the application will load this profile and ignore the default scanner profile saved by the HP Twain Administration. With this approach, we are sure that anybody that will use the application with the same scanner will used same settings.

The profile was saved with the device.Info.ProductName, in this case HP Scanjet N9120 Document TWAIN.xml. Everything worked fine until the day we needed to install the scanner and application on another desktop. We noticed that the scanner software and driver from HP website had been updated since our first installation, about 6 month ago.

On the first application start our saved profile was not loaded, in this case we noticed that the ProductName had changed from HP Scanjet N9120 Document TWAIN to HP Scanjet N9120 TWAIN and the application could not find this profile so it couldn't be loaded.

So we thought to generate a new profile for this ProductName. The scanner supports profiles, but after the update we couldn't load/save settings(profile) anymore. We get this error message "Cannot get profile of device".

So we noticed that our Vintasoft dll was not up to date, but nothing changed with the updated dll. To temporarily fix this problem we went on each desktop to configure a default profile for this scanner that suit the need of our application.

I checked the scanner driver version before and after update and it's the same. So I suspected that it's related to the HP Twain software.

Can you help us on this?
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by Alex »

Hello,

I think new and old drivers of your scanner have different profile formats. Please save profile of new driver, compare profile of new and old drivers and let me know results.

Best regards, Alexander
sebascomeau
Posts: 16
Joined: Fri Jan 31, 2014 5:31 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by sebascomeau »

This is the old profile format saved with VintaSoft.NET

Code: Select all

Version=1.90:ProfileNewDescription=Réglages par défaut:ProfileNameSelect=Dijito_Old_Profile:SerialNumber=CN29DF100G054W:FeederSelect=0:ScanType=3:TwainScanMode=0:ManualFeed=0:ManualTimeout=60:NopageTimeout=250:TransparencyType=0:SubWindowCount(-1)=0:SubWindowCount(0)=0:SubWindowCount(1)=0:WindowCountFront=1:WindowCountBack=1:CustomPageSizeWidthInch=1181/100:CustomPageSizeLengthInch=1701/50:PageSize=Scanner's Maximum:OverscanEnable=0:XResolution=200:YResolution=200:ScanOrientation=1:DataOrientation=1:SnapCoords=1:Units=1:BackgroundColor=1:XPositionInch=0:YPositionInch=0:ImageWidthInch=1181/100:ImageLengthInch=1701/50:SamplesPerPixel=1:BitsPerSample=8:PhotoMetric=0:ScanBitsPerPixel=1:Dither=Aucun:DitherPattern1.Length=256:DitherPattern1=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0:DitherPattern1Downloaded=0:DitherRows1=16:DitherColumns1=16:ColorReductMethod=3:ColorMap=0:BrightnessAuto=0:BrightnessManual=128:ContrastAuto=0:ContrastManual=128:GammaRational=9/5:TwainHighlight=180:TwainShadow=18:PreviewMode=0:PreviewSpeed=1:Gamma=0:GammaTableRed.Length=256:GammaTableRed=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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length=256:GammaTableBlue=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0:GammaTableBlueDownloaded=0:GammaLengthRed=256:GammaLengthGreen=256:GammaLengthBlue=256:FilterEnabled=0:FilterParameters=:BarType.Length=22:BarType=0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0:BarAutoReadFront=1:BarAutoReadBack=1:BarcodeEnabled=0:BarcodeParameters=:PatchcodeParameters=:DetectJobSep=0:LampTimer=0:Dropout=0:PreviewZoom=0:JpegCompressionFactor=4:ColorDropoutRadio=1:MCDEnabled(0)=0:MCDEnabled(1)=0:MCDEnabled(2)=0:MCDIndex=0:MCDRed(0)=255:MCDRed(1)=255:MCDRed(2)=255:MCDGreen(0)=255:MCDGreen(1)=255:MCDGreen(2)=255:MCDBlue(0)=255:MCDBlue(1)=255:MCDBlue(2)=255:MCDSensitivity(0)=5:MCDSensitivity(1)=5:MCDSensitivity(2)=5:DoubleDetect=0:DoubleDetectSens=0:ImpVersion=2:ImpSelect=0:ImpType=1:ImpSide=1:ImpEnable=0:ImpString=:ImpTokenMask=1:ImpCounterSelect=0:ImpCounterDigits=5:ImpCounterIncStart=14:ImpCounterIncStep=1:ImpLowInkError=1:ImpFont=System:ImpYOffsetPixels=0:ImpYOffset=0:ImpOrientation=4:ImpStringUI=:LastPageEndorser=:ImpNoCounterUpdate=0:
and this is the new profile saved with the HP Twain Administration tool because when trying to save with VintaSoft.NET we get this error "Cannot get profile of device"

Code: Select all

<?xml version="1.0"?>
<Profiles>
	<FileVersion>4</FileVersion>
	<ScanSelMode>0</ScanSelMode>
	<Profile ID="108" Name="Dijito">
		<HPPembroke>
			<Version>4</Version>
			<Scanner>HP Scanjet N9120</Scanner>
			<Valid>1</Valid>
			<ImageType>4</ImageType>
			<Resolution>200</Resolution>
			<Highlight>180</Highlight>
			<Shadow>18</Shadow>
			<Brightness>0</Brightness>
			<Contrast>0</Contrast>
			<Gamma>1.800</Gamma>
			<Threshold>127</Threshold>
			<Dither>2</Dither>
			<QualityMode>1</QualityMode>
			<PageType>1001</PageType>
			<PageSize L="0" T="0" R="11.81" B="34.0233333333333"/>
			<ScanArea L="0" T="0" R="11.81" B="34.0233333333333"/>
			<Units>1</Units>
			<Snap>0</Snap>
			<PageContentOrientation>0</PageContentOrientation>
			<PageFaces>1</PageFaces>
			<ScanSource>8</ScanSource>
			<ADFFeedEdge>0</ADFFeedEdge>
			<FlatbedPlacement>0</FlatbedPlacement>
			<MultiPickDetect>0</MultiPickDetect>
			<MultiPickXZone>1</MultiPickXZone>
			<MultiPickXZoneLen>2.000</MultiPickXZoneLen>
			<CmpressEnable>2</CmpressEnable>
			<CmpressJPEGLvl>2</CmpressJPEGLvl>
			<ADFBackground>2</ADFBackground>
			<AutoOrient>0</AutoOrient>
			<AutoOrientLang>11</AutoOrientLang>
			<ACD_Map>1</ACD_Map>
			<ACDSensitivity>50</ACDSensitivity>
			<Deskew>0</Deskew>
			<Descreen>0</Descreen>
			<BlankPageRemoval>0</BlankPageRemoval>
			<BPDSensitivity>50</BPDSensitivity>
			<HoleRemoval>0</HoleRemoval>
			<EdgeErase>0</EdgeErase>
			<Edges L="1" T="1" R="1" B="1"/>
			<FillColor>0</FillColor>
			<PageMerge>0</PageMerge>
			<AutoThreshold>0</AutoThreshold>
			<AutoExposure>0</AutoExposure>
			<DotShadeRemoval>0</DotShadeRemoval>
			<SmoothText>0</SmoothText>
			<BkgndFilter>0</BkgndFilter>
			<BkgndFilterLevel>50</BkgndFilterLevel>
			<Despeckle>0</Despeckle>
			<DespeckleLevel>50</DespeckleLevel>
			<LineFilter>0</LineFilter>
			<ImprntEnable>0</ImprntEnable>
			<ColorDropoutMode>1</ColorDropoutMode>
			<DropoutChannel>2</DropoutChannel>
			<DropoutColor En="0" R="255" G="255" B="255" Sens="5"/>
			<DropoutColor En="0" R="255" G="255" B="255" Sens="5"/>
			<DropoutColor En="0" R="255" G="255" B="255" Sens="5"/>
		</HPPembroke>
	</Profile>
</Profiles>
So why VintaSoft.NET can save/load the old profile and cannot for the new?
sebascomeau
Posts: 16
Joined: Fri Jan 31, 2014 5:31 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by sebascomeau »

Any progress on this?
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by Alex »

Hello,

"Cannot get profile of device" means that SDK could not get profile from scanner. In your code I see that you are calling the Device.SaveSettings method when scan completed/failed/canceled. You can call the Device.SaveSettings method only when device is opened, i.e. Device.State = DeviceState.Opened. Please check the device state when you calling the Device.SaveSettings method and let me know results.

Best regards, Alexander
sebascomeau
Posts: 16
Joined: Fri Jan 31, 2014 5:31 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by sebascomeau »

On scan completed the Device.State is DeviceState.Opened. I received the same exception message.
sebascomeau
Posts: 16
Joined: Fri Jan 31, 2014 5:31 pm

Re: Scanjet N9120 Cannot load/save settings anymore

Post by sebascomeau »

We did the following test that you provided to use:
1. Download Twacker from twain.org: 2. Install Twacker on computer connected with your scanner
3. Run Twacker
4. Select the source: File => Select Source...
5. Enable usage of TWAIN 2.0 DSM: File => TWAIN 2.0
6. Open the device manager: Special => Load/Open SM
7. Open the device: Special => Open Source
8. Get device profile data: Special => Send..., DAT: => DAT_CUSTOMDSDATA, press the "Send" button and save profile data to a file.
And this is the result. This is what happens after the “send” button is clicked.

Image

This is your answer after our test for reference:
Twacker (application from TWAIN Working Group) also cannot get profile data from your TWAIN driver.
You have "bad" TWAIN driver or limitation in TWAIN driver. Please contact driver * (Hewlett Packard)
for information about this problem.
We are trying to contact HP to found a solution...
Post Reply