AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi printpdf besitzt keine entsprechende Komponente
Thema durchsuchen
Ansicht
Themen-Optionen

printpdf besitzt keine entsprechende Komponente

Ein Thema von tom_po · begonnen am 1. Mai 2006 · letzter Beitrag vom 1. Mai 2006
Antwort Antwort
tom_po

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

printpdf besitzt keine entsprechende Komponente

  Alt 1. Mai 2006, 04:25
Ich habe eine neue Form entwickelt, um mit dem tool printpfd zu drucken, das ich vorher schon in einer anderen form erfolgreich verwendet habe.
Ich dcchte ich hab alles gleich gemacht, bekomme aber jetzt immer die Fehlermeldung siehe Bild.

Hier der quelltext, wer kann mir helfen?

Delphi-Quellcode:
unit loteunit;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, dbisamtb, StdCtrls, shellapi,Mask, strutils,DBCtrls, Grids, DBGrids, dbisamct,suchunit,tnpdf;
 
type
  Tlote = class(TForm)
    Label1: TLabel;
    Label10: TLabel;
    DBISAMDBGrid1: TDBISAMDBGrid;
    DBISAMQuery1: TDBISAMQuery;
    DataSource1: TDataSource;
    order: TDBEdit;
    Artikel: TDBEdit;
    PrintPDF1: TPrintPDF;
    Button1: TButton;
    procedure deletetmppdf();
    procedure pdfCodeDrucken(x,y:integer;code:string;textdrucken:boolean);
    function startcode(pos,x,y:integer):integer;
    procedure Balken(pos,a,x,y:integer);
    procedure endcode(pos,x,y:integer);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
 
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
 
var
  lote: Tlote;
  abstand:integer=1;
  suchform:Tsuchform;
  pdf:TPrintPDF;
  Feld :array[0..9,0..4] of integer=((0,0,1,1,0),(1,0,0,0,1),(0,1,0,0,1),(1,1,0,0,0),(0,0,1,0,1),(1,0,1,0,0),(0,1,1,0,0),(0,0,0,1,1),(1,0,0,1,0),(0,1,0,1,0));
 
implementation
 
{$R *.dfm}
 
function GetTempPathD: string;
var
  TmpDir: PChar;
begin
  TmpDir := StrAlloc(255);
  GetTempPath( 255,TmpDir);
  Result := string(TmpDir);
  if Result[Length(Result)] <> '\then
    Result := Result + '\';
  StrDispose(TmpDir);
end;
 
procedure Tlote.deletetmppdf();
var
  SR: TSearchRec;
begin
if FindFirst(gettemppathd+'tmp*.pdf', faAnyFile - faDirectory, SR) = 0 then
    repeat
     deletefile(gettemppathd+sr.name);
     until FindNext(SR) <> 0;
end;
 
procedure Tlote.Balken(pos,a,x,y:integer);
begin
printpdf1.LineWidth:=2*a+1;
printpdf1.DrawLine(x+a+pos*abstand,y,x+a+pos*abstand,y+20);
end;
 
procedure Tlote.endcode(pos,x,y:integer);
begin
 Balken(pos,1,x,y);
 pos:=pos+5;
 Balken(pos,0,x,y);
 pos:=pos+3;
 Balken(pos,1,x,y);
end;
 
function Tlote.startcode(pos,x,y:integer):integer;
begin
 pos:=pos+3;
 Balken(pos,1,x,y);
 pos:=pos+5;
 Balken(pos,1,x,y);
 pos:=pos+5;
 Balken(pos,0,x,y);
 pos:=pos+3;
 startCode:=pos;
end;
 
procedure Tlote.pdfCodeDrucken(x,y:integer;code:string;textdrucken:boolean);
var pos,i,b,n:integer;
begin
pos:=10;
pos:=startCode(pos,x,y);
for i:=1 to length(code) do
begin
n:=StrToInt(MidStr(code,i,1));
for b:=0 to 4 do
begin
Balken(pos,Feld[n,b],x,y);
pos:=pos+3+(2*Feld[n,b]);
end;
end;
endCode(pos,x,y);
code:=midstr(code,1,7)+midstr(code,8,2);
if textdrucken then printpdf1.TextOut(x+10,y+35,code);
end;
 
procedure Tlote.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
 
procedure Tlote.Button1Click(Sender: TObject);
begin
deletetmppdf;
printpdf1.FileName:=gettemppathd+'tmppdf'+Inttostr(random(5000))+'.pdf';
printpdf1.PageWidth:=1224;
printpdf1.PageHeight:=1725;
printpdf1.BeginDoc;
printpdf1.Font.Name:=poTimesBoldItalic;
printpdf1.Font.Size:=60;
printpdf1.TextOut(450,60,'Artigo: '+Artikel.text);
printpdf1.TextOut(800,60,'N.P.: '+order.text);
pdfcodedrucken( 1050,40,order.Text,false);
printpdf1.LineWidth:=3;
printpdf1.DrawLine(0,220,1224,220);
printpdf1.EndDoc;
ShellExecute(Application.Handle,
                 'open',
                 PChar(printpdf1.FileName),
                 Nil, Nil, SW_NORMAL);
end;
 
end.
Miniaturansicht angehängter Grafiken
komponente_496.jpg  
  Mit Zitat antworten Zitat
Benutzerbild von Matze
Matze
(Co-Admin)

Registriert seit: 7. Jul 2003
Ort: Schwabenländle
14.929 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: printpdf besitzt keine entsprechende Komponente

  Alt 1. Mai 2006, 06:38
Hi

Ich nehme an, es ist eine Komponente, die du auf's Formular gezogen hast, diese muss in Delphi auch installiert sein, ist sie das?
  Mit Zitat antworten Zitat
Antwort Antwort


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 21:20 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz