1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Paroxe.PdfRenderer;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using static LangChaoRommMinIo;
- public class PdfManager : BaseFilePrefabItem
- {
- private PDFViewer pdfview;
- public override void Init(FileConfig fileConfig)
- {
- base.Init(fileConfig);
- if (!string.IsNullOrEmpty(fileConfig.Url))
- {
- string url = fileConfig.Url;
-
- if (!fileConfig.Url.Contains("http"))
- {
- url = "https://" + fileConfig.Url;
- }
- LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => {
- Debug.Log("rfd==>" + rfd.url);
- Debug.Log("rfd==>" + rfd.bytes.Length);
- string url = rfd.url;
- showPDF(url);
- });
-
- }
-
-
- }
- public void showPDF(string url)
- {
-
- pdfview = this.GetComponent<PDFViewer>();
- pdfview.FileURL = url;
- pdfview.LoadDocument();
- }
- public override void OnScaleStopped()
- {
- if (transform.localScale.x < 0.0001f)
- {
- transform.localScale = new Vector3(0.0001f, 0.0001f, 0.0001f);
- }
- }
- }
|