|
-
Sep 24th, 2009, 03:08 PM
#1
Thread Starter
Addicted Member
print tiff file
Hi gurus
I just need to load and Tiff file and print all its pages, if its one then one if they are multiple well then print them all
Thanks a bunch for any help,its a legacy app.
Thanks again
-
Sep 24th, 2009, 06:06 PM
#2
Re: print tiff file
ok... do you have any specific questions about the code that YOU have already written and tried?
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Sep 24th, 2009, 09:39 PM
#3
Thread Starter
Addicted Member
Re: print tiff file
my question would be what would be my best approach to do this
I have tried the system.drawing.imaging but I cant find once the file is loaded how to print it, so I was looking for help on a better approach on this particular matter and how to get this done in a simple way.
Thanks
-
Sep 24th, 2009, 09:57 PM
#4
Re: print tiff file
If you have the image loaded the you can send it to the printer using a PrintDocumentControl....
vb Code:
Dim img As Image
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
img = New Bitmap("c:\IMG_0425.jpg")
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, New PrintPageEventHandler(AddressOf Me.pd_Print)
pd.Print()
End Sub
Private Sub pd_Print(ByVal sender As Object, ByVal e As PrintPageEventArgs)
e.Graphics.DrawImage(img, 10, 10)
End Sub
I don't have any tiff images, so I tested it with a jpg. Not sure if it matters... I wouldn't think so.
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Sep 25th, 2009, 08:09 AM
#5
Re: print tiff file
If you are doing a multi-page tiff, you need to do a little bit more on top of what kebo mentioned, as you need to print multiple pages:
Code:
Dim img As Image
Dim pgnum As Integer = 0
Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click
img = Image.FromFile("C:\Temp\0000000C.TIF")
Dim p As New PrintDocument
AddHandler p.PrintPage, New PrintPageEventHandler(AddressOf pd_Print)
p.Print()
End Sub
Private Sub pd_Print(ByVal sender As Object, ByVal e As PrintPageEventArgs)
If pgnum < (img.GetFrameCount(Imaging.FrameDimension.Page) - 1) Then
e.Graphics.DrawImage(img, 10, 10)
pgnum += 1
img.SelectActiveFrame(Imaging.FrameDimension.Page, pgnum)
e.HasMorePages = True
Else
e.Graphics.DrawImage(img, 10, 10)
e.HasMorePages = False
End If
End Sub
-
Sep 25th, 2009, 09:08 AM
#6
Thread Starter
Addicted Member
Re: print tiff file
Thanks a bunch gurus ,I will try your approach
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|