56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
/// <summary>
|
|
/// PDF导出功能测试脚本
|
|
/// </summary>
|
|
public class PdfExportTest : MonoBehaviour
|
|
{
|
|
[Header("测试UI组件")]
|
|
public Button testExportButton; // 测试导出按钮
|
|
|
|
private void Start()
|
|
{
|
|
InitializeTestUI();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化测试UI
|
|
/// </summary>
|
|
private void InitializeTestUI()
|
|
{
|
|
if (testExportButton != null)
|
|
{
|
|
testExportButton.onClick.AddListener(OnTestExportClicked);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 测试导出按钮点击事件
|
|
/// </summary>
|
|
private void OnTestExportClicked()
|
|
{
|
|
Debug.Log("开始PDF导出测试...");
|
|
|
|
// 准备测试数据
|
|
string title = "PDF导出功能测试";
|
|
string content = @"";
|
|
|
|
// 执行PDF导出
|
|
PdfExportManager.Instance.SelectAndExportPdf(title, content, (success, message) =>
|
|
{
|
|
Debug.Log($"PDF导出测试结果: {message}");
|
|
});
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
if (testExportButton != null)
|
|
{
|
|
testExportButton.onClick.RemoveListener(OnTestExportClicked);
|
|
}
|
|
}
|
|
} |