cpdf_configuration.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import 'dart:ui';
  2. import 'package:compdfkit_flutter/common/util/cpdf_color_extension.dart';
  3. import 'package:compdfkit_flutter/core/document/viewer/cpdf_scroll_direction.dart';
  4. import 'package:flutter/material.dart';
  5. import 'core/annotation/cpdf_border_style.dart';
  6. import 'core/annotation/cpdf_font_type.dart';
  7. import 'core/annotation/cpdf_line_type.dart';
  8. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  9. ///
  10. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  11. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  12. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  13. /// This notice may not be removed from this file.
  14. class CPDFConfiguration {
  15. bool isVerticalMode = true;
  16. bool isDoublePage = false;
  17. bool isContinueMode = true;
  18. bool isCoverPageMode = false;
  19. bool isCropMode = false;
  20. Color readBackgroundColor = Colors.white;
  21. Map<String, dynamic> toConfiguration(){
  22. return {
  23. 'isVerticalMode': isVerticalMode,
  24. 'isDoublePage': isDoublePage,
  25. 'isContinueMode': isContinueMode,
  26. 'isCoverPageMode': isCoverPageMode,
  27. 'isCropMode': isCropMode,
  28. 'readBackgroundColor': readBackgroundColor.toHex(),
  29. 'annotAttribute': {
  30. 'note': {
  31. 'color': "#A5D6A7"
  32. },
  33. 'highlight': {
  34. 'color': "#A5D6A7",
  35. 'opacity': 255
  36. },
  37. 'strikeout': {
  38. 'color': "#A5D6A7",
  39. 'opacity': 255
  40. },
  41. 'underline': {
  42. 'color': "#A5D6A7",
  43. 'opacity': 255
  44. },
  45. 'squiggly': {
  46. 'color': "#A5D6A7",
  47. 'opacity': 255
  48. },
  49. 'ink': {
  50. 'color': "#A5D6A7",
  51. 'opacity': 255,
  52. 'borderWidth': 10,
  53. 'eraserWidth' : 10
  54. },
  55. 'square' : {
  56. 'lineColor' : "#A5D6A7",
  57. 'lineColorOpacity' : 255,
  58. 'fillColor' : Colors.transparent.toHex(),
  59. 'fillColorOpacity' : 0,
  60. 'borderWidth' : 10,
  61. 'borderStyle' : {
  62. 'style' : CPDFBorderStyle.solid,
  63. 'borderWidth' : 10,
  64. 'dashArr' : [8.0, 0]
  65. }
  66. },
  67. 'circle' : {
  68. 'lineColor' : "#A5D6A7",
  69. 'lineColorOpacity' : 255,
  70. 'fillColor' : Colors.transparent.toHex(),
  71. 'fillColorOpacity' : 0,
  72. 'borderWidth' : 10,
  73. 'borderStyle' : {
  74. 'style' : CPDFBorderStyle.solid,
  75. 'borderWidth' : 10,
  76. 'dashArr' : [8.0, 0]
  77. }
  78. },
  79. 'line' : {
  80. 'lineColor' : "#A5D6A7",
  81. 'lineColorOpacity' : 255,
  82. 'fillColor' : Colors.transparent.toHex(),
  83. 'fillColorOpacity' : 0,
  84. 'borderWidth' : 10,
  85. 'borderStyle' : {
  86. 'style' : CPDFBorderStyle.solid,
  87. 'borderWidth' : 10,
  88. 'dashArr' : [8.0, 0]
  89. },
  90. },
  91. 'arrow' : {
  92. 'lineColor' : "#A5D6A7",
  93. 'lineColorOpacity' : 255,
  94. 'fillColor' : Colors.transparent.toHex(),
  95. 'fillColorOpacity' : 0,
  96. 'borderWidth' : 10,
  97. 'borderStyle' : {
  98. 'style' : CPDFBorderStyle.solid,
  99. 'borderWidth' : 10,
  100. 'dashArr' : [8.0, 0]
  101. },
  102. 'headType' : CPDFLineType.none,
  103. 'tailType' : CPDFLineType.arrow
  104. },
  105. 'freetext': {
  106. 'textColor' : '#A5D6A7',
  107. 'textColorOpacity' : 255,
  108. 'fontBold': false,
  109. 'fontItalic': false,
  110. 'fontSize': 40,
  111. 'fontType': CPDFFontType.helvetica
  112. }
  113. }
  114. };
  115. }
  116. }