【发布时间】:2014-07-28 06:35:12
【问题描述】:
我正在尝试从使用 Delphi-XE5 开发的应用程序在 Android 设备中打开 pdf。我的代码是:
procedure TForm1.Button2Click(Sender: TObject);
var
Intent: JIntent;
begin
try
Intent := TJIntent.Create;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
Intent.setDataAndType(StrToJURI('/sdcard/android/data/db/Rad.pdf'), StringToJString('application/pdf'));
SharedActivity.startActivity(Intent)
except
on E : Exception do
ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
end;
end;
但是当我按下按钮时,显示打开pdf文档的不同应用程序,我选择其中任何一个,它们都正确打开,但他们说文档无法打开。
路径设置正确。
任何建议
【问题讨论】:
-
请在您的 delphi 相关问题中包含
delphi标签 -
可能文件不正确,先用pdf-tools.com/pdf/validate-pdfa-online.aspx之类的东西检查一下
-
正如您告诉我的那样,我已经检查过,它告诉我在某些区域已损坏,但是这样的 pdf 可以正确打开,而平板电脑中安装的 Adobe Reader 没有任何问题。所有 pdf 文件都发生这种情况。
标签: android delphi pdf delphi-xe5