shadowrl2644
Programmer
Look for a way to print a Dos text file (usually a multi page TIff image)
I have a routine that displays a Multi page Tiff image to the screen but when is comes to printing is the hard part.
Using a network printer the image takes over a minute per page to print.
Does any one have any ideas of printing a Dos Text file thru a network printer using clarion 6.2
I am using the Image Ex software add-ons to display the scanned images.
Sample code as followed
GlobalErrorMessage = ''
Print_Loop_Count = 0
Loop while Print_Loop_Count < Loc:ImageCount
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Printer.Init() ! initialize object
Printer.BeginDoc('Printing example') ! begin a print job
Assert(Printer.GetMargins(ml, mt, mr, mb)) ! determine non-printable margins of the page and
mx = MaxInt(ml, mr) ! use the higher value for both sides
my = MaxInt(mt, mb)
Assert(Printer.GetPageSize(bw, bh)) ! calculate the width and height of the printable area
nw = bw - mx
nh = bh - my
iw = nw / TilesX ! determine the size of the images depending on the
ih = nh / TilesY ! printable area and number of images to print
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ImageExViewer1.Bitmap.LoadFromFile(loc:filename, false, Print_Loop_Count)
Select(?Viewer)
Post(Event:Accepted, ?Loc:imageIndex)
ThisWindow.Reset()
Display
! Setup the thumbnailer
Nailer.Width = iw
Nailer.Height = ih
Nailer.StretchFilter = IESF:Linear ! we want good image quality!
Nailer.DrawMode = ImageExDrawMode:Blend
Nailer.AutoOrientation = FALSE ! Important! TRUE would stretch the output wrongly
Nailer.Color = COLOR:WHITE
Nailer.Mode = ImageExThumbMode:Center
ImageExViewer1.Bitmap.LoadFromFile(loc:filename, False, Print_Loop_Count)
Select(?Viewer)
Post(Event:Accepted, ?Loc:imageIndex)
ThisWindow.Reset()
Display
Nailer.CreateThumbnail(loc:filename, Thumb, 0, Print_loop_Count) ! Create the thumbnail for the current image
! Thumb.PrintToPrinter(0, 0, iw, ih, 'printing doc')
! Printer.PrintBitmap(Thumb, 0, 0) ! mx+x*iw, my+y*ih, iw, ih) ! the one that works
!testing this one
Printer.PrintBitmap(Thumb, mx+x*iw, my+y*ih, iw, ih)
IF Message('Send Page ' & Print_Loop_Count+1 & ' of ' & MaxImageCount & ' to printer?', 'Print Document Screen', ICON:QUESTION, BUTTON:YES+BUTTON:NO) = BUTTON:YES
Printer.EndDoc()
ELSE
Printer.AbortDoc()
END
Print_Loop_Count += 1 ! Get next page
End
I have a routine that displays a Multi page Tiff image to the screen but when is comes to printing is the hard part.
Using a network printer the image takes over a minute per page to print.
Does any one have any ideas of printing a Dos Text file thru a network printer using clarion 6.2
I am using the Image Ex software add-ons to display the scanned images.
Sample code as followed
GlobalErrorMessage = ''
Print_Loop_Count = 0
Loop while Print_Loop_Count < Loc:ImageCount
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Printer.Init() ! initialize object
Printer.BeginDoc('Printing example') ! begin a print job
Assert(Printer.GetMargins(ml, mt, mr, mb)) ! determine non-printable margins of the page and
mx = MaxInt(ml, mr) ! use the higher value for both sides
my = MaxInt(mt, mb)
Assert(Printer.GetPageSize(bw, bh)) ! calculate the width and height of the printable area
nw = bw - mx
nh = bh - my
iw = nw / TilesX ! determine the size of the images depending on the
ih = nh / TilesY ! printable area and number of images to print
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ImageExViewer1.Bitmap.LoadFromFile(loc:filename, false, Print_Loop_Count)
Select(?Viewer)
Post(Event:Accepted, ?Loc:imageIndex)
ThisWindow.Reset()
Display
! Setup the thumbnailer
Nailer.Width = iw
Nailer.Height = ih
Nailer.StretchFilter = IESF:Linear ! we want good image quality!
Nailer.DrawMode = ImageExDrawMode:Blend
Nailer.AutoOrientation = FALSE ! Important! TRUE would stretch the output wrongly
Nailer.Color = COLOR:WHITE
Nailer.Mode = ImageExThumbMode:Center
ImageExViewer1.Bitmap.LoadFromFile(loc:filename, False, Print_Loop_Count)
Select(?Viewer)
Post(Event:Accepted, ?Loc:imageIndex)
ThisWindow.Reset()
Display
Nailer.CreateThumbnail(loc:filename, Thumb, 0, Print_loop_Count) ! Create the thumbnail for the current image
! Thumb.PrintToPrinter(0, 0, iw, ih, 'printing doc')
! Printer.PrintBitmap(Thumb, 0, 0) ! mx+x*iw, my+y*ih, iw, ih) ! the one that works
!testing this one
Printer.PrintBitmap(Thumb, mx+x*iw, my+y*ih, iw, ih)
IF Message('Send Page ' & Print_Loop_Count+1 & ' of ' & MaxImageCount & ' to printer?', 'Print Document Screen', ICON:QUESTION, BUTTON:YES+BUTTON:NO) = BUTTON:YES
Printer.EndDoc()
ELSE
Printer.AbortDoc()
END
Print_Loop_Count += 1 ! Get next page
End