我需要裁剪pdf并通过将裁剪的png图像粘贴到word文档中来创建该裁剪的png图像的word文档。
我正在使用 Firemonkey 平台
这是代码:
procedure TForm2.Button1Click(Sender: TObject);
begin
ShellExecute(FormToHWND(Self),'open',PChar(GetCurrentDir+'\cairo.exe')
,PWideChar('-opw '+Edit1.Text+
' -cropbox -png -x 64 -y 215 -W 144 -H 375 -r 167 '+
PdfFile+' tools/card'),'',SW_Hide);
Sleep(500);
Image1.Bitmap.LoadFromFile(Output);
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
ClipBoard.Assign(Image1.Bitmap);
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
Output:= GetCurrentDir+'\tools\card-1.png';
end;
单击 button2 会弹出错误Cannot assign TBitmapOfItem to TClipBoard。
如何将图像复制到剪贴板并创建word文档(不太了解)?