【问题标题】:PDF Metadata view using Pagination First, Next, Previous, LastPDF 元数据视图使用分页 First、Next、Previous、Last
【发布时间】:2021-10-28 09:38:06
【问题描述】:

我创建了一个类,用于将 PDF 文件中的元数据读取到单独表单 (InfoForm1) 上的文本框中

    private void Info_Click(object sender, EventArgs e)
    {
        PdfInformation info = pdfViewer1.Document.GetInformation();
        StringBuilder sz = new StringBuilder();

        sz.AppendLine($"Title:\t\t {info.Title}");
        sz.AppendLine($"Subject:\t\t {info.Subject}");
        sz.AppendLine($"Author:\t\t {info.Author}");

        InfoForm1_Link.Show();
        InfoForm1_Link.InfoText = sz.ToString();
    }

现在我正在尝试实现分页按钮(第一个、下一个、上一个、最后一个)来查看文件夹中的其他文件。到目前为止,我只设法创建了这些方法。

我搜索了有关分页系统的答案,但与此案例无关。知道如何进行吗?谢谢你

        InfoForm1_Link.ButtonInfoFormClickedFirst += (s, eF) =>
        {
        };

        InfoForm1_Link.ButtonInfoFormClickedPrevious += (s, eP) =>
        {
        };

        InfoForm1_Link.ButtonInfoFormClickedNext += (s, eN) =>
        {
        };

        InfoForm1_Link.ButtonInfoFormClickedLast += (s, eL) =>
        {
        };

【问题讨论】:

    标签: c# pdf view pagination metadata


    【解决方案1】:

    经过大量研究和反复试验,这行得通:

    InfoForm1_Link.ButtonInfoFormClickedFirst += (s, eF) =>
    {
        if (pFileNames.Length > 0)
        {
            i = 0;
            pdfViewer1.Document = OpenDocument(pFileNames[i]);
            txtInputFileT.Text = (pFileNames[i]);
    
            PdfInformation infoVar = pdfViewer1.Document.GetInformation();
            StringBuilder szVar = new StringBuilder();
    
            szVar.AppendLine($"Title:\t\t {info.Title}");
            szVar.AppendLine($"Subject:\t\t {info.Subject}");
            szVar.AppendLine($"Author:\t\t {info.Author}");
    
            InfoForm1_Link.InfoText = szVar.ToString();
        }
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-01
      • 2019-04-14
      • 2013-12-12
      • 2019-08-12
      • 2014-08-21
      • 2020-10-11
      • 1970-01-01
      相关资源
      最近更新 更多