AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi mit pdf-Tool nur Teil einen Stringgrid drucken
Thema durchsuchen
Ansicht
Themen-Optionen

mit pdf-Tool nur Teil einen Stringgrid drucken

Ein Thema von tom_po · begonnen am 7. Mai 2006 · letzter Beitrag vom 10. Mai 2006
 
tom_po

Registriert seit: 5. Feb 2006
137 Beiträge
 
Delphi 7 Enterprise
 
#14

Re: mit pdf-Tool nur Teil einen Stringgrid drucken

  Alt 10. Mai 2006, 07:42
Hallo Marabu, du hast mir ja so sehr geholfen beim Ausdruck mit den labels, der Code sieht jetzt so aus wie folgt.
wenn ich jetzt 3 labels nebeneinander auf der DIN A4-Seite möchte, was muss ich in der Funktion ändern (ausser den Positionen der einzelnen Angaben)

Delphi-Quellcode:
function LabelToPage(pt: Tpoint; index: Integer): TPoint;
const
  PageLeft = 20;
  PageTop = 30;
  LabelWidth = 600; //Original-Label-Masse
  LabelHeight = 120;
begin
  Result := Point(
              pt.X + PageLeft + (index mod 2) * LabelWidth,
              pt.Y + PageTop + (index div 2) * LabelHeight
            );
end;

procedure Tlote.Button1Click(Sender: TObject);
const
  ptArtikel: TPoint = (X: 0; Y: 0); // Werte für DIN A4
  ptFarbe: TPoint = (X: 150; Y: 0);
  ptColumn2: TPoint = (X: 400; Y: 0);
  ptOrder: TPoint = (X: 0; Y: 50);
  ptCode: TPoint = (X: 125; Y: 32);
  ptColumn0: TPoint = (X: 285; Y: 50);
  ptColumn1: TPoint = (X: 415; Y: 50);
 var
  iRow, iLabel: Integer;
begin
  deletetmppdf;
  with printpdf1 do
  begin
    FileName:=gettemppathd+'tmppdf'+Inttostr(random(5000))+'.pdf';
    PageWidth:=1224; // Origanl-DIN A4
    PageHeight:=1725; // Origanl-DIN A4
    BeginDoc;
    Font.Name:=poTimesBoldItalic;
    Font.Size:=24; //alt 24
  end;

  iLabel := 0;
  with StringGrid1, printpdf1 do
    for iRow := 0 to 15 do
      if Trim(Cells[1, iRow+1]) <> 'then
      begin
        with LabelToPage(ptArtikel, iLabel) do
          TextOut(X, Y, 'Artigo: ' + lote.Artikel.Text);
        with LabelToPage(ptFarbe, iLabel) do
          TextOut(X, Y, 'Côr: ' + Cells[3, FixedRows + iRow]);
          //TextOut(X, Y, 'Côr: ' + lote.Farbe.Text); //von DB
        with LabelToPage(ptColumn2, iLabel) do
          TextOut(X, Y, 'Tam.: ' + Cells[2, FixedRows + iRow]);
        with LabelToPage(ptOrder, iLabel) do
          TextOut(X, Y,'N.P.: '+lote.order.text);
        with LabelToPage(ptCode, iLabel) do
          pdfcodedrucken(X, Y, lote.Order.Text, False);
        with LabelToPage(ptColumn0, iLabel) do
          TextOut(X, Y, 'N°./Lo: ' + Cells[0, FixedRows + iRow]);
        with LabelToPage(ptColumn1, iLabel) do
          TextOut(X, Y, 'Peç/Lo: ' + Cells[1, FixedRows + iRow]);
        Inc(iLabel);
        end;

        with printpdf1 do
         begin
          EndDoc;
         end;

  ShellExecute(Application.Handle, 'open', PChar(printpdf1.FileName), nil, nil, SW_NORMAL);

end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz