Пример #1
0
    public void ShowNextPage()
    {
        if (currPageIndex >= totalPageCnt - 1)
        {
            return;
        }

        currPageIndex++;

        pdfSceneImg.texture = pti.GetDrawImageFromPdf(currPageIndex);
        logTxt.text         = "Page: (" + (currPageIndex + 1).ToString() + "/" + totalPageCnt.ToString() + ")";
    }
Пример #2
0
    //private List<Texture2D> pdfPages = new List<Texture2D> ();

    //C:\Users\shubh\Documents\Unity_Projects\OpenCVTest\Assets\StreamingAssets\cert.pdf

    public void InitialisePdf(InputField path)
    {
        //pdfPages.Clear ();
        totalPageCnt = 0;
        //Debug.Log(path.text);
        pti              = new PdfToImage();
        PdfToImage.logs += PdfLog;

//		Debug.Log (pti.Test());
        if (pti.ReadPdf(path.text, ref totalPageCnt))
        {
            logTxt.text = "Page: (" + (currPageIndex + 1).ToString() + "/" + totalPageCnt.ToString() + ")";
        }
        else
        {
            logTxt.text = "unable to read";
        }

        pdfSceneImg.texture = pti.GetDrawImageFromPdf(0);
        //pdfSceneImg.texture = pdfPages [0];
    }