@@ -64,7 +64,16 @@ var configuration = CPDFConfiguration(
64
64
]
65
65
)
66
66
);
67
- ComPDFKit.openDocument(document, password: '', configuration: configuration);
67
+ ComPDFKit.openDocument(document, password: '', configuration: configuration);
68
+
69
+ // usage Widget
70
+ Scaffold(
71
+ resizeToAvoidBottomInset: false,
72
+ appBar: AppBar(title: const Text('CPDFReaderWidget Example'),),
73
+ body: CPDFReaderWidget(
74
+ document: widget.documentPath,
75
+ configuration: configuration
76
+ ));
68
77
```
69
78
70
79
### Option Explanations
@@ -132,17 +141,18 @@ Configure functions for the top toolbar in the PDF view.
132
141
133
142
##### ** availableMenus Constants**
134
143
135
- | Name | Description |
136
- | -------------- | ---------------------------------------------------------- |
144
+ | Name | Description |
145
+ | -------------- | ------------------------------------------------------------ |
137
146
| viewSetting | Settings related to PDF viewing, such as scroll direction and theme. |
138
147
| documentEditor | Displays a list of PDF document thumbnails and allows page manipulation such as addition and deletion. |
139
- | documentInfo | Displays information related to the PDF document. |
148
+ | documentInfo | Displays information related to the PDF document. |
140
149
| watermark | Adds text or image watermark to the document, saving it as a new document. |
141
- | security | Sets viewing and permission passwords for the document. |
150
+ | security | Sets viewing and permission passwords for the document. |
142
151
| flattened | Flattens annotations and other content within the document, making annotations uneditable. |
143
- | save | Saves the document. |
144
- | share | Shares the PDF document. |
152
+ | save | Saves the document. |
153
+ | share | Shares the PDF document. |
145
154
| openDocument | Opens the system file selector to choose and open a PDF document. |
155
+ | snip | The PDF capture function allows you to capture an area in the PDF document and convert it into an image. |
146
156
``` json
147
157
{
148
158
"toolbarConfig" : {
@@ -170,7 +180,8 @@ Configure functions for the top toolbar in the PDF view.
170
180
" flattened" ,
171
181
" save" ,
172
182
" share" ,
173
- " openDocument"
183
+ " openDocument" ,
184
+ " snip"
174
185
]
175
186
}
176
187
}
@@ -182,11 +193,12 @@ Configure annotation-related settings, such as enabling types displayed in the a
182
193
183
194
##### ** Parameters**
184
195
185
- | Name | Type | Description |
186
- | -------------- | ----- | ------------------------------------------------------------ |
187
- | availableTypes | Array | The types of annotations enabled in the toolbar at the bottom. |
188
- | availableTools | Array | Annotation tools, including ` Setting ` , ` Undo ` , and ` Redo ` . |
189
- | initAttribute | Array | Set default attributes for annotations. |
196
+ | Name | Type | Description |
197
+ | ---------------- | ------ | --------------------------------------------------------------------------|
198
+ | availableTypes | Array | The types of annotations enabled in the toolbar at the bottom. |
199
+ | availableTools | Array | Annotation tools, including ` Setting ` , ` Undo ` , and ` Redo ` . |
200
+ | initAttribute | Array | Set default attributes for annotations. |
201
+ | annotationAuthor | String | Set the author name when adding annotations and replying to annotations. |
190
202
191
203
##### ** availableTypes Constants**
192
204
@@ -760,9 +772,10 @@ This section is used to configure the types of forms enabled in the view's botto
760
772
761
773
##### Parameters
762
774
763
- | Name | Type | Example | Description |
764
- | --------- | ------------- | ------- | ------------------------------------------------------------ |
765
- | themeMode | CPDFThemeMode | light | Set the view theme style, support ` light ` , ` dark ` , ` system ` , the default is ` light ` theme<br />** ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
775
+ | Name | Type | Example | Description |
776
+ | ----------------------- | ------------- | ------- | ------------------------------------------------------------ |
777
+ | themeMode | CPDFThemeMode | light | Set the view theme style, support ` light ` , ` dark ` , ` system ` , the default is ` light ` theme<br />** ComPDFKit SDK for Flutter:** => 2.0.2<br />Only Android Platform. |
778
+ | fileSaveExtraFontSubset | boolean | true | When saving a document, whether to save the used font set together with the document. |
766
779
767
780
##### themeMode Constants
768
781
@@ -780,6 +793,7 @@ This section is used to configure the types of forms enabled in the view's botto
780
793
{
781
794
"modeConfig" : {
782
795
"initialViewMode" : " viewer" ,
796
+ "readerOnly" : false ,
783
797
"availableViewModes" : [
784
798
" viewer" ,
785
799
" annotations" ,
@@ -813,10 +827,12 @@ This section is used to configure the types of forms enabled in the view's botto
813
827
" flattened" ,
814
828
" save" ,
815
829
" share" ,
816
- " openDocument"
830
+ " openDocument" ,
831
+ " snip"
817
832
]
818
833
},
819
834
"annotationsConfig" : {
835
+ "annotationAuthor" : " Guest" ,
820
836
"availableTypes" : [
821
837
" note" ,
822
838
" highlight" ,
@@ -1033,6 +1049,10 @@ This section is used to configure the types of forms enabled in the view's botto
1033
1049
"pageSpacing" : 10 ,
1034
1050
"pageScale" : 1.0 ,
1035
1051
"pageSameWidth" :true
1052
+ },
1053
+ "global" : {
1054
+ "themeMode" : " system" ,
1055
+ "fileSaveExtraFontSubset" : true
1036
1056
}
1037
1057
}
1038
1058
```
0 commit comments