IPDFDevice.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using UnityEngine;
  2. namespace Paroxe.PdfRenderer
  3. {
  4. /// <summary>
  5. /// Interface for device implementation. PDFViewer implements it. It allows to
  6. /// decouple PDFViewer from the API
  7. /// </summary>
  8. public interface IPDFDevice
  9. {
  10. PDFDocument Document { get; }
  11. Vector2 GetDevicePageSize(int pageIndex);
  12. void GoToPage(int pageIndex);
  13. IPDFDeviceActionHandler BookmarksActionHandler { get; set; }
  14. IPDFDeviceActionHandler LinksActionHandler { get; set; }
  15. bool AllowOpenURL { get; set; }
  16. #if !UNITY_WEBGL
  17. void LoadDocument(PDFDocument document, int pageIndex);
  18. void LoadDocument(PDFDocument document, string password, int pageIndex);
  19. void LoadDocumentFromAsset(PDFAsset pdfAsset, int pageIndex);
  20. void LoadDocumentFromAsset(PDFAsset pdfAsset, string password, int pageIndex);
  21. void LoadDocumentFromResources(string folder, string fileName, int pageIndex);
  22. void LoadDocumentFromResources(string folder, string fileName, string password, int pageIndex);
  23. void LoadDocumentFromStreamingAssets(string folder, string fileName, int pageIndex);
  24. void LoadDocumentFromStreamingAssets(string folder, string fileName, string password, int pageIndex);
  25. void LoadDocumentFromPersistentData(string folder, string fileName, int pageIndex);
  26. void LoadDocumentFromPersistentData(string folder, string fileName, string password, int pageIndex);
  27. void LoadDocumentFromWeb(string url, int pageIndex);
  28. void LoadDocumentFromWeb(string url, string password, int pageIndex);
  29. void LoadDocumentFromBuffer(byte[] buffer, int pageIndex);
  30. void LoadDocumentFromBuffer(byte[] buffer, string password, int pageIndex);
  31. void LoadDocumentFromFile(string filePath, int pageIndex);
  32. void LoadDocumentFromFile(string filePath, string password, int pageIndex);
  33. #endif
  34. }
  35. }