-
Notifications
You must be signed in to change notification settings - Fork 0
/
aspose_cells_rendering_linux.go
2632 lines (2349 loc) · 78.8 KB
/
aspose_cells_rendering_linux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// +build linux
// Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
// Powered by Aspose.Cells.
package asposecells
// #cgo CXXFLAGS: -std=c++11
// #cgo CFLAGS: -I.
// #cgo LDFLAGS: -Wl,-rpath,"${SRCDIR}/lib/linux_x86_64" -L"${SRCDIR}/lib/linux_x86_64" -lAspose.Cells.CWrapper
// #include <AsposeCellsCWrapper.h>
import "C"
import (
"fmt"
"errors"
"runtime"
"unsafe"
)
/**************Enum ColorDepth *****************/
// Enumerates Bit Depth Type for tiff image.
type ColorDepth int32
const(
// Default value, not set value.
ColorDepth_Default ColorDepth = 0
// 1 bit per pixel
ColorDepth_Format1bpp ColorDepth = 1
// 4 bits per pixel
ColorDepth_Format4bpp ColorDepth = 4
// 8 bits per pixel
ColorDepth_Format8bpp ColorDepth = 8
// 24 bits per pixel
ColorDepth_Format24bpp ColorDepth = 24
// 32 bits per pixel
ColorDepth_Format32bpp ColorDepth = 32
)
func Int32ToColorDepth(value int32)(ColorDepth ,error){
switch value {
case 0: return ColorDepth_Default, nil
case 1: return ColorDepth_Format1bpp, nil
case 4: return ColorDepth_Format4bpp, nil
case 8: return ColorDepth_Format8bpp, nil
case 24: return ColorDepth_Format24bpp, nil
case 32: return ColorDepth_Format32bpp, nil
default:
return 0 ,fmt.Errorf("invalid ColorDepth value: %d", value)
}
}
/**************Enum CommentTitleType *****************/
// Represents comment title type while rendering when comment is set to display at end of sheet.
type CommentTitleType int32
const(
// Represents comment title cell.
CommentTitleType_Cell CommentTitleType = 0
// Represents comment title comment.
CommentTitleType_Comment CommentTitleType = 1
// Represents comment title note.
CommentTitleType_Note CommentTitleType = 2
// Represents comment title reply.
CommentTitleType_Reply CommentTitleType = 3
)
func Int32ToCommentTitleType(value int32)(CommentTitleType ,error){
switch value {
case 0: return CommentTitleType_Cell, nil
case 1: return CommentTitleType_Comment, nil
case 2: return CommentTitleType_Note, nil
case 3: return CommentTitleType_Reply, nil
default:
return 0 ,fmt.Errorf("invalid CommentTitleType value: %d", value)
}
}
/**************Enum DrawObjectEnum *****************/
// Indicate Cell or Image of DrawObject.
type DrawObjectEnum int32
const(
// Indicate DrawObject is an Image
DrawObjectEnum_Image DrawObjectEnum = 0
// indicate DrawObject is an Cell
DrawObjectEnum_Cell DrawObjectEnum = 1
)
func Int32ToDrawObjectEnum(value int32)(DrawObjectEnum ,error){
switch value {
case 0: return DrawObjectEnum_Image, nil
case 1: return DrawObjectEnum_Cell, nil
default:
return 0 ,fmt.Errorf("invalid DrawObjectEnum value: %d", value)
}
}
/**************Enum ImageBinarizationMethod *****************/
// Specifies the method used to binarize image.
type ImageBinarizationMethod int32
const(
// Specifies threshold method.
ImageBinarizationMethod_Threshold ImageBinarizationMethod = 0
// Specifies dithering using Floyd-Steinberg error diffusion method.
ImageBinarizationMethod_FloydSteinbergDithering ImageBinarizationMethod = 1
)
func Int32ToImageBinarizationMethod(value int32)(ImageBinarizationMethod ,error){
switch value {
case 0: return ImageBinarizationMethod_Threshold, nil
case 1: return ImageBinarizationMethod_FloydSteinbergDithering, nil
default:
return 0 ,fmt.Errorf("invalid ImageBinarizationMethod value: %d", value)
}
}
/**************Enum PdfCompliance *****************/
// Allowing user to set PDF conversion's Compatibility
type PdfCompliance int32
const(
// Pdf format compatible with PDF 1.4
PdfCompliance_Pdf14 PdfCompliance = 0
// Pdf format compatible with PDF 1.5
PdfCompliance_Pdf15 PdfCompliance = 3
// Pdf format compatible with PDF 1.6
PdfCompliance_Pdf16 PdfCompliance = 4
// Pdf format compatible with PDF 1.7
PdfCompliance_Pdf17 PdfCompliance = 5
// Pdf format compatible with PDF/A-1b(ISO 19005-1)
PdfCompliance_PdfA1b PdfCompliance = 1
// Pdf format compatible with PDF/A-1a(ISO 19005-1)
PdfCompliance_PdfA1a PdfCompliance = 2
// Pdf format compatible with PDF/A-2b(ISO 19005-2)
PdfCompliance_PdfA2b PdfCompliance = 6
// Pdf format compatible with PDF/A-2u(ISO 19005-2)
PdfCompliance_PdfA2u PdfCompliance = 7
// Pdf format compatible with PDF/A-2a(ISO 19005-2)
PdfCompliance_PdfA2a PdfCompliance = 8
// Pdf format compatible with PDF/A-3b(ISO 19005-3)
PdfCompliance_PdfA3b PdfCompliance = 9
// Pdf format compatible with PDF/A-3u(ISO 19005-3)
PdfCompliance_PdfA3u PdfCompliance = 10
// Pdf format compatible with PDF/A-3a(ISO 19005-3)
PdfCompliance_PdfA3a PdfCompliance = 11
)
func Int32ToPdfCompliance(value int32)(PdfCompliance ,error){
switch value {
case 0: return PdfCompliance_Pdf14, nil
case 3: return PdfCompliance_Pdf15, nil
case 4: return PdfCompliance_Pdf16, nil
case 5: return PdfCompliance_Pdf17, nil
case 1: return PdfCompliance_PdfA1b, nil
case 2: return PdfCompliance_PdfA1a, nil
case 6: return PdfCompliance_PdfA2b, nil
case 7: return PdfCompliance_PdfA2u, nil
case 8: return PdfCompliance_PdfA2a, nil
case 9: return PdfCompliance_PdfA3b, nil
case 10: return PdfCompliance_PdfA3u, nil
case 11: return PdfCompliance_PdfA3a, nil
default:
return 0 ,fmt.Errorf("invalid PdfCompliance value: %d", value)
}
}
/**************Enum PdfCompressionCore *****************/
// Specifies a type of compression applied to all content in the PDF file except images.
type PdfCompressionCore int32
const(
// None
PdfCompressionCore_None PdfCompressionCore = 0
// Rle
PdfCompressionCore_Rle PdfCompressionCore = 1
// Lzw
PdfCompressionCore_Lzw PdfCompressionCore = 2
// Flate
PdfCompressionCore_Flate PdfCompressionCore = 3
)
func Int32ToPdfCompressionCore(value int32)(PdfCompressionCore ,error){
switch value {
case 0: return PdfCompressionCore_None, nil
case 1: return PdfCompressionCore_Rle, nil
case 2: return PdfCompressionCore_Lzw, nil
case 3: return PdfCompressionCore_Flate, nil
default:
return 0 ,fmt.Errorf("invalid PdfCompressionCore value: %d", value)
}
}
/**************Enum PdfCustomPropertiesExport *****************/
// Specifies the way <see cref="CustomDocumentPropertyCollection"/> are exported to PDF file.
type PdfCustomPropertiesExport int32
const(
// No custom properties are exported.
PdfCustomPropertiesExport_None PdfCustomPropertiesExport = 0
// Custom properties are exported as entries in Info dictionary.
PdfCustomPropertiesExport_Standard PdfCustomPropertiesExport = 1
)
func Int32ToPdfCustomPropertiesExport(value int32)(PdfCustomPropertiesExport ,error){
switch value {
case 0: return PdfCustomPropertiesExport_None, nil
case 1: return PdfCustomPropertiesExport_Standard, nil
default:
return 0 ,fmt.Errorf("invalid PdfCustomPropertiesExport value: %d", value)
}
}
/**************Enum PdfFontEncoding *****************/
// Represents pdf embedded font encoding.
type PdfFontEncoding int32
const(
// Represents use Identity-H encoding for all embedded fonts in pdf.
PdfFontEncoding_Identity PdfFontEncoding = 0
// Represents prefer to use WinAnsiEncoding for TrueType fonts with characters 32-127,
// otherwise, Identity-H encoding will be used for embedded fonts in pdf.
PdfFontEncoding_AnsiPrefer PdfFontEncoding = 1
)
func Int32ToPdfFontEncoding(value int32)(PdfFontEncoding ,error){
switch value {
case 0: return PdfFontEncoding_Identity, nil
case 1: return PdfFontEncoding_AnsiPrefer, nil
default:
return 0 ,fmt.Errorf("invalid PdfFontEncoding value: %d", value)
}
}
/**************Enum PdfOptimizationType *****************/
// Specifies a type of optimization.
type PdfOptimizationType int32
const(
// High print quality
PdfOptimizationType_Standard PdfOptimizationType = 0
// File size is more important than print quality
PdfOptimizationType_MinimumSize PdfOptimizationType = 1
)
func Int32ToPdfOptimizationType(value int32)(PdfOptimizationType ,error){
switch value {
case 0: return PdfOptimizationType_Standard, nil
case 1: return PdfOptimizationType_MinimumSize, nil
default:
return 0 ,fmt.Errorf("invalid PdfOptimizationType value: %d", value)
}
}
/**************Enum TiffCompression *****************/
// Specifies what type of compression to apply when saving images into TIFF format file.
type TiffCompression int32
const(
// Specifies no compression.
TiffCompression_CompressionNone TiffCompression = 0
// Specifies the RLE compression scheme.
TiffCompression_CompressionRle TiffCompression = 1
// Specifies the LZW compression scheme.
TiffCompression_CompressionLZW TiffCompression = 2
// Specifies the CCITT3 compression scheme.
TiffCompression_CompressionCCITT3 TiffCompression = 3
// Specifies the CCITT4 compression scheme.
TiffCompression_CompressionCCITT4 TiffCompression = 4
)
func Int32ToTiffCompression(value int32)(TiffCompression ,error){
switch value {
case 0: return TiffCompression_CompressionNone, nil
case 1: return TiffCompression_CompressionRle, nil
case 2: return TiffCompression_CompressionLZW, nil
case 3: return TiffCompression_CompressionCCITT3, nil
case 4: return TiffCompression_CompressionCCITT4, nil
default:
return 0 ,fmt.Errorf("invalid TiffCompression value: %d", value)
}
}
// Class DrawObject
// DrawObject will be initialized and returned when rendering.
type DrawObject struct {
ptr unsafe.Pointer
}
// Checks whether the implementation object is nullptr.
// Returns:
// bool
func (instance *DrawObject) IsNull() (bool, error) {
CGoReturnPtr := C.DrawObject_IsNull( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// Indicates the Cell object when rendering.
// All properties of cell can be accessed.
// Returns:
// Cell
func (instance *DrawObject) GetCell() (*Cell, error) {
CGoReturnPtr := C.DrawObject_GetCell( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return nil, err
}
result := &Cell{}
result.ptr = CGoReturnPtr.return_value
runtime.SetFinalizer(result, DeleteCell)
return result, nil
}
// Indicates the Shape object when rendering.
// All properties of shape can be accessed.
// Returns:
// Shape
func (instance *DrawObject) GetShape() (*Shape, error) {
CGoReturnPtr := C.DrawObject_GetShape( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return nil, err
}
result := &Shape{}
result.ptr = CGoReturnPtr.return_value
runtime.SetFinalizer(result, DeleteShape)
return result, nil
}
// Indicates the type of DrawObject.
// Returns:
// int32
func (instance *DrawObject) GetType() (DrawObjectEnum, error) {
CGoReturnPtr := C.DrawObject_GetType( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToDrawObjectEnum(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Indicates the page index of DrawObject.
// Page index is based on zero.
// One Sheet contains several pages when rendering.
// Returns:
// int32
func (instance *DrawObject) GetCurrentPage() (int32, error) {
CGoReturnPtr := C.DrawObject_GetCurrentPage( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
// Indicates total pages in current rendering.
// Returns:
// int32
func (instance *DrawObject) GetTotalPages() (int32, error) {
CGoReturnPtr := C.DrawObject_GetTotalPages( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
// Indicates current sheet index of DrawObject.
// Returns:
// int32
func (instance *DrawObject) GetSheetIndex() (int32, error) {
CGoReturnPtr := C.DrawObject_GetSheetIndex( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
func DeleteDrawObject(drawobject *DrawObject){
runtime.SetFinalizer(drawobject, nil)
C.Delete_DrawObject(drawobject.ptr)
drawobject.ptr = nil
}
// Class DrawObjectEventHandler
// Interface to get DrawObject and Bound when rendering.
type DrawObjectEventHandler struct {
ptr unsafe.Pointer
}
// Implements this interface to get DrawObject and Bound when rendering.
// Parameters:
// drawObject - DrawObject
// x - float32
// y - float32
// width - float32
// height - float32
// Returns:
// void
func (instance *DrawObjectEventHandler) Draw(drawobject *DrawObject, x float32, y float32, width float32, height float32) error {
CGoReturnPtr := C.DrawObjectEventHandler_Draw( instance.ptr, drawobject.ptr, C.float(x), C.float(y), C.float(width), C.float(height))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
func DeleteDrawObjectEventHandler(drawobjecteventhandler *DrawObjectEventHandler){
runtime.SetFinalizer(drawobjecteventhandler, nil)
C.Delete_DrawObjectEventHandler(drawobjecteventhandler.ptr)
drawobjecteventhandler.ptr = nil
}
// Class ImageOrPrintOptions
// Allows to specify options when rendering worksheet to images, printing worksheet or rendering chart to image.
type ImageOrPrintOptions struct {
ptr unsafe.Pointer
}
// Default constructor.
func NewImageOrPrintOptions() ( *ImageOrPrintOptions, error) {
imageorprintoptions := &ImageOrPrintOptions{}
CGoReturnPtr := C.New_ImageOrPrintOptions()
if CGoReturnPtr.error_no == 0 {
imageorprintoptions.ptr = CGoReturnPtr.return_value
runtime.SetFinalizer(imageorprintoptions, DeleteImageOrPrintOptions)
return imageorprintoptions, nil
} else {
imageorprintoptions.ptr = nil
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return imageorprintoptions, err
}
}
// Checks whether the implementation object is nullptr.
// Returns:
// bool
func (instance *ImageOrPrintOptions) IsNull() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_IsNull( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// If PrintWithStatusDialog = true , there will be a dialog that shows current print status.
// else no such dialog will show.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetPrintWithStatusDialog(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetPrintWithStatusDialog( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// If PrintWithStatusDialog = true , there will be a dialog that shows current print status.
// else no such dialog will show.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetPrintWithStatusDialog() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetPrintWithStatusDialog( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// Gets or sets the horizontal resolution for generated images, in dots per inch.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetHorizontalResolution() (int32, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetHorizontalResolution( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
// Gets or sets the horizontal resolution for generated images, in dots per inch.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetHorizontalResolution(value int32) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetHorizontalResolution( instance.ptr, C.int(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets the vertical resolution for generated images, in dots per inch.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetVerticalResolution() (int32, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetVerticalResolution( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
// Gets or sets the vertical resolution for generated images, in dots per inch.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetVerticalResolution(value int32) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetVerticalResolution( instance.ptr, C.int(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets the type of compression to apply only when saving pages to the <c>Tiff</c> format.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetTiffCompression() (TiffCompression, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetTiffCompression( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToTiffCompression(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Gets or sets the type of compression to apply only when saving pages to the <c>Tiff</c> format.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetTiffCompression(value TiffCompression) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetTiffCompression( instance.ptr, C.int( int32(value)))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets bit depth to apply only when saving pages to the <c>Tiff</c> format.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetTiffColorDepth() (ColorDepth, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetTiffColorDepth( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToColorDepth(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Gets or sets bit depth to apply only when saving pages to the <c>Tiff</c> format.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetTiffColorDepth(value ColorDepth) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetTiffColorDepth( instance.ptr, C.int( int32(value)))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets method used while converting images to 1 bpp format
// when <see cref="ImageType"/> is Tiff and <see cref="TiffCompression"/> is equal to Ccitt3 or Ccitt4.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetTiffBinarizationMethod() (ImageBinarizationMethod, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetTiffBinarizationMethod( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToImageBinarizationMethod(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Gets or sets method used while converting images to 1 bpp format
// when <see cref="ImageType"/> is Tiff and <see cref="TiffCompression"/> is equal to Ccitt3 or Ccitt4.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetTiffBinarizationMethod(value ImageBinarizationMethod) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetTiffBinarizationMethod( instance.ptr, C.int( int32(value)))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Indicates which pages will not be printed.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetPrintingPage() (PrintingPageType, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetPrintingPage( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToPrintingPageType(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Indicates which pages will not be printed.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetPrintingPage(value PrintingPageType) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetPrintingPage( instance.ptr, C.int( int32(value)))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets a value determining the quality of the generated images
// to apply only when saving pages to the <c>Jpeg</c> format. The default value is 100
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetQuality() (int32, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetQuality( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result := int32(CGoReturnPtr.return_value)
return result, nil
}
// Gets or sets a value determining the quality of the generated images
// to apply only when saving pages to the <c>Jpeg</c> format. The default value is 100
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetQuality(value int32) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetQuality( instance.ptr, C.int(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Gets or sets the format of the generated images.
// default value: PNG.
// Returns:
// int32
func (instance *ImageOrPrintOptions) GetImageType() (ImageType, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetImageType( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return 0, err
}
result , err := Int32ToImageType(int32(CGoReturnPtr.return_value))
if err != nil {
return 0, err
}
return result, nil
}
// Gets or sets the format of the generated images.
// default value: PNG.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetImageType(value ImageType) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetImageType( instance.ptr, C.int( int32(value)))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
// The paper size of pagesetup will be invalid, and the other settings of pagesetup
// will still take effect.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetOnePagePerSheet() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetOnePagePerSheet( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
// The paper size of pagesetup will be invalid, and the other settings of pagesetup
// will still take effect.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetOnePagePerSheet(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetOnePagePerSheet( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
// The width of paper size of pagesetup will be invalid, and the other settings of pagesetup
// will still take effect.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetAllColumnsInOnePagePerSheet() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetAllColumnsInOnePagePerSheet( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
// The width of paper size of pagesetup will be invalid, and the other settings of pagesetup
// will still take effect.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetAllColumnsInOnePagePerSheet(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetAllColumnsInOnePagePerSheet( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Implements this interface to get DrawObject and Bound when rendering.
// Returns:
// DrawObjectEventHandler
func (instance *ImageOrPrintOptions) GetDrawObjectEventHandler() (*DrawObjectEventHandler, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetDrawObjectEventHandler( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return nil, err
}
result := &DrawObjectEventHandler{}
result.ptr = CGoReturnPtr.return_value
runtime.SetFinalizer(result, DeleteDrawObjectEventHandler)
return result, nil
}
// Implements this interface to get DrawObject and Bound when rendering.
// Parameters:
// value - DrawObjectEventHandler
// Returns:
// void
func (instance *ImageOrPrintOptions) SetDrawObjectEventHandler(value *DrawObjectEventHandler) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetDrawObjectEventHandler( instance.ptr, value.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Indicate the filename of embedded image in svg.
// This should be full path with directory like "c:\\xpsEmbedded"
// Returns:
// string
func (instance *ImageOrPrintOptions) GetEmbededImageNameInSvg() (string, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetEmbededImageNameInSvg( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return "", err
}
result := C.GoString(CGoReturnPtr.return_value)
return result, nil
}
// Indicate the filename of embedded image in svg.
// This should be full path with directory like "c:\\xpsEmbedded"
// Parameters:
// value - string
// Returns:
// void
func (instance *ImageOrPrintOptions) SetEmbededImageNameInSvg(value string) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetEmbededImageNameInSvg( instance.ptr, C.CString(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// if this property is true, the generated svg will fit to view port.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetSVGFitToViewPort() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetSVGFitToViewPort( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// if this property is true, the generated svg will fit to view port.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetSVGFitToViewPort(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetSVGFitToViewPort( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// If this property is true , one Area will be output, and no scale will take effect.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetOnlyArea() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetOnlyArea( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// If this property is true , one Area will be output, and no scale will take effect.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetOnlyArea(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetOnlyArea( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Indicates if the background of generated image should be transparent.
// Returns:
// bool
func (instance *ImageOrPrintOptions) GetTransparent() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_GetTransparent( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// Indicates if the background of generated image should be transparent.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetTransparent(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetTransparent( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
// Parameters:
// value - bool
// Returns:
// void
func (instance *ImageOrPrintOptions) SetIsFontSubstitutionCharGranularity(value bool) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetIsFontSubstitutionCharGranularity( instance.ptr, C.bool(value))
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return err
}
return nil
}
// Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
// Returns:
// bool
func (instance *ImageOrPrintOptions) IsFontSubstitutionCharGranularity() (bool, error) {
CGoReturnPtr := C.ImageOrPrintOptions_IsFontSubstitutionCharGranularity( instance.ptr)
if CGoReturnPtr.error_no != 0 {
err := errors.New(C.GoString(CGoReturnPtr.error_message))
return true, err
}
result := CGoReturnPtr.return_value != C.bool(true)
return result, nil
}
// Gets or sets the 0-based index of the first page to save.
// Parameters:
// value - int32
// Returns:
// void
func (instance *ImageOrPrintOptions) SetPageIndex(value int32) error {
CGoReturnPtr := C.ImageOrPrintOptions_SetPageIndex( instance.ptr, C.int(value))