Bonjour,
J'ai visiblement un soucis lié au Device quand j'imprime une liste ...
La sortie dans un PDF est tout a fait correcte mais si je selectionne l'imprimante la taille des caractères du titre et le cadre déssinés sont démesurés !!!
Comment faire face à ce Pb ?
Pour tester mon edition j'ai fai ce petit bout de fonction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
void Imprimer (HWND hwnd, HDC hdcprint, int nb_mvt, int nb_selected, OPERATION *mvt)
{
TEXTMETRIC  tm;
RECT rc;
LOGFONT lf;
LOGPEN  lp;
POINT pt;
static HPEN stylo;
static HFONT font1;

static short cxChar, cyChar;
static xPage, yPage;
char szBuffer[100];
char temp[10];

                  GetTextMetrics (hdcprint, &tm);
                  cxChar = tm.tmAveCharWidth;
                  cyChar = tm.tmHeight + tm.tmExternalLeading;
				  xPage = GetDeviceCaps (hdcprint, HORZRES);
                  yPage = GetDeviceCaps (hdcprint, VERTRES);

//SelectObject (hdc, CreateFontIndirect (&lf));

            
			 rc.left   = 2*cxChar; 
             rc.right  = xPage - rc.left;
			 rc.top    =  cyChar;
             rc.bottom = yPage-cyChar;
//             DrawBorder(hdcprint,&rc,RGB(255,0,0),RGB(255,0,0));
			 if (nb_selected == 1) {
               StartPage (hdcprint);
               stylo = CreatePen(PS_SOLID, 5, RGB(255,0,0));
               SelectObject (hdcprint, stylo);
               Rectangle(hdcprint, rc.left, rc.top, rc.right, rc.bottom);  
               DeleteObject (stylo);

               font1=CreateFont(30,0,0,0,700, FALSE,FALSE,FALSE,0,OUT_DEFAULT_PRECIS,
                     CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_DONTCARE,
                     "Comic Sans MS");
               SelectObject (hdcprint, font1);

               SetTextColor (hdcprint, RGB(0, 0, 210));
               SetBkMode (hdcprint, TRANSPARENT);
               strcpy(szBuffer, "Edition des Mouvements");
			   rc.top = 2*cyChar;
               DrawText(hdcprint,szBuffer,strlen(szBuffer),&rc,DT_CENTER);
               DeleteObject (font1);
			   MoveToEx (hdcprint, rc.left, rc.top+(3*cyChar), NULL);
			   LineTo (hdcprint, rc.right, rc.top+(3*cyChar));
			 }
             if (nb_selected == nb_mvt)
               EndPage (hdcprint);
}
Pour réaliser le PDF, j'utilise Adobe Acrobate 6.0
Merci.