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 : Wednesday, January 23, 2013 9:26:35 AM(UTC)

JPP  
JPP

Groups: Registered
Posts: 3


Hi !

I don't know if it's possible but here what i need to do... Without success for now.

I created a Master Form Template (.bin, .xml, .tif) with the MasterForm Editor and i would like to alter (within the "Code") a text Field Height prior to process an image with the template.

I'm able to process the image with a standard AutoFormsEngine but what if i need to edit the MasterForm template just before ?

Is it possible ?

Thanks

JP
 

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 : Friday, January 25, 2013 4:25:42 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

The TextFormField class can be used to edit the fields programmatically. For details see the help topic:
http://www.leadtools.com/help/leadtools/v175/dh/fp/leadtools.forms.processing~leadtools.forms.processing.textformfield.html
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Friday, January 25, 2013 6:07:34 AM(UTC)

JPP  
JPP

Groups: Registered
Posts: 3


Thank you for your reply.

I'm able to edit the field but, when i'm processing the page, i get the Field Status to Failed.

Here is my code example ...


RasterDefaults.DitheringMethod = RasterDitheringMethod.None;

RasterCodecs FormsCodec = new RasterCodecs();

IOcrEngine FormsOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false);
FormsOcrEngine.Startup(FormsCodec, null, System.IO.Path.GetTempPath(), "");
BarcodeEngine FormsBarcodeEngine = new BarcodeEngine();

FormRecognitionEngine RecognitionEngine = new FormRecognitionEngine();
FormProcessingEngine ProcessingEngine = new FormProcessingEngine();
ProcessingEngine.OcrEngine = FormsOcrEngine;
ProcessingEngine.BarcodeEngine = FormsBarcodeEngine;


FormRecognitionAttributes Attributes = new FormRecognitionAttributes();
Attributes.SetData(File.ReadAllBytes(Path.Combine(pFormSetPath, "Page2.bin")));


FormRecognitionProperties Properties = new FormRecognitionProperties();
Properties = RecognitionEngine.GetFormProperties(Attributes);


ProcessingEngine.LoadFields(Path.Combine(pFormSetPath, "Page2.xml"));
ProcessingEngine.Pages[0].Single(x => x.Name == "MyField").Bounds = new LogicalRectangle(10, 10, 100, 100, LogicalUnit.Pixel);

RecognitionEngine.OpenForm(Attributes);


RasterImage Image = FormsCodec.Load(Path.Combine(pFormSetPath, "Page2.tif"), 1, CodecsLoadByteOrder.BgrOrGray, 1, -1);
RasterImage ImageToProcess = FormsCodec.Load(pImagePath, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1);


ProcessingEngine.Process(ImageToProcess, null);

Thanks
 
#4 Posted : Sunday, January 27, 2013 6:31:04 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

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

If you use our Main forms demo with your images and forms, do they work?
If you can't fix the problem, send us the following:
1. What's the build number (file version) of Leadtools.DLL?
2. Sample images and form that trigger the problem.

Note: If you send any attachments, please put them in a ZIP or RAR file to ensure our server delivers them correctly. Also, do not use the Preview feature.
 
#5 Posted : Monday, January 28, 2013 9:27:37 AM(UTC)

JPP  
JPP

Groups: Registered
Posts: 3


Hi,

It works on the demo application.

I'm using the version 17.5.0.53 .NET x86

Find attached, FormSet, a sample page and the code...

Thanks
File Attachment(s):
Out.zip (568kb) downloaded 40 time(s).
 
#6 Posted : Tuesday, January 29, 2013 6:07:44 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

I checked this issue using the following code and I was not able to see the problem:
+-------------------+
RasterDefaults.DitheringMethod = RasterDitheringMethod.None;

RasterCodecs FormsCodec = new RasterCodecs();

IOcrEngine FormsOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false);
FormsOcrEngine.Startup(FormsCodec, null, System.IO.Path.GetTempPath(), "");
BarcodeEngine FormsBarcodeEngine = new BarcodeEngine();

FormRecognitionEngine RecognitionEngine = new FormRecognitionEngine();
FormProcessingEngine ProcessingEngine = new FormProcessingEngine();
ProcessingEngine.OcrEngine = FormsOcrEngine;
ProcessingEngine.BarcodeEngine = FormsBarcodeEngine;

FormRecognitionAttributes Attributes = new FormRecognitionAttributes();
Attributes.SetData(File.ReadAllBytes(@"..\..\..\Form\Page2.bin"));
          
FormRecognitionProperties Properties = new FormRecognitionProperties();          
Properties = RecognitionEngine.GetFormProperties(Attributes);

ProcessingEngine.LoadFields(@"..\..\..\Form\Page2.xml");
ProcessingEngine.Pages[0].Single(x => x.Name == "Liste").Bounds = new LogicalRectangle(10, 10, 100, 100, LogicalUnit.Pixel);

RasterImage Image = FormsCodec.Load(@"..\..\..\Form\Page2.tif", 1, CodecsLoadByteOrder.BgrOrGray, 1, -1);

RecognitionEngine.OpenMasterForm(Attributes);
          
RasterImage ImageATraiter = FormsCodec.Load(@"..\..\..\Page2-1.png", 0, CodecsLoadByteOrder.BgrOrGray, 1, 1);

ImageATraiter.ChangeViewPerspective(RasterViewPerspective.TopLeft);          

ProcessingEngine.Process(ImageATraiter, null);
+-------------------+

Please recheck the same issue using the above code. If the problem persists, please try to isolate the problem in a small working project (not your full application) and send it to support@Leadtools.com and mention this forum post in your email.

Note: If you send sample files or any attachments, please put them in a ZIP or RAR file to ensure our server delivers them correctly.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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.655 seconds.