Click here to Skip to main content
15,920,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: Call Graph Pin
J4amieC25-Oct-04 3:14
J4amieC25-Oct-04 3:14 
GeneralIn DataGrid pressing Enter Pin
Anonymous25-Oct-04 2:32
Anonymous25-Oct-04 2:32 
GeneralHelp In TWain Pin
Member 143728625-Oct-04 2:13
Member 143728625-Oct-04 2:13 
GeneralRe: Help In TWain Pin
Nick Parker25-Oct-04 11:37
protectorNick Parker25-Oct-04 11:37 
Generalprint job copies Pin
jartometienen25-Oct-04 1:11
jartometienen25-Oct-04 1:11 
GeneralRe: print job copies Pin
Duncan Edwards Jones25-Oct-04 1:39
professionalDuncan Edwards Jones25-Oct-04 1:39 
GeneralRe: print job copies Pin
jartometienen25-Oct-04 3:17
jartometienen25-Oct-04 3:17 
GeneralRe: print job copies Pin
Duncan Edwards Jones25-Oct-04 4:33
professionalDuncan Edwards Jones25-Oct-04 4:33 
In Settings->Printers select one printer and in Properties select the check box "Keep documents after they have printed".
Now when you print something the spool file will be in C:\winnt\system32\spool\printers\ directory and you can look at it with a text editor.

Spool files come in a number of possible formats. If it is in EMF format then:

(Note that this format is not documented and will be liable to change
in future releases of the Windows OS family so any code you write
based on this information should be flexible enough to be added to)

Layout of an EMF spool file:
The EMF file consists of a chain of spool records which can be
described as:
Private Structure EMFMetaRecordHeader
Dim iType As SpoolerRecordTypes
Dim nSize As Int32
End Structure
These records are read sequentially to create the printed document.
Currently the record types that I have discovered are:
Private Enum SpoolerRecordTypes
  SRT_EOF = &H0 'End of file
  SRT_RESERVED_1 = &H1
  SRT_FONTDATA = &H2 'Font Data
  SRT_DEVMODE = &H3 'Device Mode (DEVMODE)
  SRT_FONT2 = &H4 'Font Data
  SRT_RESERVED_5 = &H5
  SRT_FONT_MM = &H6 'Font Data (Multiple Master)
  SRT_FONT_SUB1 = &H7 'Font Data (SubsetFont 1)
  SRT_FONT_SUB2 = &H8 'Font Data (SubsetFont 2)
  SRT_RESERVED_9 = &H9
  SRT_UNKNOWN = &H10
  SRT_RESERVED_A = &HA
  SRT_RESERVED_B = &HB
  SRT_PAGE = &HC 'Enhanced Meta File (EMF)
  SRT_EOPAGE1 = &HD 'End Of Page
  SRT_EOPAGE2 = &HE 'End Of Page
  SRT_EXT_FONT = &HF 'Ext Font Data
  SRT_EXT_FONT2 = &H10 'Ext Font Data
  SRT_EXT_FONT_MM = &H11 'Ext Font Data (Multiple Master)
  SRT_EXT_FONT_SUB1 = &H12 'Ext Font Data (SubsetFont 1)
  SRT_EXT_FONT_SUB2 = &H13 'Ext Font Data (SubsetFont 2)
  SRT_EXT_PAGE = &H14 'Enhanced Meta File
  SRT_JOB_INFO = &H10000
End Enum


So for example a very simple one page print job might consist of an
SRT_DEVMODE record followed by a SRT_PAGE followed by a SRT_EOF.

Within the SRT_PAGE and SRT_EXT_PAGE record is a single printed page
stored as a standard EMF record which can be displayed on screen or
transformed into any other graphics format as you wish. The
structure of this is:
1. EMF Header record which gives the version information and page
size etc needed to scale the metafile
2. A selection of EMF records which describe the infividual graphic
elements of the page (text, lines, etc.) The format of these
individual records is documented on MSDN.

Withing the SRT_DEVMODE is a record which is very similar to the
DEVMODE structure used in printer API calls that specifies things
like the number of copies, print quality, paper source etc.


'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
GeneralRe: print job copies Pin
jartometienen25-Oct-04 22:25
jartometienen25-Oct-04 22:25 
Generaldownload File into local machine Pin
juanito197525-Oct-04 0:36
juanito197525-Oct-04 0:36 
GeneralRe: download File into local machine Pin
Alex Korchemniy25-Oct-04 7:29
Alex Korchemniy25-Oct-04 7:29 
QuestionWhy I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
momer25-Oct-04 0:16
momer25-Oct-04 0:16 
AnswerRe: Why I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
WilsonProgramming25-Oct-04 5:56
WilsonProgramming25-Oct-04 5:56 
GeneralRe: Why I cann't get the message device type:DBT_DEVTYP_DEVICEINTERFACE? Pin
momer25-Oct-04 14:51
momer25-Oct-04 14:51 
Questionhow to save a GDI+ Pin
xiaowenjie24-Oct-04 19:51
xiaowenjie24-Oct-04 19:51 
AnswerRe: how to save a GDI+ Pin
J4amieC24-Oct-04 21:48
J4amieC24-Oct-04 21:48 
GeneralRe: how to save a GDI+ Pin
xiaowenjie25-Oct-04 10:34
xiaowenjie25-Oct-04 10:34 
AnswerRe: how to save a GDI+ Pin
Anonymous24-Oct-04 22:07
Anonymous24-Oct-04 22:07 
QuestionObfuscators: Xenocode, opinion? Pin
Carl Mercier24-Oct-04 18:06
Carl Mercier24-Oct-04 18:06 
QuestionHow to define INVALID_HANDLE_VALUE in C#? Pin
momer24-Oct-04 17:21
momer24-Oct-04 17:21 
AnswerRe: How to define INVALID_HANDLE_VALUE in C#? Pin
Nick Parker24-Oct-04 17:47
protectorNick Parker24-Oct-04 17:47 
GeneralRe: How to define INVALID_HANDLE_VALUE in C#? Pin
momer25-Oct-04 1:08
momer25-Oct-04 1:08 
Generalrelation between mouse event and showintaskbar Pin
yu-yu24-Oct-04 16:11
yu-yu24-Oct-04 16:11 
GeneralRe: relation between mouse event and showintaskbar Pin
Dave Kreskowiak25-Oct-04 9:20
mveDave Kreskowiak25-Oct-04 9:20 
GeneralRe: relation between mouse event and showintaskbar Pin
yu-yu25-Oct-04 14:20
yu-yu25-Oct-04 14:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.