Autor Beitrag
SchelmVomElm
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 154

W2K Pro
D5 Pro
BeitragVerfasst: Mi 30.03.05 08:46 
Ich versuche ein Komandozeilen Program zu schreiben dass ein Bitmap in PDF wandelt.
Dafür nehme ich die Nishita Komponente. Die läuft ähnlich wie TPrinter.

ausblenden volle Höhe Delphi-Quelltext
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:
procedure TForm1.FormShow(Sender: TObject);
var
  target,source: string;
  bmp: TBitmap;
  PDF:TPrintPDF;
begin
  if ParamCount = 2 then
  begin
    target := ParamStr(2);
    source := ParamStr(1);
    if FileExists(source) then
    try
      bmp := TBitmap.Create;
      bmp.LoadFromFile(source);
      PDF:=TPrintPDF.Create(self);
      with PDF do
      begin
        PageWidth:= bmp.Width;
        PageHeight:= bmp.Height;
        Compress := true;
        FileName := target;
        BeginDoc;
        DrawBitmap(0,0,bmp);
        EndDoc;
      end;
    finally
      bmp.Free;
      Pdf.Free;
    end;
  end;
  Form1.Close;
end;


Das Problem ist, dass egal was ich für PageWidth oder PageHeight einstelle die Seite wird immer gleich groß. Und die Komponente kennt kein StrechDraw. :( Hat irgendjemand schon mal Erfahrungen mit dem Ding gemacht? Oder hat irgendjemand eine andere Idee wie man das realisieren könnte?

_________________
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Mi 30.03.05 21:21 
Zwar nicht zur Komponente bzw dem Problem das Du hast, aber:

user profile iconSchelmVomElm hat folgendes geschrieben:
Ich versuche ein Komandozeilen Program zu schreiben dass ein Bitmap in PDF wandelt.


Aber:
user profile iconSchelmVomElm hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
procedure TForm1.FormShow(Sender: TObject);					



sieht nicht nach einem Kommandozeilenprogramm aus

Martin