Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Printer.PaintPicture Prints The Picture In Dos-based Printing Or Windows-based Printing


Printer.PaintPicture prints the picture in dos-based printing or windows-based printing ...?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Printing To Printer Using PaintPicture
I am trying to print a graph to a printer.
I have a form with a Picturebox on it, scaled to the Printer.Width, .Height
Inside this picturebox I have 3 Pictureboxes (one for the graph lines, one for the Y axis marks, one for x axis marks). Graph data and axis markers are drawn using .Line commands
I can make a correct graph on the form. The problem is how to print it!
-Printform has many bugs, so its no use.
I have tried to use Printer.Paintpicture mainpicture
but it only prints one of the three pictureboxes.

How do I do this?

Printing Picture Using PaintPicture Method
Hi chaps and chapesses,

I have a picturebox on the screen that i load with a picture. I use Bitstretch and bitblt to modify the image and then print it to the printer.

Why then do i get the original image printed and not the modified image (as the picture on the screen is the modified one)?

Any help would save me from insanity,

Cheers peeps

DOS BASED PRINTING
I want to print out master-child based record on dos based .
What is essential requirement for primary coding for same ?
How to wrap texts for same i.e. DOS based printing.

Dos Based Printing Using Vb 6.0
Hi I am trying to print a receipt uisng vb 6.0.I am preparing a batch file to redirect the input to the printer.I am attaching the code for the same. So PLZ help me.Thanks in advance

Code:

Public Sub PrintDetail(ByVal Doc As CDocument, Optional FileName As String = "RepPRN")
Dim I%, J%, k%, FlNo%, Res
Dim mDos As CDos
On Error GoTo ErrorHandler

If mvarMagicNo <> 14091978 Then Exit Sub
For k = 1 To mvarNoOfCopies
If mvarWindowsPrint = True Then
For I = mvarFromPg To mvarToPg
If I <= Doc.TotalPages Then
Printer.PaperSize = vbPRPSLetter '1
'Printer.PaperSize = mvarPaperSize '256 'vbPRPSLedger '4
Printer.Width = mvarPaperWidth '20000
Printer.Height = mvarPaperHeight '17350 '15840
Printer.Orientation = mvarOriantation
Printer.Print " "
For J = 1 To Doc.GetPage(I).TotalLines
Printer.Font.Name = Doc.GetPage(I).GetLine(J).FontName
Printer.Font.Size = Doc.GetPage(I).GetLine(J).FontSize
Printer.Font.Bold = Doc.GetPage(I).GetLine(J).BoldFlag
Printer.Font.Italic = Doc.GetPage(I).GetLine(J).ItalicFlag
Printer.Font.Underline = Doc.GetPage(I).GetLine(J).UnderLineFlag
Printer.CurrentX = 100
Printer.Print Doc.GetPage(I).GetLine(J).LnStr
Next
Printer.EndDoc
End If
Next
ElseIf mvarDosPrint = True Then
'Dos Font Settings
Set mDos = New CDos
mDos.Define_Char



FlNo = FreeFile
Open Left(App.Path, 1) & ":" & FileName & ".Bat" For Output As #FlNo
Print #FlNo, "Type %1 > PRN"


Close #FlNo


'-------------------------------------------------------
For I = mvarFromPg To mvarToPg
If I <= Doc.TotalPages Then
FlNo = FreeFile
Open Left(App.Path, 1) & ":" & FileName & I & ".tmp" For Output As #FlNo
For J = 1 To Doc.GetPage(I).TotalLines
Select Case mvarPrintStyle
Case 1:
Print #FlNo, mDos.Chr2 & Doc.GetPage(I).GetLine(J).DosStr & mDos.Cnd2 & mDos.Chr2
Case 2:
Print #FlNo, mDos.Chr1 & Doc.GetPage(I).GetLine(J).DosStr & mDos.Cnd2 & mDos.Chr2
Case 3:
Print #FlNo, mDos.Cnd1 & Doc.GetPage(I).GetLine(J).DosStr & mDos.Cnd2 & mDos.Chr2
Case Else
Print #FlNo, mDos.Chr2 & Doc.GetPage(I).GetLine(J).DosStr & mDos.Cnd2 & mDos.Chr2
End Select
Next
Close #FlNo
Res = Shell(Left(App.Path, 1) & ":" & FileName & ".Bat " & Left(App.Path, 1) & ":" & FileName & I & ".tmp", vbHide)
End If
Next

Else
MsgBox "Invalid Printout Style selected", vbOKOnly + vbInformation, App.Title
Exit Sub
End If
Next
Exit Sub
ErrorHandler:
MsgBox "Printer Problem , Please check your Printer " & vbCrLf & _
"[for,Inject printer Contact your Administrator]", vbOKOnly + vbCritical, App.Title
End Sub

Printing A Web-based Datagrid
Could anyone please help!!
I am trying to print a datagrid on a vb.net web based application but am currently struggling! Any help would be much appreciated!!



Matt.

DOS Based Master - Detail Printing At Margin
Now m using data report for master detail printing of Invoice.
Report prints Client name and address at group header.
detail contains
srno, Name, Description, Qty, rate, total field.
Now my confusion starts ?
as report is windows based printing it very slow and overhead to head of printer head.
so i need to move to DOS Based.
for DOS based printing , first i need to get paper size.
1) How to get exact paper size.
2) how to automatically wrap text if exceed by some width ( asking for description of item)
3) how to print some text at specific margin i.e. left and top in inch

pls guide me which help me to make powerful dos based report with good speed.
thanx in advance.


It May seem Impossible, But Possibly We don't know the way how to reach there ????

Edited by - wwwdirzala on 11/29/2004 9:37:08 PM

Conversion Of Windows-based App To Web-based App
Hello:

I have a VB 6.0 Client server application already written. The back end is in the form of a DLL that accesses the database. The front end is in the form of a Windows application. Now I want to create a web-based version of the front end. I think that the back end DLL will not need to be changed.

How does one go about converting an existing Windows-based VB 6.0 application to a web-based one? I am completly new to the world of web-based development, but there must be some resources available on the net that gives pointers on how to do this (If not, I think there should be!). Can anyone give me any tips on how to go about this task, or direct me to any instructional material on it? I am thinking that I can create a new "ActiveX Control" project in VB and then add my current form, etc. to it, but I have no idea of what the conversion entails. Please respond here or send responses to Brian149@cox.net. Thanks in advance!

Printing In Picture Box Then To Printer
I have a picture box where I load an image, then draw assorted lines and text on the image. All works as it should (VB6).

My problem is when I go to print out the picturebox (the image with the added lines and text) all I get is the image. How do I print out the modified picturebox?

I'm using the simplest code possible for testing purposes...

Printer.PaintPicture Form3.Picture1, 0, 0, Form3.Picture1.Width, Form3.Picture1.Height
Printer.EndDoc

What am I doing wrong?

Thx.

Printing A Picture Using The Printer Object
For those of you who use the printer object like I do, and need to print a logo or picture on the report, Microsoft's KB 175084 may be of help.

http://support.microsoft.com/kb/175084/en-us





Not Printing To HP Printer In Windows 98
I'm having a problem that is absolutely puzzling me. My printing routines work perfectly on Win2k/XP; however, with 98 and HP printers blank pages are coming out. Here's the interesting part: When i do real simple routines, such as printer.print it works. In the routines in my program I am using the printer.hdc...i'm drawing rectangles (using winapi) and using the RTF print to hdc functions (through the EM_FORMATRANGE message). Anyone had this happen? have this experience? Any clues as to what is going on? All drivers are updated...and i've had this reported across numerous 98 machines. Thank you!
Update....I've done some more testing, and it doesn't print when i print to the printers hdc. Any ideas?

Having Problem Printing Content Of A Picture Box To Printer
My brother is a lazy * * * so he's making me ask this question for him. So here it goes:

He's using a generic basic print to printer command that prints the active form. The printer prints the whole form just fine but it does not print the text content within the picture box in the form. Is there a way to print the form to the printer such that the contents of the picture box are printed as well?

Printing Directly To Printer W/out Windows
Can anybody help me with an api or code to print directly to the each printer on the network without going through windows. May be there is a third party control???

How Can I Get The Printer Status On Windows Nt/2000 Before Printing
how can i get the printer status on windows nt/2000 before printing

Datareport Always Prints To Windows Default Printer
I have a VB6 application which generates several datareports.

I am trying to redirect one of these reports to a specific network printer.

Have tried: Code:Set Printer = "Network printer name" but report is always printed on the Windows default printer.

I don't want to show a dialog box as the user must be unable to generate report on any other printer.

Does anybody know of a way of redirecting the print other than changing the Windows default using an API call?

 

Printing Line Plotting On Windows Default Printer
I have a form with line plotting as a polar plotting with vectors.
there are lines and circles with different widths snd styles and colors. the form is working well.
Now, I want to print the plot using default windows printer.
How to send it to printer? any help pl.

Draft Printing On Dotmatrix Printer From Windows Environment
I have an idea in my mind that there should be a activex control within visual basic which can print draft printing in windows os , this will also increase the printing speed of dot matrix printers and also reduce the cost of these printers. but i do not know how to perform it.


Looking for help of you

Zubair Khan

Text Mode Printing On Dotmatrix Printer From Windows
Hi there,
trying to print to a dotmatrix printer from vb6. I want to send in textmode because the printing is fast and economical. Any body know of anycontrol which helps you send printer escape codes to format the data onthe printer.

Need your reply quickly

Thanks

Mahesh Chopda



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

Cancel Printing Still Prints
I made a program that prints a "report form"

this is the code im using


VB Code:
On Error GoTo prolem  With CommonDialog1  .ShowPrinter  .CancelError = True  NumCopies = .CopiesEnd With  For i = 1 To NumCopies    Me.PrintForm    ' Prints the form using the print dialog info  Next i  Exit Subprolem:Exit Sub


When the user clicks cancel it still prints !!!!
how can i ammend this

Thanks all
Sam Lad

Setting Printer In Draft Mode For DOS Printing Speed && Output As DOS Printing
I want to print in Draft Mode with DOS Printing Speed using DataReport Designer. Anybody can help me How to set dot matrix printer in Draft Mode i.e., speed of printing must be same as DOS Printing Speed.
I am using Code:Printer.PrintQuality = vbPRPQDraft but this code is applicable for resolution quality and printing time is taking same as printing from Windows environment and I need output same as DOS Printing
Is there any special codes, functions or printer properties to be adopted for DOS Printing Speed. I appreciate if anybody can help me for giving me a sample project.
My email is : chemtsr@yahoo.co.in

Regards / MANI

Printing Multiple Prints With One Button
Hi, I m using Crystal 8.0 for my reports and would like to know how to send two different reports to, two different printers with one button or a command


Saif282

Printing In VB6 Using PaintPicture = Low Quality...
I have this photo printing problem. I tell VB to print by this method:

printer.print
Printer.PaintPicture LoadPicture(Text19)
printer.enddoc

It does print. However, the picture has a very low quality to it. How can I change the way it's printed so that I can add more DPI to the photo? Do I change the method I input the picture into the printer so that i can increase quality?

Thanks in advanced

Mike

Auto Install Printer Based On Computer Name
Here is my project. I have several win2000 machines that all use the same domain user account. I need to create a script that will run at login and install a printer. Depending on what machine name that computer has wil deturmine what type of printer is to be installed. (Local printer-com1: or network Printer) I can do one or the other but I don't know how to create one script for ether situation.

Here is what i have.
*************************************************

dim oPrinter

set oPrinter = CreateObject("Printer.Printer.1")

oPrinter.PrinterName = "MyPrinter"

oPrinter.DriverName = "PrinterDriver"

oPrinter.PortName = "com1:"

oMaster.PrinterAdd oPrinter

If Err <> 0 then

msgbox "There was an error creating the printer."

end if

'********************************************

I'm thinking that i need an if station that will operate based on machine name. How is this done. I don't want to have to write 100 if statements. can i also loop the scritp some how and have it pull machine names and printer settings from a file.

Any help or direction would be great.

Changing A Picture Based On Coodinates.
I want to draw a 3d box that would appear to rotate as the X, Y and Z coordinates are changed. I'm not even sure where to begine on this one.



Thanks
PBSnake

Can Dos Based Programming Run In Windows?
Hello, Everyone:
I have a Dos executable file. How can I run it in windows program? Do I need to modify Dos executable file? Would someone be kind to help me out?
Thank you very much!
Charlie

Windows Based Application
I am seeking a Co. or freelance programmer in S.E. England to develop VB based Application. Please contact ian.fox@lineone.net

From Windows Application To Web Based???
hi everyone,

can i ask whether i an turn my windows application developed using vb6 to web based form???

is it very tedious??? the program is quite big and how long usually it takes to finish the deployment to web based???

urgent needs

Converting Table Based Crystal Report Into Stored Procedure Based Report
hi
We have some table based crystal reports. we want to use stored procedure instead of tables.
How can i replace table ?

My crystal report version is 8.5. I have 11 also
My Database is Ms-SQL Server 2000.

Urgent

With regards

S. Muhilan

Printing Some Lines Along With Grid Data Using Paintpicture Method
Hi..

I am trying to print some lines which tells that what data following Grid contains. I am using Prineter.paintpicture method to print a flexgrid. now i want ot print soem lines before this Grid data is pritned. I haev tried scalewidh but can not do it. text line are hidden under grid picture. any body can tell me how can i do this..
here is what i want.

Dispatches for all date--line1
customer Name --so an so
Service name--so and so
|
|
Grid Data
|
|

Also could you please tell me what to do if gird has more line which needs more pages to print out.i treid with 100 rows now it was printg only one page..so some line where not printed..Here is some code which i have used.

Printer.Orientation = vbPRORLandscape

If optAllDates = True Then Printer.Print "Dispatches for All Dates" & vbNewLine
If Optmonth = True Then Printer.Print "Dispatches for Month" & Cmbmonth.Text & vbNewLine
If optOneDate = True Then Printer.Print "Dispatches for Date" & calDispDate.Value & vbNewLine
For I = 0 To 5
Printer.Print vbNewLine
Next I

'Printer.ScaleLeft = -150 '-((Printer.Width - .Width) / 2)
'Printer.ScaleTop = -500 '-((Printer.Height - .Height) / 2)

Printer.PaintPicture grdBilling.Picture, 0, 0

Printer.EndDoc


Many thanks in advance...

Nitesha

Selecting Paper Source On Printer Based On Word Document
hello, I have some different type of MSWORD documents (label, letter head, envelops etc.) that I want to be printed on different trays of my printer automatically as I have different paper types loaded in each tray. I have templates of these documents and RICOH (http://www.ricoh-usa.com) 1060 and 1075 printers. These printers have different trays for different types of paper and can be reconfigured to load various types of paper. My application runs as a batch job and has to print lots of documents unattended. I want to select different printer tray based on different type of document template. I can enable paper source in template but the tray configuration can be changed on the printer so I can not rely on that. Also macros are not available so that option is also out. I need to do it from with in my application.
I am using VB6 on Windows 2000 machine.

Getting A Windows Handle Based On Title Bar
Instead of using getactivewindow to find the handle of the active window, how do i get a handle of a window based on its title bar text?

Resizing Based On Windows Settings
Does anybody know of way to automatically resize an application based on the windows settings? I am currently developing an app where one of my forms is quite large due to the amount of data it's needing to maintain. I'm developing it under a resolution of 1024x768. It looks great under that resolution but if change the resolution to 800x600, part of the form drops off the screen. Is there a way to automaticall resize the entire form based on the screen resolution?

Windows XP Filesystem Based On SQL Server?
Windows XP filesystem based on SQL Server?

Just something I heard a little while back and I was quite interested.

I've got both WinXP and SQL Server 2K installed. If it is true then is there a way to connect to my filesystem as a database using the Enterprise Manager or Query Analyzer or just some other program through ODBC?

Cos I'm curious and mad. And I wanna risk corrupting my filesystem!!

Displaying Picture Based On A Changing Text/caption
Hello World...

I have a form linked to an access database and there is a textbox that a user can enter a picture name and that and other data is saved into the db record. The database is loaded to the form when needed and can be edited/deleted, etc.


I am looking for a code or a way to display the picture using the text entered in the text box; different picture for each record. Meaning the picture changes whenever the text in the textbox changes. (The images will be in the same forder as the applicatoin)

Thanks.

How To Set Foucs On Open Windows Based On Their Captions?
Hi all . i got 3 textbox and i want set the focous on perticuler open window that i know its caption when we type text and click enter without bringing that window to front.

For example i type some thing in textbox one and press enter . After i enter i want to have the focous on a window that has caption window1 . Similerly for the rest of my textboxes. I be happy if some show me how to do this.Thanks

Sending Key Strokes To Non-Windows Based Programs
I'm trying to send key strokes to a DOS based program using VB6 but the SendKey syntax won't work.  Does anyone know a way around this?  Thanks.

Find Size Of Picture Int Html File Based On Pixel
I would like to make a program which it will take as input a whole Html file and will compute the total size of text and pictures. I consider that a simple html file consists of simple text (data) and some pictures. My goal is to parse the Html file and calculate the amount of size of text and pictures.
For example the program must, if the total size of Html file is 10KB, to generate an output where the Size of text(data) is 3KB and the Size of Pictures is 7KB.
One of mine main problems is how to measure the size of pictures. Probably this task demands a procedure where it converts the pixel to bytes.

So

1. Navigate to a web page posted on the internet someplace
2. Find out the number of bytes that make up the html file itself (the ascii of the html page).
3. Find out the number of bytes that make up what has been added/included with the html file (meaning pictures).
4. Take 2 and 3 and add them together to get a final result of total bytes.

Could aynone give me a hand of help?



Could anyone give me a hand of help?
 

Printing A Picture && Printing A Box Around Text
I have a customer where I have to print many different reports. The customer desires 2 things, they are:
1. That the header containg their name, address etc. be printed on a receipt with a box surrounding the text. They would also like another section to have a box surrounding the printed data.
2. That a picture be printed at the top of the receipt showing their vineyard.

I could find no info in the many books that I have on how to do this.
Can anyone steer me in the right direction?
TIA
Dick Deeds

What's The Difference Between Client Based Application And Web Based Application?
what's the difference between client based application and web based application? and which one is more secure?

Printing To Zebra Printer With ZPL Or Printer Object
Hi,

I know that this question isn't all VB, but I tried to get some info in the barcode forum, but there isn't any traffic there so I thought I could try here.

For the past 10 or 15 years we have used two Zebra label printers hooked up to a computer via serial port and  have sent ZPL to it. We decided to upgrade to newer Zebra printers with network cards so we can print images on the labels, which they have pretty much done what I planned, but I am running into some complications.

With the new printers I used VB6’s printer object and set X and Y coordinates to print my text and bar codes on the labels just like I do with many other documents that I send to HP LaserJets. I am not going to get into the issues that I am having, because I don't think it is relevant (but if you think so I will post it).

My main question is everything I read says to write the txt file and send ZPL to the printer. Why is this used instead of VB6's printer object? I have about 80 users that send print jobs to these printers and wondered if creating a ZPL file was a better way of printing. And, if writing a ZPL text file, where would be a proper place to save the file before it is sent to the printer.

Any input or experience would be greatly appreciated, I am going crazy with this!


-UncleCake


Printing Printing Printing Printing Report Confused Help
Hey guys,

I want to print following bill. It has already been printed.
I want to fill some data in it and want to print it.

Have a look at attached image of the bill.
Dimensions are given too.

I tried with data report.
I put total field in report footer and send the value of this field from code itself.
But if there are 2 items then total field prints immediately after that.
whereas it should be printed at the bottom in front of the word TOTAL(printed in bill).

How to get it at right position?

How can I maintain the margins and dimensions each side?

Will data report do? or anything else should be right for doing this.

Help me people.

PLZ.

Kakadia.

Printing To Printer
I've looked for this, but when you put printing, printer, A6, A5 or a combination of these in the search form, too much topics about printing come up, most of them are irrelevant, like printing to a file and such

My question is simple, but the answer, to me, isn't:
How do I print to papersize A6?
Is there any way or method I can tell VB6 that the papersize to print on is A6 format? Or would it always 'autosize' to the paper in the printer?

When I want to print, using OOo Writer, I can choose the papersizes before I actually click the print button, so I'm guessing I'll have to tell VB6 what papersize I'm using..

A push in the right direction is always welcome!

Thanks in advance

Printing To A Different Printer
I would like to direct some print jobs to a different printer connected to lpt2. (In the same application I have some reports that print to a laser printer on Lpt1 and some to a matrix printer on Lpt2.) Certainly there must be a simple way to do it! Does anyone know?

If I have to, I can could the default printer and then change it back, but I would rather do it in code rather than calling up a dialog box to make that change every time. How can I do it in code?

Please help...
Thanks in advance.

Printing To Printer
I would like to print the current form to the printer (Using the "PrintForm" command). However, there are certain controls I don't want printed, such as the command buttons. I only want the text boxes and labels to be printed. Is there a way to do this or am I kidding myself?

Printing Using More Then 1 Printer
if i want to print 20 000 documents using 10 printers wich are on the network and also install on my computer how can i change the printer with code, i mean no common dialog...
"HP LaserJet 2100 PCL6"
"HP LaserJet 2200 Series PCL"
etc...

is there a way to change the printer without asking anything to the user...

Printing To Printer
hi,


how do i send a file directly to a printer for printing through VB. also this file is a .HTM file, can it be converted to a .PDF format and send to the printer through VB. basically what i need is that this file shouldnt be capable of being modified as in case of electronic copies of certificates. thanks.

Printing To The Printer
Is there a way to change the default of the printer to landscape in a command button to print (from an outside text file).

We have already got the print to work the other way, but was curious if that was possible without using a common dialog box.

Thanks!
Char


Thought for the day...

"The original point-and-click interface was a Smith & Wesson."

Printing To AS/400 Printer
Hi, i have a MS Access Database and i would like to print the all the record as Statement of Account. i want to print it to an AS/400 printer. Anyone can help me? thanks in advance

KK

Printer Printing
for a program i have i need to print text and lines from a picturebox how do i do this?

Printing (To A Printer)
What's the easiest way of simply printing the contents of a form to the printer, and ensuring that the contents do not spill off the page?

Copyright © 2005-08 www.BigResource.com, All rights reserved