473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Print manager: set title of print job

Hello,

I'm using the Printer.PaintPicture method to print an image and I want to
set the job title that the print manager will show.

I already found out that this can be done by using the StartDoc API
function. However, I can't figure out how to set the job title by API and do
the printing of the image without using API but by using the
Printer.PaintPicture method.

Is this possible?

Best regards,

Geert-Pieter

Jul 17 '05 #1
1 4907
Const PT_LINETO = &H2
Const PT_BEZIERTO = &H4
Const PT_CLOSEFIGURE = &H1
Const DI_APPBANDING = &H1
Const DI_ROPS_READ_DESTINATION = &H2
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type DOCINFO
cbSize As Long
lpszDocName As String
lpszOutput As String
lpszDatatype As String
fwType As Long
End Type
Private Declare Function PolyDraw Lib "gdi32" (ByVal hdc As Long, lppt As
POINTAPI, lpbTypes As Byte, ByVal cCount As Long) As Long
Private Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (ByVal hdc
As Long, lpdi As DOCINFO) As Long
Private Declare Function StartPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndPage Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function EndDoc Lib "gdi32" (ByVal hdc As Long) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KP*****@Allapi.net
Dim Pt(1 To 2) As POINTAPI, bTypes(1 To 2) As Byte, DI As DOCINFO
'fill the DOCINFO-structure
DI.cbSize = Len(DI)
DI.lpszDocName = "API-Guide Code Demonstration"
DI.lpszOutput = vbNullString
DI.lpszDatatype = vbNullString
'starts a print job
Call StartDoc(Printer.hdc, DI)
'prepare the printer driver to accept data
Call StartPage(Printer.hdc)
Pt(2).x = 50
Pt(2).y = 30
bTypes(1) = PT_LINETO
bTypes(2) = PT_LINETO
'draw a set of line segments
PolyDraw Printer.hdc, Pt(1), bTypes(1), 2
'inform the device that the application has finished writing to a page
Call EndPage(Printer.hdc)
'end the print job
Call EndDoc(Printer.hdc)
End Sub

Geert-Pieter Hof heeft geschreven in bericht ...
Hello,

I'm using the Printer.PaintPicture method to print an image and I want to
set the job title that the print manager will show.

I already found out that this can be done by using the StartDoc API
function. However, I can't figure out how to set the job title by API and dothe printing of the image without using API but by using the
Printer.PaintPicture method.

Is this possible?

Best regards,

Geert-Pieter

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Craig | last post by:
First of all, this one is driving me crazy, so thanks in advance for any help!! I've got a javascript function in a parent document that generates an HTML document on the fly when a button is...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
2
by: chpadmamca | last post by:
Below is my html code, is there any way to print this document in landscape mode wih CSS? <html><head><style type="text/css"> table.fixed {table-layout:fixed; width:100%; border-collapse:...
2
by: bangad | last post by:
this code print file in browser but in in tabular form like in .csv file.....kindly help me out.... #!/usr/bin/perl -w # use lib use strict; use CGI; # limit 1000K bytes post, permit upload...
10
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
2
by: dmorand | last post by:
When I try to print a 'print version' of my page it looks fine in IE 7, but when I print in IE 6 the margins are all screwed up. The page itself looks the same in both browsers, it's just when I...
66
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.