I'm having an issue with PdfLib from TMS Pack for FireMonkey.
After creating a pdf (p.EndDocument(True);) it does not open on iPads. iPhones work fine, though.
Tested iOS Versions 12.1.2 to 12.1.4, Delphi 10.3, TMS Pack for FireMonkey 3.7.2.0.
A possible workaround by creating a pdf without automatically opening it and then using iCLs TTMSFMXNativeUIDocumentInteractionController.ShowPreview does not work either, the pdf will not open. The preview will show up when I select the pdf from a list later, but not immediately after the pdf was created. This happens on iPhones too.
Create a PDF without automatically opening it and then use the TTMSFMXUtils.OpenFile method, with the location of the PDF, and a control reference from where the interaction controller should be presented from.
We have tested this here on an iPad and are not experiencing issues. The popup is shown i the center of the screen, and allows opening with acrobat, or books with the following code:
uses
FMX.TMSPDFLib, IOUtils;
procedure TForm54.Button1Click(Sender: TObject);
var
p: TTMSFMXPDFLib;
fn: string;
begin
fn := TPath.GetDocumentsPath + PathDelim + 'test.pdf';
p := TTMSFMXPDFLib.Create;
try
p.BeginDocument(fn);
p.NewPage;
p.EndDocument(True);
finally
p.Free;
end;
end;
are you able to test older iOS version to see if there is an issue regarding the iOS version instead of the component itself?
Hi, We have tested this here on iOS 12.1.4 and are not able to reproduce this. After running the PDFLib Demo, and clicking on the button, the PDF is generated and you can open it with iBooks, via the UIDocumentInteractionController that is prompted after calling the EndDocument with a true parameter.
As we are not able to reproduce this, it's actually unclear exactly what is going wrong. Did you test this with the demo? Did you try this in a new project?
we've tested the demo in a new project today. It has the same issue.
I'd like to double check whether the problem is caused by our iPads or the development environment.
Can I invite you to test our demo with testflight? Can we test your app on our iPad?
The demo did not work on iOS out of the box, though.
I
had to delpoy the files test2.txt, Sample.jpg and Sample2.jpg (remote
path: StartUp\Documents) and change the save path of the pdf to
TPath.GetDocumentsPath.
It's a very strange issue, we have no issues here, and specially upgraded an iPad to test against iOS 12.1.4. Can you try saving the PDF to TPath.GetSharedDocumentsPath instead? Can you verify with FileExists on the path that it actually exists? Can you for instance, load a sample PDF in the project deployment window and try opening it with the TTMSFMXUtils.OpenFile method? Can you open other files, such as Images files or document files?
That can potentially be helpful yes, so perhaps you can sign me up, please send us an email to support@tmssoftware.com with a link to this thread, for further communication on this issue.