Hello.
I'm developing a Firemonkey App for Android and iOS. The main form contains only FMX-Controls.
On iOS I cant find a way to open a document like PDF (except TWebBrowser).
I am now testing TDPFQLPreviewController:
Create a new TForm and place only TDPFQLPreviewController on it. In the main form I open a PDF with
procedure ShowDocumentPreview(const ALocalFileName: string);
begin
if not Assigned(FormDocPreview) then
Application.CreateForm(TFormDocPreview, FormDocPreview);
with FormDocPreview do
begin
QLPreviewController.ShowDoc(ALocalFileName, false);
Show;
end;
end;
But now I cannot find any way to close the form after the user click the Ready-Button on TDPFQLPreviewController. There is no Event like OnClosePreview.
Any suggestion? Thanks, Harald
Last edit: Harald Krekeler 2015-07-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
procedure TQLPreviewControllerDelegate.previewControllerDidDismiss( controller: QLPreviewController );
begin
if Assigned( FDPFQLPreviewController.FOnClosePreview ) then
FDPFQLPreviewController.FOnClosePreview( FDPFQLPreviewController);
end;
Thanks for this component.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I'm developing a Firemonkey App for Android and iOS. The main form contains only FMX-Controls.
On iOS I cant find a way to open a document like PDF (except TWebBrowser).
I am now testing TDPFQLPreviewController:
Create a new TForm and place only TDPFQLPreviewController on it. In the main form I open a PDF with
procedure ShowDocumentPreview(const ALocalFileName: string);
begin
if not Assigned(FormDocPreview) then
Application.CreateForm(TFormDocPreview, FormDocPreview);
with FormDocPreview do
begin
QLPreviewController.ShowDoc(ALocalFileName, false);
Show;
end;
end;
But now I cannot find any way to close the form after the user click the Ready-Button on TDPFQLPreviewController. There is no Event like OnClosePreview.
Any suggestion? Thanks, Harald
Last edit: Harald Krekeler 2015-07-21
I added an event to DPF.iOS.QLPreviewController.pas
TDPFQLPreviewController = class( TDPFiOSBaseControl )
...
FOnClosePreview: TNotifyEvent;
...
property OnClosePreview: TNotifyEvent read FOnClosePreview write FOnClosePreview;
procedure TQLPreviewControllerDelegate.previewControllerDidDismiss( controller: QLPreviewController );
begin
if Assigned( FDPFQLPreviewController.FOnClosePreview ) then
FDPFQLPreviewController.FOnClosePreview( FDPFQLPreviewController);
end;
Thanks for this component.