cdr2svg_mainform.pas 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. unit cdr2svg_mainform;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  6. EditBtn;
  7. type
  8. { TForm1 }
  9. TForm1 = class(TForm)
  10. buttonConvert: TButton;
  11. buttonQuit: TButton;
  12. editInput: TFileNameEdit;
  13. editOutput: TFileNameEdit;
  14. Label1: TLabel;
  15. Label2: TLabel;
  16. Label3: TLabel;
  17. procedure buttonConvertClick(Sender: TObject);
  18. procedure buttonQuitClick(Sender: TObject);
  19. private
  20. { private declarations }
  21. public
  22. { public declarations }
  23. end;
  24. var
  25. Form1: TForm1;
  26. implementation
  27. uses
  28. fpvectorial, cdrvectorialreader, svgvectorialwriter;
  29. {$R *.lfm}
  30. { TForm1 }
  31. procedure TForm1.buttonQuitClick(Sender: TObject);
  32. begin
  33. Close;
  34. end;
  35. procedure TForm1.buttonConvertClick(Sender: TObject);
  36. var
  37. Vec: TvVectorialDocument;
  38. begin
  39. // First check the in input
  40. // todo...
  41. // Now convert
  42. Vec := TvVectorialDocument.Create;
  43. try
  44. Vec.ReadFromFile(editInput.FileName, vfPDF);
  45. Vec.WriteToFile(editOutPut.FileName, vfGCodeAvisoCNCPrototipoV5);
  46. finally
  47. Vec.Free;
  48. end;
  49. end;
  50. end.