Click here to Skip to main content
15,916,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Printer DC Pin
KKumarTG15-Jan-07 22:11
KKumarTG15-Jan-07 22:11 
GeneralRe: Printer DC Pin
Hamid_RT16-Jan-07 1:37
Hamid_RT16-Jan-07 1:37 
GeneralRe: Printer DC Pin
KKumarTG23-Jan-07 17:03
KKumarTG23-Jan-07 17:03 
GeneralRe: Printer DC Pin
Hamid_RT24-Jan-07 18:00
Hamid_RT24-Jan-07 18:00 
AnswerRe: Printer DC Pin
Iain Clarke, Warrior Programmer15-Jan-07 22:43
Iain Clarke, Warrior Programmer15-Jan-07 22:43 
GeneralRe: Printer DC Pin
KKumarTG15-Jan-07 23:00
KKumarTG15-Jan-07 23:00 
GeneralRe: Printer DC Pin
Iain Clarke, Warrior Programmer16-Jan-07 3:52
Iain Clarke, Warrior Programmer16-Jan-07 3:52 
GeneralRe: Printer DC Pin
KKumarTG23-Jan-07 1:06
KKumarTG23-Jan-07 1:06 
As per MSDN, the below code returns the width and height in pixels,

int nX = GetDeviceCaps( hDc, HORZRES );
int nY = GetDeviceCaps( hDc, VERTRES );

Actually i meant that for some of the printers ( HP LaserJet 4250 PCL 5e ), the code gives different values for different sheet sizes.

But the problem is that some of other printers (hp deskjet 3500 series) gives the same values for different papaer sizes.

I am setting the size using the "DocumentProperties" function as below

pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately
pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2100 in case A4
pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2970 in case A4
CString csPaperSize = _T( "" );
memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ;
pDevModeOutput->dmPrintQuality = -1;
pDevModeOutput->dmYResolution = 0;
//pDevModeOutput->dmScale = 90;
pDevModeOutput->dmFields = DM_PAPERSIZE |
DM_PAPERLENGTH |
DM_PAPERWIDTH |
DM_FORMNAME |
DM_PRINTQUALITY |
DM_YRESOLUTION; // DM_SCALE;
// To get the Devmode structure filled
if( !DocumentProperties( NULL, // handle to parent window
hHandle, // handle to printer object
csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name
pDevModeOutput, // modified device mode
0, // original device mode
DM_IN_BUFFER// mode options
))
{
return;
}

Krishnakumar

QuestionINI file size in XP Pin
Nishad S15-Jan-07 20:07
Nishad S15-Jan-07 20:07 
AnswerRe: INI file size in XP Pin
Hamid_RT15-Jan-07 20:28
Hamid_RT15-Jan-07 20:28 
AnswerRe: INI file size in XP Pin
Rajesh R Subramanian15-Jan-07 20:40
professionalRajesh R Subramanian15-Jan-07 20:40 
AnswerRe: INI file size in XP Pin
Don Box15-Jan-07 20:41
Don Box15-Jan-07 20:41 
GeneralRe: INI file size in XP Pin
Sebastian Schneider15-Jan-07 21:41
Sebastian Schneider15-Jan-07 21:41 
QuestionRe: INI file size in XP Pin
David Crow16-Jan-07 3:42
David Crow16-Jan-07 3:42 
Questionquestion about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George15-Jan-07 20:07
George_George15-Jan-07 20:07 
AnswerRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
Michael Dunn15-Jan-07 22:21
sitebuilderMichael Dunn15-Jan-07 22:21 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George15-Jan-07 23:59
George_George15-Jan-07 23:59 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
Michael Dunn16-Jan-07 8:03
sitebuilderMichael Dunn16-Jan-07 8:03 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George16-Jan-07 15:10
George_George16-Jan-07 15:10 
QuestionSpace key + menu operation Pin
Member 21206615-Jan-07 20:05
Member 21206615-Jan-07 20:05 
QuestionCreating Sub folder Pin
Suresh H15-Jan-07 19:55
Suresh H15-Jan-07 19:55 
AnswerRe: Creating Sub folder Pin
Hamid_RT15-Jan-07 20:02
Hamid_RT15-Jan-07 20:02 
QuestionRe: Creating Sub folder Pin
Rajesh R Subramanian15-Jan-07 20:05
professionalRajesh R Subramanian15-Jan-07 20:05 
AnswerRe: Creating Sub folder Pin
Suresh H15-Jan-07 20:16
Suresh H15-Jan-07 20:16 
GeneralRe: Creating Sub folder Pin
Hamid_RT15-Jan-07 20:25
Hamid_RT15-Jan-07 20:25 

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.