Recent

Author Topic: Open PDF file  (Read 124 times)

Odanka

  • New Member
  • *
  • Posts: 28
Open PDF file
« on: November 12, 2019, 02:30:59 am »
Code: Pascal  [Select]
  1. ...
  2. // Save PDF
  3.   if not (DirectoryExists(GetEnvironmentDirectoryPath(dirDCIM) +
  4.     '/Mayari')) then
  5.     CreateDir(GetEnvironmentDirectoryPath(dirDCIM), 'Mayari');
  6.   PDF.SaveToFile(GetEnvironmentDirectoryPath(dirDCIM) +
  7.     '/Mayari/Estimasi.pdf');
  8.   PDF.Free;
  9.  
  10.   // Show PDF
  11.   jIntentManager_PDF.SetMimeType('application/pdf');
  12.   jIntentManager_PDF.SetDataUriAsString('file://' +
  13.     GetEnvironmentDirectoryPath(dirDCIM) + '/Mayari/Estimasi.pdf');
  14.  
  15.   if jIntentManager_PDF.ResolveActivity() then
  16.     jIntentManager_PDF.StartActivity()
  17.   else
  18.     ShowMessage('Membuka PDF gagal!, File://MemoriInternal/DCIM/Mayari/Estimasi.pdf');
  19. ...
  20.  
The above code work properly on android < 8 but do not work on android 8+, any one please..
Thank you.