CPDFAbstractInfoControl.xaml.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using ComPDFKit.PDFDocument;
  2. using compdfkit_tools.Helper;
  3. using ComPDFKitViewer.PdfViewer;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace compdfkit_tools.PDFControl
  19. {
  20. /// <summary>
  21. /// PDFAbstractInfoControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class CPDFAbstractInfoControl : UserControl
  24. {
  25. public CPDFViewer pdfViewer;
  26. public void InitWithPDFViewer(CPDFViewer pdfViewer)
  27. {
  28. this.pdfViewer = pdfViewer;
  29. InitializeAbstractInfo(pdfViewer.Document);
  30. }
  31. public CPDFAbstractInfoControl()
  32. {
  33. InitializeComponent();
  34. }
  35. private void InitializeAbstractInfo(CPDFDocument cpdfDocument)
  36. {
  37. FileNameTextBlock.Text = cpdfDocument.FileName;
  38. FileSizeTextBlock.Text = CommonHelper.GetFileSize(cpdfDocument.FilePath);
  39. TitleTextBlock.Text = cpdfDocument.GetInfo().Title;
  40. AuthorTextBlock.Text = cpdfDocument.GetInfo().Author;
  41. SubjectTextBlock.Text = cpdfDocument.GetInfo().Subject;
  42. KeywordTextBlock.Text = cpdfDocument.GetInfo().Keywords;
  43. }
  44. }
  45. }