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.
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?