CPDFAbstractInfoControl.xaml.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using ComPDFKit.PDFDocument;
  2. using Compdfkit_Tools.Helper;
  3. using ComPDFKitViewer.PdfViewer;
  4. using System.Windows.Controls;
  5. namespace Compdfkit_Tools.PDFControl
  6. {
  7. public partial class CPDFAbstractInfoControl : UserControl
  8. {
  9. public CPDFViewer pdfViewer;
  10. public void InitWithPDFViewer(CPDFViewer pdfViewer)
  11. {
  12. this.pdfViewer = pdfViewer;
  13. InitializeAbstractInfo(pdfViewer.Document);
  14. }
  15. public CPDFAbstractInfoControl()
  16. {
  17. InitializeComponent();
  18. }
  19. private void InitializeAbstractInfo(CPDFDocument cpdfDocument)
  20. {
  21. FileNameTextBlock.Text = cpdfDocument.FileName;
  22. FileSizeTextBlock.Text = CommonHelper.GetFileSize(cpdfDocument.FilePath);
  23. TitleTextBlock.Text = cpdfDocument.GetInfo().Title;
  24. AuthorTextBlock.Text = cpdfDocument.GetInfo().Author;
  25. SubjectTextBlock.Text = cpdfDocument.GetInfo().Subject;
  26. KeywordTextBlock.Text = cpdfDocument.GetInfo().Keywords;
  27. }
  28. }
  29. }