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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print JPG files 5

Status
Not open for further replies.

CaptainD

Programmer
Jul 13, 1999
644
US
I'm trying to figure out how to batch print about 120 JPG files. I have it set up to print them as PDF files through Acrobat but the files grow to 10 times the size of the original PDF file (60 to 70 meg in some cases) when sent to the printer.
I scanned map pages to BMP's and cleaned them up in Paint, changed them to jpg files and reduced their size to around 100k, but when I re-create them as pdf's they're back to their original size. I can print them individually as jpg files with Microsoft Office Picture Manager very quickly and the size remains the same. and I can shell to run Picture manager but I don't know how to make it print the pictures through the program (or any other program) without user input. I want it to print each jpg as it cycles through the list by its self, then close the program that I use to open the file.
 
You could try using a form with an Image Box. Set the Stretch property to true if you want to set all sizes the same.

Do until all images are printed
Load an image
Print the form
Loop

[gray]Experience is something you don't get until just after you need it.[/gray]
 
I tried that, I need to print to 11 X 17 (The JPG files are scanned maps for the fire department I work for. These were apartment complex drawings that were done by hand years ago) I can use the Windows XP print wizard and print all the pages and everything comes out fine. But I would like to do it through my program along with the PDF files it prints. When i use the form with a picture box, they're to small
 
Have you tried doing a search on this form.

I'm sure there are quite a few threads that cover printing directly from a picture box.

Printer.PaintPicture Picture1.Picture, 0, 0

Alan

[gray]Experience is something you don't get until just after you need it.[/gray]
 
I've searched it for printing jpg files. I'll try your suggestion and see what I can find. Thanks
 
Printer.Paintpicture can do it. I use this method to print out picturebox contents to a D size plotter ( 24" x 36" ) and they size fine.
 
Getting closer but when I send it to the printer with either of the three methods, it goes to que but never prints and the printer never indicates it is getting the information. I assume that if you do not specify the printer, it goes to the defualt (which it's doing)

I tried Printer.EndDoc (to see if that would complete the print) and that clears it without printing anything.

Code:
Private Sub cmdPrintJPG_Click()
On Error GoTo ErrHandler
Dim i As Integer
Dim sFileName As String

    sFileName = flbFileListbox.Path & "\" & flbFileListbox.FileName
    'Printer.PaintPicture LoadPicture(sFileName), 0, 0
    Printer.PaintPicture LoadPicture(sFileName), 0, 0, 24480, 15840
    'Printer.PaintPicture Picture1.Picture, 0, 0
    



Exit Sub
ErrHandler:
    MsgBox "Error printing JPG files. Error # " & Err.Number & ", " & Err.Description, vbOKOnly, "Error"
End Sub
 
Vamp,

That is a nice one! A star for you.

Captain,

This is working for me;

Private Sub Command1_Click()

'puts an 8*10 inch image of the jpg onto the printer

Printer.ScaleMode = vbInches

Printer.PaintPicture LoadPicture("hughshead.jpg"), 0, 0, 8, 10

Printer.EndDoc

End Sub

Can't see it making a difference but my test done with an jpg image smaller than 8*10.

regards Hugh,
 
Changing Printer.ScaleMode to vbinches did the trick.
Stars to those that helped. Thanks

here is the working code for those that are interested.

Code:
Private Sub cmdPrintJPG_Click()
On Error GoTo ErrHandler
Dim i As Integer
Dim sFileName As String
    
    'sFileName = flbFileListbox.Path & "\" & flbFileListbox.FileName
    Printer.ScaleMode = vbInches
    Printer.Orientation = vbPRORLandscape
    Printer.PaperSize = vbPRPS11x17
    Printer.PaintPicture Picture1.Picture, 0, 0, 17, 11
    Printer.EndDoc

Exit Sub
ErrHandler:
    MsgBox "Error printing JPG files. Error # " & Err.Number & ", " & Err.Description, vbOKOnly, "Error"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top