Comment imprimer plusieurs pages à l'aide du canevas d'impression. Avec lineto et textout pour produire la sortie sur la toile? La toile fonctionne bien sur une seule page. Ceci utilise l'impression normale pour la première page. Puis utilisé copyrect à la toile de l'imprimante et a publié une nouvelle page, mais les pages suivantes sont vides. J'ai vu dans une question ils parlaient d'un PrintPage je n'ai pas vu une fonction ou une méthode comme ceci avec Lazarus. Voici un code que je ne sais pas si c'est utile.Impression de plusieurs pages avec des fonctions de canevas LineTo et Textout
kBracketTree: with TestTableForSpeciesData, Printer.Canvas do
begin
intCPLngth := Origin.ttoBracket.Height * 5;
intCPWdth := Origin.ttoBracket.Width * 5;
if imgPrintView.Canvas = nil then
imgPrintView.Canvas.Create;
imgPrintView.Height := intCPLngth; // * 6 div 5;
imgPrintView.Width := intCPWdth; // * 6 div 5;
intVPages := intCPLngth div intHeight + 1;
intHPages := intCPWdth div intWidth + 1;
DrawScale(dblScale);
DrawBracket(HomeVrtcl);
DrawBracketLabel(Species[NodeCount].VrtclPosition, Species[NodeCount].EndSegment);
DrawBracketLabel(Species[NodeCount - 1].VrtclPosition, Species[NodeCount - 1].EndSegment);
intNdLvl := 1;
while boolMoreNodeLevels(intNdLvl) do
begin
for inx := 0 to NodeCount - 2 do
if Species[inx].NodeLevel = intNdLvl then
DrawBracketLabel(Species[inx].VrtclPosition, Species[inx].EndSegment);
inc(intNdLvl);
end;
if boolBootStrap then
for inx := SpeciesCount to NodeCount do
DrawBootStrapLabel(Species[inx].VrtclPosition, BSPercent[inx - SpeciesCount], 5, 5, 55);
if (intVPages > 1) or (intHPages > 1) then
begin
if intVPages > 1 then
if intHPages = 1 then
begin
intVStart := 2;
intHStart := 1;
end
else
begin
intVStart := 1;
intHStart := 2;
end
else
begin
intVStart := 1;
intHStart := 2;
end;
for iny := intVStart to intVPages do
begin
Pen.Color := clBlack;
Brush.Style := bsSolid;
Brush.Color := clWhite;
Clear;
with rctPrnt do
begin
Left := 0;
Top := 0;
if intCPLngth > intHeight * iny then
Bottom := intHeight - 1
else
Bottom := intCPLngth - intHeight * (iny - 1) - 1;
end;
with rctSlctd do
begin
Top := intHeight * (iny - 1);
if intCPLngth > intHeight * iny then
Bottom := intHeight * iny - 1
else
Bottom := intCPLngth;
end;
for inx := intHStart to intHPages do
begin
NewPage;
with rctPrnt do
if intCPWdth > intWidth * inx then
Right := intWidth - 1
else
Right := intCPWdth - intWidth * (inx - 1) - 1;
with rctSlctd do
begin
Left := intWidth * (inx - 1);
if intCPWdth > intWidth * inx then
Right := intWidth * inx - 1
else
Right := intCPWdth - 1;
end;
Canvas.Rectangle(0, 0, intWidth - 1, intHeight - 1);
Canvas.CopyRect(rctPrnt, imgPrintView.Canvas, rctSlctd);
Canvas.Refresh;
end;
intHStart := 1;
end;
end;
Créez un MCVE qui imprime un seul mot de texte, lance une nouvelle page et recommence. Nous ne voulons pas patauger tout ce code. Simplifier. –