using Paroxe.PdfRenderer; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; 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; //LangChaoRommMinIo.Instance.getFile(MQTTManager.Instance.roomId, fileConfig.Bucket, fileConfig.ObjectName, (RoomFileData rfd) => { // Debug.Log("rfd==>" + rfd.url); // Debug.Log("rfd==>" + rfd.bytes.Length); // url = rfd.url; //}); if (!fileConfig.Url.Contains("http")) { url = "https://" + fileConfig.Url; } showPDF(url); } } public void showPDF(string url) { //this.transform.localPosition = new Vector3(0,0,0.69f); pdfview = this.GetComponent(); 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); } } }