Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Look for a way to print a Dos text file (usually a multi page TIff )

Status
Not open for further replies.

shadowrl2644

Programmer
Apr 19, 2002
10
US
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
 
Hi,

Have you tried printing this .TIFF using other interactive tools - to establish a reasonable speed for this task.

I'm asking as I've been using a .TIFF inside of my program - converting it to a texture as a node in a 3D SceneGraph. I was going to save the texture in a blob and use it on future instances vs. using the file. But I found that a 1.9MB TIFF expanded to a 138MB Bitmap.

My point is, possibly One Minute is good performance for the task at hand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top