-
Notifications
You must be signed in to change notification settings - Fork 18
/
pdfium.go
2215 lines (1698 loc) · 122 KB
/
pdfium.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
package pdfium
import (
"time"
"github.com/klippa-app/go-pdfium/requests"
"github.com/klippa-app/go-pdfium/responses"
)
type LibraryConfig struct {
UserFontPaths []string // Array of paths to scan in place of the defaults when using built-in FXGE font loading code. The Array may be nil or empty itself to use the default paths. May be ignored entirely depending upon the platform.
}
// Pool describes a PDFium worker pool. Every instance in the pool manages
// its own resources.
type Pool interface {
// GetInstance returns an instance to the pool.
// For single-threaded this is thread safe, but you can only do one PDFium action at the same time.
// For multi-threaded it will try to get a worker from the pool for the length of timeout
// It is important to Close instances when you are done with them. To either return them to the pool
// or clear it's resources.
GetInstance(timeout time.Duration) (Pdfium, error)
// Close closes the pool.
// It will close any unclosed instances.
// For single-threaded it will unload the library if it's the last pool.
// For multi-threaded it will stop all the pool workers.
Close() error
}
// Pdfium describes a Pdfium worker instance. Documents and handles can't be
// shared between different instances. WHen a worker is closed, all resources
// and open documents are released.
type Pdfium interface {
// Start instance functions.
// OpenDocument returns a PDFium references for the given file data.
// This is a gateway to FPDF_LoadMemDocument, FPDF_LoadMemDocument64,
// FPDF_LoadDocument and FPDF_LoadCustomDocument. Please note that
// FPDF_LoadCustomDocument will only work efficiently on single-threaded
// usage, on multi-threaded this will just fully read from the reader
// into a byte array before it's being sent over to PDFium.
// This method already checks FPDF_GetLastError internally for the result.
OpenDocument(request *requests.OpenDocument) (*responses.OpenDocument, error)
// Close closes the instance.
// It will close any unclosed documents.
// For multi-threaded it will give back the worker to the pool.
Close() error
// Kill kills the instance.
// On multi-thread this will kill the subprocess.
// On single-threaded this is the same as Close().
// Use this when you detected that your process has hung.
Kill() error
// GetImplementation returns the specific runtime implementation.
GetImplementation() interface{}
// End instance functions.
// Start text: text helpers
// GetPageText returns the text of a given page in plain text.
GetPageText(request *requests.GetPageText) (*responses.GetPageText, error)
// GetPageTextStructured returns the text of a given page in a structured way,
// with coordinates and font information.
GetPageTextStructured(request *requests.GetPageTextStructured) (*responses.GetPageTextStructured, error)
// End text: text helpers
// Start text: metadata helpers
// GetMetaData returns the metadata values of the document.
GetMetaData(request *requests.GetMetaData) (*responses.GetMetaData, error)
// End text: metadata helpers
// Start render: render helpers
// RenderPageInDPI renders a given page in the given DPI.
RenderPageInDPI(request *requests.RenderPageInDPI) (*responses.RenderPageInDPI, error)
// RenderPagesInDPI renders the given pages in the given DPI.
RenderPagesInDPI(request *requests.RenderPagesInDPI) (*responses.RenderPagesInDPI, error)
// RenderPageInPixels renders a given page in the given pixel size.
RenderPageInPixels(request *requests.RenderPageInPixels) (*responses.RenderPageInPixels, error)
// RenderPagesInPixels renders the given pages in the given pixel sizes.
RenderPagesInPixels(request *requests.RenderPagesInPixels) (*responses.RenderPagesInPixels, error)
// GetPageSize returns the size of the page in points.
GetPageSize(request *requests.GetPageSize) (*responses.GetPageSize, error)
// GetPageSizeInPixels returns the size of a page in pixels when rendered in the given DPI.
GetPageSizeInPixels(request *requests.GetPageSizeInPixels) (*responses.GetPageSizeInPixels, error)
// RenderToFile allows you to call one of the other render functions
// and output the resulting image into a file.
RenderToFile(request *requests.RenderToFile) (*responses.RenderToFile, error)
// End render
// Start bookmark: bookmark helpers
// GetBookmarks returns all the bookmarks of a document.
GetBookmarks(request *requests.GetBookmarks) (*responses.GetBookmarks, error)
// End bookmark
// Start action: action helpers
// GetActionInfo returns all the information of an action.
GetActionInfo(request *requests.GetActionInfo) (*responses.GetActionInfo, error)
// End action
// Start action: dest helpers
// GetDestInfo returns all the information of a dest.
GetDestInfo(request *requests.GetDestInfo) (*responses.GetDestInfo, error)
// End dest
// Start fpdfview.h
// FPDF_LoadDocument opens and load a PDF document from a file path.
// Loaded document can be closed by FPDF_CloseDocument().
// This method already checks FPDF_GetLastError internally for the result.
FPDF_LoadDocument(request *requests.FPDF_LoadDocument) (*responses.FPDF_LoadDocument, error)
// FPDF_LoadMemDocument opens and load a PDF document from memory.
// Loaded document can be closed by FPDF_CloseDocument().
// This method already checks FPDF_GetLastError internally for the result.
FPDF_LoadMemDocument(request *requests.FPDF_LoadMemDocument) (*responses.FPDF_LoadMemDocument, error)
// FPDF_LoadMemDocument64 opens and load a PDF document from memory.
// Loaded document can be closed by FPDF_CloseDocument().
// This method already checks FPDF_GetLastError internally for the result.
// Experimental API.
FPDF_LoadMemDocument64(request *requests.FPDF_LoadMemDocument64) (*responses.FPDF_LoadMemDocument64, error)
// FPDF_LoadCustomDocument loads a PDF document from a custom access descriptor.
// This is implemented as an io.ReadSeeker in go-pdfium.
// This is only really efficient for single threaded usage, the multi-threaded
// usage will just load the file in memory because it can't transfer readers
// over gRPC. The single-threaded usage will actually efficiently walk over
// the PDF as it's being used by PDFium.
// Loaded document can be closed by FPDF_CloseDocument().
// This method already checks FPDF_GetLastError internally for the result.
FPDF_LoadCustomDocument(request *requests.FPDF_LoadCustomDocument) (*responses.FPDF_LoadCustomDocument, error)
// FPDF_CloseDocument closes the references, releases the resources.
FPDF_CloseDocument(request *requests.FPDF_CloseDocument) (*responses.FPDF_CloseDocument, error)
// FPDF_GetLastError returns the last error code of a PDFium function, which is just called.
// Usually, this function is called after a PDFium function returns, in order to check the error code of the previous PDFium function.
// If the previous SDK call succeeded, the return value of this function is not defined. This function only works in conjunction
// with APIs that mention FPDF_GetLastError() in their documentation.
// Please note that when using go-pdfium from the same instance (on single-threaded any instance)
// from different subroutines, FPDF_GetLastError might already be reset from
// executing another PDFium method.
FPDF_GetLastError(request *requests.FPDF_GetLastError) (*responses.FPDF_GetLastError, error)
// FPDF_SetSandBoxPolicy set the policy for the sandbox environment.
FPDF_SetSandBoxPolicy(request *requests.FPDF_SetSandBoxPolicy) (*responses.FPDF_SetSandBoxPolicy, error)
// FPDF_LoadPage loads a page and returns a reference.
FPDF_LoadPage(request *requests.FPDF_LoadPage) (*responses.FPDF_LoadPage, error)
// FPDF_ClosePage closes a page that was loaded by LoadPage.
FPDF_ClosePage(request *requests.FPDF_ClosePage) (*responses.FPDF_ClosePage, error)
// FPDF_GetFileVersion returns the numeric version of the file: 14 for 1.4, 15 for 1.5, ...
FPDF_GetFileVersion(request *requests.FPDF_GetFileVersion) (*responses.FPDF_GetFileVersion, error)
// FPDF_GetDocPermissions returns the permission flags of the file.
FPDF_GetDocPermissions(request *requests.FPDF_GetDocPermissions) (*responses.FPDF_GetDocPermissions, error)
// FPDF_GetDocUserPermissions returns the user permission flags of the file.
// Always returns user permissions, even if the document was unlocked by the owner.
// Experimental API.
FPDF_GetDocUserPermissions(request *requests.FPDF_GetDocUserPermissions) (*responses.FPDF_GetDocUserPermissions, error)
// FPDF_GetSecurityHandlerRevision returns the revision number of security handlers of the file.
FPDF_GetSecurityHandlerRevision(request *requests.FPDF_GetSecurityHandlerRevision) (*responses.FPDF_GetSecurityHandlerRevision, error)
// FPDF_GetPageCount returns the amount of pages for the references.
FPDF_GetPageCount(request *requests.FPDF_GetPageCount) (*responses.FPDF_GetPageCount, error)
// FPDF_GetPageWidth returns the width of a page.
// Prefer FPDF_GetPageWidthF(). This will be deprecated in the future.
FPDF_GetPageWidth(request *requests.FPDF_GetPageWidth) (*responses.FPDF_GetPageWidth, error)
// FPDF_GetPageHeight returns the height of a page.
// Prefer FPDF_GetPageHeightF(). This will be deprecated in the future.
FPDF_GetPageHeight(request *requests.FPDF_GetPageHeight) (*responses.FPDF_GetPageHeight, error)
// FPDF_GetPageSizeByIndex returns the size of a page by the page index.
FPDF_GetPageSizeByIndex(request *requests.FPDF_GetPageSizeByIndex) (*responses.FPDF_GetPageSizeByIndex, error)
// FPDF_DocumentHasValidCrossReferenceTable returns whether the document's cross reference table is valid or not.
// Experimental API.
FPDF_DocumentHasValidCrossReferenceTable(request *requests.FPDF_DocumentHasValidCrossReferenceTable) (*responses.FPDF_DocumentHasValidCrossReferenceTable, error)
// FPDF_GetTrailerEnds returns the byte offsets of trailer ends.
// Experimental API.
FPDF_GetTrailerEnds(request *requests.FPDF_GetTrailerEnds) (*responses.FPDF_GetTrailerEnds, error)
// FPDF_GetPageWidthF returns the page width in float32.
// Experimental API.
FPDF_GetPageWidthF(request *requests.FPDF_GetPageWidthF) (*responses.FPDF_GetPageWidthF, error)
// FPDF_GetPageHeightF returns the page height in float32.
// Experimental API.
FPDF_GetPageHeightF(request *requests.FPDF_GetPageHeightF) (*responses.FPDF_GetPageHeightF, error)
// FPDF_GetPageBoundingBox returns the bounding box of the page. This is the intersection between
// its media box and its crop box.
// Experimental API.
FPDF_GetPageBoundingBox(request *requests.FPDF_GetPageBoundingBox) (*responses.FPDF_GetPageBoundingBox, error)
// FPDF_GetPageSizeByIndexF returns the size of the page at the given index.
// Prefer FPDF_GetPageSizeByIndexF(). This will be deprecated in the future.
// Experimental API.
FPDF_GetPageSizeByIndexF(request *requests.FPDF_GetPageSizeByIndexF) (*responses.FPDF_GetPageSizeByIndexF, error)
// FPDF_RenderPageBitmap renders contents of a page to a device independent bitmap.
FPDF_RenderPageBitmap(request *requests.FPDF_RenderPageBitmap) (*responses.FPDF_RenderPageBitmap, error)
// FPDF_RenderPageBitmapWithMatrix renders contents of a page to a device independent bitmap.
FPDF_RenderPageBitmapWithMatrix(request *requests.FPDF_RenderPageBitmapWithMatrix) (*responses.FPDF_RenderPageBitmapWithMatrix, error)
// FPDF_DeviceToPage converts the screen coordinates of a point to page coordinates.
// The page coordinate system has its origin at the left-bottom corner
// of the page, with the X-axis on the bottom going to the right, and
// the Y-axis on the left side going up.
//
// NOTE: this coordinate system can be altered when you zoom, scroll,
// or rotate a page, however, a point on the page should always have
// the same coordinate values in the page coordinate system.
//
// The device coordinate system is device dependent. For screen device,
// its origin is at the left-top corner of the window. However this
// origin can be altered by the Windows coordinate transformation
// utilities.
//
// You must make sure the start_x, start_y, size_x, size_y
// and rotate parameters have exactly same values as you used in
// the FPDF_RenderPage() function call.
FPDF_DeviceToPage(request *requests.FPDF_DeviceToPage) (*responses.FPDF_DeviceToPage, error)
// FPDF_PageToDevice converts the page coordinates of a point to screen coordinates.
// See comments for FPDF_DeviceToPage().
FPDF_PageToDevice(request *requests.FPDF_PageToDevice) (*responses.FPDF_PageToDevice, error)
// FPDFBitmap_Create Create a device independent bitmap (FXDIB).
FPDFBitmap_Create(request *requests.FPDFBitmap_Create) (*responses.FPDFBitmap_Create, error)
// FPDFBitmap_CreateEx Create a device independent bitmap (FXDIB) with an
// external buffer.
// Similar to FPDFBitmap_Create function, but allows for more formats
// and an external buffer is supported. The bitmap created by this
// function can be used in any place that a FPDF_BITMAP handle is
// required.
//
// If an external buffer is used, then the caller should destroy the
// buffer. FPDFBitmap_Destroy() will not destroy the buffer.
//
// It is recommended to use FPDFBitmap_GetStride() to get the stride
// value.
//
// Not supported on multi-threaded usage.
FPDFBitmap_CreateEx(request *requests.FPDFBitmap_CreateEx) (*responses.FPDFBitmap_CreateEx, error)
// FPDFBitmap_GetFormat returns the format of the bitmap.
// Only formats supported by FPDFBitmap_CreateEx are supported by this function.
FPDFBitmap_GetFormat(request *requests.FPDFBitmap_GetFormat) (*responses.FPDFBitmap_GetFormat, error)
// FPDFBitmap_FillRect fills a rectangle in a bitmap.
// This function sets the color and (optionally) alpha value in the
// specified region of the bitmap.
//
// NOTE: If the alpha channel is used, this function does NOT
// composite the background with the source color, instead the
// background will be replaced by the source color and the alpha.
//
// If the alpha channel is not used, the alpha parameter is ignored.
FPDFBitmap_FillRect(request *requests.FPDFBitmap_FillRect) (*responses.FPDFBitmap_FillRect, error)
// FPDFBitmap_GetBuffer returns the data buffer of a bitmap.
// The stride may be more than width * number of bytes per pixel
//
// Applications can use this function to get the bitmap buffer pointer,
// then manipulate any color and/or alpha values for any pixels in the
// bitmap.
//
// Use FPDFBitmap_GetFormat() to find out the format of the data.
FPDFBitmap_GetBuffer(request *requests.FPDFBitmap_GetBuffer) (*responses.FPDFBitmap_GetBuffer, error)
// FPDFBitmap_GetWidth returns the width of a bitmap.
FPDFBitmap_GetWidth(request *requests.FPDFBitmap_GetWidth) (*responses.FPDFBitmap_GetWidth, error)
// FPDFBitmap_GetHeight returns the height of a bitmap.
FPDFBitmap_GetHeight(request *requests.FPDFBitmap_GetHeight) (*responses.FPDFBitmap_GetHeight, error)
// FPDFBitmap_GetStride returns the number of bytes for each line in the bitmap buffer.
FPDFBitmap_GetStride(request *requests.FPDFBitmap_GetStride) (*responses.FPDFBitmap_GetStride, error)
// FPDFBitmap_Destroy destroys a bitmap and release all related buffers.
// This function will not destroy any external buffers provided when
// the bitmap was created.
FPDFBitmap_Destroy(request *requests.FPDFBitmap_Destroy) (*responses.FPDFBitmap_Destroy, error)
// FPDF_VIEWERREF_GetPrintScaling returns whether the PDF document prefers to be scaled or not.
FPDF_VIEWERREF_GetPrintScaling(request *requests.FPDF_VIEWERREF_GetPrintScaling) (*responses.FPDF_VIEWERREF_GetPrintScaling, error)
// FPDF_VIEWERREF_GetNumCopies returns the number of copies to be printed.
FPDF_VIEWERREF_GetNumCopies(request *requests.FPDF_VIEWERREF_GetNumCopies) (*responses.FPDF_VIEWERREF_GetNumCopies, error)
// FPDF_VIEWERREF_GetPrintPageRange returns the page numbers to initialize print dialog box when file is printed.
FPDF_VIEWERREF_GetPrintPageRange(request *requests.FPDF_VIEWERREF_GetPrintPageRange) (*responses.FPDF_VIEWERREF_GetPrintPageRange, error)
// FPDF_VIEWERREF_GetPrintPageRangeCount returns the number of elements in a FPDF_PAGERANGE.
// Experimental API.
FPDF_VIEWERREF_GetPrintPageRangeCount(request *requests.FPDF_VIEWERREF_GetPrintPageRangeCount) (*responses.FPDF_VIEWERREF_GetPrintPageRangeCount, error)
// FPDF_VIEWERREF_GetPrintPageRangeElement returns an element from a FPDF_PAGERANGE.
// Experimental API.
FPDF_VIEWERREF_GetPrintPageRangeElement(request *requests.FPDF_VIEWERREF_GetPrintPageRangeElement) (*responses.FPDF_VIEWERREF_GetPrintPageRangeElement, error)
// FPDF_VIEWERREF_GetDuplex returns the paper handling option to be used when printing from the print dialog.
FPDF_VIEWERREF_GetDuplex(request *requests.FPDF_VIEWERREF_GetDuplex) (*responses.FPDF_VIEWERREF_GetDuplex, error)
// FPDF_VIEWERREF_GetName returns the contents for a viewer ref, with a given key. The value must be of type "name".
FPDF_VIEWERREF_GetName(request *requests.FPDF_VIEWERREF_GetName) (*responses.FPDF_VIEWERREF_GetName, error)
// FPDF_CountNamedDests returns the count of named destinations in the PDF document.
FPDF_CountNamedDests(request *requests.FPDF_CountNamedDests) (*responses.FPDF_CountNamedDests, error)
// FPDF_GetNamedDestByName returns the destination handle for the given name.
FPDF_GetNamedDestByName(request *requests.FPDF_GetNamedDestByName) (*responses.FPDF_GetNamedDestByName, error)
// FPDF_GetNamedDest returns the named destination by index.
FPDF_GetNamedDest(request *requests.FPDF_GetNamedDest) (*responses.FPDF_GetNamedDest, error)
// FPDF_GetXFAPacketCount returns the number of valid packets in the XFA entry.
// Experimental API.
FPDF_GetXFAPacketCount(request *requests.FPDF_GetXFAPacketCount) (*responses.FPDF_GetXFAPacketCount, error)
// FPDF_GetXFAPacketName returns the name of a packet in the XFA array.
// Experimental API.
FPDF_GetXFAPacketName(request *requests.FPDF_GetXFAPacketName) (*responses.FPDF_GetXFAPacketName, error)
// FPDF_GetXFAPacketContent returns the content of a packet in the XFA array.
FPDF_GetXFAPacketContent(request *requests.FPDF_GetXFAPacketContent) (*responses.FPDF_GetXFAPacketContent, error)
// FPDF_SetPrintMode sets printing mode when printing on Windows.
// Experimental API.
// Windows only!
FPDF_SetPrintMode(request *requests.FPDF_SetPrintMode) (*responses.FPDF_SetPrintMode, error)
// FPDF_RenderPage renders contents of a page to a device (screen, bitmap, or printer).
// This feature does not work on multi-threaded usage as you will need to give a device handle.
// Windows only!
FPDF_RenderPage(request *requests.FPDF_RenderPage) (*responses.FPDF_RenderPage, error)
// End fpdfview.h
// Start fpdf_edit.h
// FPDF_CreateNewDocument returns a new document.
FPDF_CreateNewDocument(request *requests.FPDF_CreateNewDocument) (*responses.FPDF_CreateNewDocument, error)
// FPDFPage_New creates a new PDF page.
// The page should be closed with FPDF_ClosePage() when finished as
// with any other page in the document.
FPDFPage_New(request *requests.FPDFPage_New) (*responses.FPDFPage_New, error)
// FPDFPage_Delete deletes the page at the given index.
FPDFPage_Delete(request *requests.FPDFPage_Delete) (*responses.FPDFPage_Delete, error)
// FPDF_MovePages Move the given pages to a new index position.
// When this call fails, the document may be left in an indeterminate state.
// Experimental API.
FPDF_MovePages(request *requests.FPDF_MovePages) (*responses.FPDF_MovePages, error)
// FPDFPage_SetRotation sets the page rotation for a given page.
FPDFPage_SetRotation(request *requests.FPDFPage_SetRotation) (*responses.FPDFPage_SetRotation, error)
// FPDFPage_GetRotation returns the rotation of the given page.
FPDFPage_GetRotation(request *requests.FPDFPage_GetRotation) (*responses.FPDFPage_GetRotation, error)
// FPDFPage_InsertObject inserts the given object into a page.
FPDFPage_InsertObject(request *requests.FPDFPage_InsertObject) (*responses.FPDFPage_InsertObject, error)
// FPDFPage_RemoveObject removes an object from a page.
// Ownership is transferred to the caller. Call FPDFPageObj_Destroy() to free
// it.
// Experimental API.
FPDFPage_RemoveObject(request *requests.FPDFPage_RemoveObject) (*responses.FPDFPage_RemoveObject, error)
// FPDFPage_CountObjects returns the number of page objects inside the given page.
FPDFPage_CountObjects(request *requests.FPDFPage_CountObjects) (*responses.FPDFPage_CountObjects, error)
// FPDFPage_GetObject returns the object at the given index.
FPDFPage_GetObject(request *requests.FPDFPage_GetObject) (*responses.FPDFPage_GetObject, error)
// FPDFPage_HasTransparency returns whether a page has transparency.
FPDFPage_HasTransparency(request *requests.FPDFPage_HasTransparency) (*responses.FPDFPage_HasTransparency, error)
// FPDFPage_GenerateContent generates the contents of the page.
FPDFPage_GenerateContent(request *requests.FPDFPage_GenerateContent) (*responses.FPDFPage_GenerateContent, error)
// FPDFPageObj_Destroy destroys the page object by releasing its resources. The page object must have been
// created by FPDFPageObj_CreateNew{Path|Rect}() or
// FPDFPageObj_New{Text|Image}Obj(). This function must be called on
// newly-created objects if they are not added to a page through
// FPDFPage_InsertObject() or to an annotation through FPDFAnnot_AppendObject().
FPDFPageObj_Destroy(request *requests.FPDFPageObj_Destroy) (*responses.FPDFPageObj_Destroy, error)
// FPDFPageObj_HasTransparency returns whether the given page object contains transparency.
FPDFPageObj_HasTransparency(request *requests.FPDFPageObj_HasTransparency) (*responses.FPDFPageObj_HasTransparency, error)
// FPDFPageObj_GetType returns the type of the given page object.
FPDFPageObj_GetType(request *requests.FPDFPageObj_GetType) (*responses.FPDFPageObj_GetType, error)
// FPDFPageObj_Transform transforms the page object by the given matrix.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the page object.
FPDFPageObj_Transform(request *requests.FPDFPageObj_Transform) (*responses.FPDFPageObj_Transform, error)
// FPDFPageObj_TransformF transforms the page object by the given matrix.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the page object.
// Experimental API.
FPDFPageObj_TransformF(request *requests.FPDFPageObj_TransformF) (*responses.FPDFPageObj_TransformF, error)
// FPDFPageObj_GetMatrix returns the transform matrix of a page object.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the page object.
// Experimental API.
FPDFPageObj_GetMatrix(request *requests.FPDFPageObj_GetMatrix) (*responses.FPDFPageObj_GetMatrix, error)
// FPDFPageObj_SetMatrix sets the transform matrix on a page object.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the page object.
// Experimental API.
FPDFPageObj_SetMatrix(request *requests.FPDFPageObj_SetMatrix) (*responses.FPDFPageObj_SetMatrix, error)
// FPDFPage_TransformAnnots transforms all annotations in the given page.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the page annotations.
FPDFPage_TransformAnnots(request *requests.FPDFPage_TransformAnnots) (*responses.FPDFPage_TransformAnnots, error)
// FPDFPageObj_NewImageObj creates a new image object.
FPDFPageObj_NewImageObj(request *requests.FPDFPageObj_NewImageObj) (*responses.FPDFPageObj_NewImageObj, error)
// FPDFPageObj_GetMarkedContentID returns the marked content ID of a page object.
// Experimental API.
FPDFPageObj_GetMarkedContentID(request *requests.FPDFPageObj_GetMarkedContentID) (*responses.FPDFPageObj_GetMarkedContentID, error)
// FPDFPageObj_CountMarks returns the count of content marks in a page object.
// Experimental API.
FPDFPageObj_CountMarks(request *requests.FPDFPageObj_CountMarks) (*responses.FPDFPageObj_CountMarks, error)
// FPDFPageObj_GetMark returns the content mark of a page object at the given index.
// Experimental API.
FPDFPageObj_GetMark(request *requests.FPDFPageObj_GetMark) (*responses.FPDFPageObj_GetMark, error)
// FPDFPageObj_AddMark adds a new content mark to the given page object.
// Experimental API.
FPDFPageObj_AddMark(request *requests.FPDFPageObj_AddMark) (*responses.FPDFPageObj_AddMark, error)
// FPDFPageObj_RemoveMark removes the given content mark from the given page object.
// Experimental API.
FPDFPageObj_RemoveMark(request *requests.FPDFPageObj_RemoveMark) (*responses.FPDFPageObj_RemoveMark, error)
// FPDFPageObjMark_GetName returns the name of a content mark.
// Experimental API.
FPDFPageObjMark_GetName(request *requests.FPDFPageObjMark_GetName) (*responses.FPDFPageObjMark_GetName, error)
// FPDFPageObjMark_CountParams returns the number of key/value pair parameters in the given mark.
// Experimental API.
FPDFPageObjMark_CountParams(request *requests.FPDFPageObjMark_CountParams) (*responses.FPDFPageObjMark_CountParams, error)
// FPDFPageObjMark_GetParamKey returns the key of a property in a content mark.
// Experimental API.
FPDFPageObjMark_GetParamKey(request *requests.FPDFPageObjMark_GetParamKey) (*responses.FPDFPageObjMark_GetParamKey, error)
// FPDFPageObjMark_GetParamValueType returns the type of the value of a property in a content mark by key.
// Experimental API.
FPDFPageObjMark_GetParamValueType(request *requests.FPDFPageObjMark_GetParamValueType) (*responses.FPDFPageObjMark_GetParamValueType, error)
// FPDFPageObjMark_GetParamIntValue returns the value of a number property in a content mark by key as int.
// FPDFPageObjMark_GetParamValueType() should have returned FPDF_OBJECT_NUMBER
// for this property.
// Experimental API.
FPDFPageObjMark_GetParamIntValue(request *requests.FPDFPageObjMark_GetParamIntValue) (*responses.FPDFPageObjMark_GetParamIntValue, error)
// FPDFPageObjMark_GetParamStringValue returns the value of a string property in a content mark by key.
// Experimental API.
FPDFPageObjMark_GetParamStringValue(request *requests.FPDFPageObjMark_GetParamStringValue) (*responses.FPDFPageObjMark_GetParamStringValue, error)
// FPDFPageObjMark_GetParamBlobValue returns the value of a blob property in a content mark by key.
// Experimental API.
FPDFPageObjMark_GetParamBlobValue(request *requests.FPDFPageObjMark_GetParamBlobValue) (*responses.FPDFPageObjMark_GetParamBlobValue, error)
// FPDFPageObjMark_SetIntParam sets the value of an int property in a content mark by key. If a parameter
// with the given key exists, its value is set to the given value. Otherwise, it is added as
// a new parameter.
// Experimental API.
FPDFPageObjMark_SetIntParam(request *requests.FPDFPageObjMark_SetIntParam) (*responses.FPDFPageObjMark_SetIntParam, error)
// FPDFPageObjMark_SetStringParam sets the value of a string property in a content mark by key. If a parameter
// with the given key exists, its value is set to the given value. Otherwise, it is added as
// a new parameter.
// Experimental API.
FPDFPageObjMark_SetStringParam(request *requests.FPDFPageObjMark_SetStringParam) (*responses.FPDFPageObjMark_SetStringParam, error)
// FPDFPageObjMark_SetBlobParam sets the value of a blob property in a content mark by key. If a parameter
// with the given key exists, its value is set to the given value. Otherwise, it is added as
// a new parameter.
// Experimental API.
FPDFPageObjMark_SetBlobParam(request *requests.FPDFPageObjMark_SetBlobParam) (*responses.FPDFPageObjMark_SetBlobParam, error)
// FPDFPageObjMark_RemoveParam removes a property from a content mark by key.
// Experimental API.
FPDFPageObjMark_RemoveParam(request *requests.FPDFPageObjMark_RemoveParam) (*responses.FPDFPageObjMark_RemoveParam, error)
// FPDFImageObj_LoadJpegFile loads an image from a JPEG image file and then set it into the given image object.
// The image object might already have an associated image, which is shared and
// cached by the loaded pages. In that case, we need to clear the cached image
// for all the loaded pages. Pass the pages and page count to this API
// to clear the image cache. If the image is not previously shared, nil is a
// valid pages value.
FPDFImageObj_LoadJpegFile(request *requests.FPDFImageObj_LoadJpegFile) (*responses.FPDFImageObj_LoadJpegFile, error)
// FPDFImageObj_LoadJpegFileInline
// The image object might already have an associated image, which is shared and
// cached by the loaded pages. In that case, we need to clear the cached image
// for all the loaded pages. Pass the pages and page count to this API
// to clear the image cache. If the image is not previously shared, nil is a
// valid pages value. This function loads the JPEG image inline, so the image
// content is copied to the file. This allows the file access and its associated
// data to be deleted after this function returns.
FPDFImageObj_LoadJpegFileInline(request *requests.FPDFImageObj_LoadJpegFileInline) (*responses.FPDFImageObj_LoadJpegFileInline, error)
// FPDFImageObj_SetMatrix sets the transform matrix of the given image object.
// The matrix is composed as:
// |a c e|
// |b d f|
// and can be used to scale, rotate, shear and translate the image object.
// Will be deprecated once FPDFPageObj_SetMatrix() is stable.
FPDFImageObj_SetMatrix(request *requests.FPDFImageObj_SetMatrix) (*responses.FPDFImageObj_SetMatrix, error)
// FPDFImageObj_SetBitmap sets the given bitmap to the given image object.
FPDFImageObj_SetBitmap(request *requests.FPDFImageObj_SetBitmap) (*responses.FPDFImageObj_SetBitmap, error)
// FPDFImageObj_GetBitmap returns a bitmap rasterization of the given image object. FPDFImageObj_GetBitmap() only
// operates on the image object and does not take the associated image mask into
// account. It also ignores the matrix for the image object.
// The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
// must be called on the returned bitmap when it is no longer needed.
FPDFImageObj_GetBitmap(request *requests.FPDFImageObj_GetBitmap) (*responses.FPDFImageObj_GetBitmap, error)
// FPDFImageObj_GetRenderedBitmap returns a bitmap rasterization of the given image object that takes the image mask and
// image matrix into account. To render correctly, the caller must provide the
// document associated with the image object. If there is a page associated
// with the image object the caller should provide that as well.
// The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
// must be called on the returned bitmap when it is no longer needed.
// Experimental API.
FPDFImageObj_GetRenderedBitmap(request *requests.FPDFImageObj_GetRenderedBitmap) (*responses.FPDFImageObj_GetRenderedBitmap, error)
// FPDFImageObj_GetImageDataDecoded returns the decoded image data of the image object. The decoded data is the
// uncompressed image data, i.e. the raw image data after having all filters
// applied.
FPDFImageObj_GetImageDataDecoded(request *requests.FPDFImageObj_GetImageDataDecoded) (*responses.FPDFImageObj_GetImageDataDecoded, error)
// FPDFImageObj_GetImageDataRaw returns the raw image data of the image object. The raw data is the image data as
// stored in the PDF without applying any filters.
FPDFImageObj_GetImageDataRaw(request *requests.FPDFImageObj_GetImageDataRaw) (*responses.FPDFImageObj_GetImageDataRaw, error)
// FPDFImageObj_GetImageFilterCount returns the number of filters (i.e. decoders) of the image in image object.
FPDFImageObj_GetImageFilterCount(request *requests.FPDFImageObj_GetImageFilterCount) (*responses.FPDFImageObj_GetImageFilterCount, error)
// FPDFImageObj_GetImageFilter returns the filter at index of the image object's list of filters. Note that the
// filters need to be applied in order, i.e. the first filter should be applied
// first, then the second, etc.
FPDFImageObj_GetImageFilter(request *requests.FPDFImageObj_GetImageFilter) (*responses.FPDFImageObj_GetImageFilter, error)
// FPDFImageObj_GetImageMetadata returns the image metadata of the image object, including dimension, DPI, bits per
// pixel, and colorspace. If the image object is not an image object or if it
// does not have an image, then the return value will be false. Otherwise,
// failure to retrieve any specific parameter would result in its value being 0.
FPDFImageObj_GetImageMetadata(request *requests.FPDFImageObj_GetImageMetadata) (*responses.FPDFImageObj_GetImageMetadata, error)
// FPDFImageObj_GetImagePixelSize get the image size in pixels. Faster method to get only image size.
// Experimental API.
FPDFImageObj_GetImagePixelSize(request *requests.FPDFImageObj_GetImagePixelSize) (*responses.FPDFImageObj_GetImagePixelSize, error)
// FPDFPageObj_CreateNewPath creates a new path object at an initial position.
FPDFPageObj_CreateNewPath(request *requests.FPDFPageObj_CreateNewPath) (*responses.FPDFPageObj_CreateNewPath, error)
// FPDFPageObj_CreateNewRect creates a closed path consisting of a rectangle.
FPDFPageObj_CreateNewRect(request *requests.FPDFPageObj_CreateNewRect) (*responses.FPDFPageObj_CreateNewRect, error)
// FPDFPageObj_GetBounds returns the bounding box of the given page object.
FPDFPageObj_GetBounds(request *requests.FPDFPageObj_GetBounds) (*responses.FPDFPageObj_GetBounds, error)
// FPDFPageObj_SetBlendMode sets the blend mode of the page object.
FPDFPageObj_SetBlendMode(request *requests.FPDFPageObj_SetBlendMode) (*responses.FPDFPageObj_SetBlendMode, error)
// FPDFPageObj_SetStrokeColor sets the stroke RGBA of a page object.
FPDFPageObj_SetStrokeColor(request *requests.FPDFPageObj_SetStrokeColor) (*responses.FPDFPageObj_SetStrokeColor, error)
// FPDFPageObj_GetStrokeColor returns the stroke RGBA of a page object
FPDFPageObj_GetStrokeColor(request *requests.FPDFPageObj_GetStrokeColor) (*responses.FPDFPageObj_GetStrokeColor, error)
// FPDFPageObj_SetStrokeWidth sets the stroke width of a page object
FPDFPageObj_SetStrokeWidth(request *requests.FPDFPageObj_SetStrokeWidth) (*responses.FPDFPageObj_SetStrokeWidth, error)
// FPDFPageObj_GetStrokeWidth returns the stroke width of a page object.
FPDFPageObj_GetStrokeWidth(request *requests.FPDFPageObj_GetStrokeWidth) (*responses.FPDFPageObj_GetStrokeWidth, error)
// FPDFPageObj_GetLineJoin returns the line join of the page object.
FPDFPageObj_GetLineJoin(request *requests.FPDFPageObj_GetLineJoin) (*responses.FPDFPageObj_GetLineJoin, error)
// FPDFPageObj_SetLineJoin sets the line join of the page object.
FPDFPageObj_SetLineJoin(request *requests.FPDFPageObj_SetLineJoin) (*responses.FPDFPageObj_SetLineJoin, error)
// FPDFPageObj_GetLineCap returns the line cap of the page object.
FPDFPageObj_GetLineCap(request *requests.FPDFPageObj_GetLineCap) (*responses.FPDFPageObj_GetLineCap, error)
// FPDFPageObj_SetLineCap sets the line cap of the page object.
FPDFPageObj_SetLineCap(request *requests.FPDFPageObj_SetLineCap) (*responses.FPDFPageObj_SetLineCap, error)
// FPDFPageObj_SetFillColor sets the fill RGBA of a page object
FPDFPageObj_SetFillColor(request *requests.FPDFPageObj_SetFillColor) (*responses.FPDFPageObj_SetFillColor, error)
// FPDFPageObj_GetFillColor returns the fill RGBA of a page object
FPDFPageObj_GetFillColor(request *requests.FPDFPageObj_GetFillColor) (*responses.FPDFPageObj_GetFillColor, error)
// FPDFPageObj_GetRotatedBounds Get the quad points that bounds the page object.
// Similar to FPDFPageObj_GetBounds(), this returns the bounds of a page
// object. When the object is rotated by a non-multiple of 90 degrees, this API
// returns a tighter bound that cannot be represented with just the 4 sides of
// a rectangle.
//
// Currently only works the following page object types: FPDF_PAGEOBJ_TEXT and
// FPDF_PAGEOBJ_IMAGE.
// Experimental API.
FPDFPageObj_GetRotatedBounds(request *requests.FPDFPageObj_GetRotatedBounds) (*responses.FPDFPageObj_GetRotatedBounds, error)
// FPDFPageObj_GetDashPhase returns the line dash phase of the page object.
// Experimental API.
FPDFPageObj_GetDashPhase(request *requests.FPDFPageObj_GetDashPhase) (*responses.FPDFPageObj_GetDashPhase, error)
// FPDFPageObj_SetDashPhase sets the line dash phase of the page object.
// Experimental API.
FPDFPageObj_SetDashPhase(request *requests.FPDFPageObj_SetDashPhase) (*responses.FPDFPageObj_SetDashPhase, error)
// FPDFPageObj_GetDashCount returns the line dash array size of the page object.
// Experimental API.
FPDFPageObj_GetDashCount(request *requests.FPDFPageObj_GetDashCount) (*responses.FPDFPageObj_GetDashCount, error)
// FPDFPageObj_GetDashArray returns the line dash array of the page object.
// Experimental API.
FPDFPageObj_GetDashArray(request *requests.FPDFPageObj_GetDashArray) (*responses.FPDFPageObj_GetDashArray, error)
// FPDFPageObj_SetDashArray sets the line dash array of the page object.
// Experimental API.
FPDFPageObj_SetDashArray(request *requests.FPDFPageObj_SetDashArray) (*responses.FPDFPageObj_SetDashArray, error)
// FPDFPath_CountSegments returns the number of segments inside the given path.
// A segment is a command, created by e.g. FPDFPath_MoveTo(),
// FPDFPath_LineTo() or FPDFPath_BezierTo().
FPDFPath_CountSegments(request *requests.FPDFPath_CountSegments) (*responses.FPDFPath_CountSegments, error)
// FPDFPath_GetPathSegment returns the segment in the given path at the given index.
FPDFPath_GetPathSegment(request *requests.FPDFPath_GetPathSegment) (*responses.FPDFPath_GetPathSegment, error)
// FPDFPathSegment_GetPoint returns the coordinates of the given segment.
FPDFPathSegment_GetPoint(request *requests.FPDFPathSegment_GetPoint) (*responses.FPDFPathSegment_GetPoint, error)
// FPDFPathSegment_GetType returns the type of the given segment.
FPDFPathSegment_GetType(request *requests.FPDFPathSegment_GetType) (*responses.FPDFPathSegment_GetType, error)
// FPDFPathSegment_GetClose returns whether the segment closes the current subpath of a given path.
FPDFPathSegment_GetClose(request *requests.FPDFPathSegment_GetClose) (*responses.FPDFPathSegment_GetClose, error)
// FPDFPath_MoveTo moves a path's current point.
// Note that no line will be created between the previous current point and the
// new one.
FPDFPath_MoveTo(request *requests.FPDFPath_MoveTo) (*responses.FPDFPath_MoveTo, error)
// FPDFPath_LineTo adds a line between the current point and a new point in the path.
FPDFPath_LineTo(request *requests.FPDFPath_LineTo) (*responses.FPDFPath_LineTo, error)
// FPDFPath_BezierTo adds a cubic Bezier curve to the given path, starting at the current point.
FPDFPath_BezierTo(request *requests.FPDFPath_BezierTo) (*responses.FPDFPath_BezierTo, error)
// FPDFPath_Close closes the current subpath of a given path.
FPDFPath_Close(request *requests.FPDFPath_Close) (*responses.FPDFPath_Close, error)
// FPDFPath_SetDrawMode sets the drawing mode of a path.
FPDFPath_SetDrawMode(request *requests.FPDFPath_SetDrawMode) (*responses.FPDFPath_SetDrawMode, error)
// FPDFPath_GetDrawMode returns the drawing mode of a path.
FPDFPath_GetDrawMode(request *requests.FPDFPath_GetDrawMode) (*responses.FPDFPath_GetDrawMode, error)
// FPDFPageObj_NewTextObj creates a new text object using one of the standard PDF fonts.
FPDFPageObj_NewTextObj(request *requests.FPDFPageObj_NewTextObj) (*responses.FPDFPageObj_NewTextObj, error)
// FPDFText_SetText sets the text for a text object. If it had text, it will be replaced.
FPDFText_SetText(request *requests.FPDFText_SetText) (*responses.FPDFText_SetText, error)
// FPDFText_SetCharcodes sets the text using charcodes for a text object. If it had text, it will be
// replaced.
FPDFText_SetCharcodes(request *requests.FPDFText_SetCharcodes) (*responses.FPDFText_SetCharcodes, error)
// FPDFText_LoadFont returns a font object loaded from a stream of data. The font is loaded
// into the document. Various font data structures, such as the ToUnicode data, are auto-generated based
// on the inputs
// The loaded font can be closed using FPDFFont_Close().
FPDFText_LoadFont(request *requests.FPDFText_LoadFont) (*responses.FPDFText_LoadFont, error)
// FPDFText_LoadStandardFont loads one of the standard 14 fonts per PDF spec 1.7 page 416. The preferred
// way of using font style is using a dash to separate the name from the style,
// for example 'Helvetica-BoldItalic'.
// The loaded font can be closed using FPDFFont_Close().
// Experimental API.
FPDFText_LoadStandardFont(request *requests.FPDFText_LoadStandardFont) (*responses.FPDFText_LoadStandardFont, error)
// FPDFText_LoadCidType2Font returns a font object loaded from a stream of data for a type 2 CID font.
// The font is loaded into the document. Unlike FPDFText_LoadFont(), the ToUnicode data and the CIDToGIDMap
// data are caller provided, instead of auto-generated.
// The loaded font can be closed using FPDFFont_Close().
// Experimental API.
FPDFText_LoadCidType2Font(request *requests.FPDFText_LoadCidType2Font) (*responses.FPDFText_LoadCidType2Font, error)
// FPDFTextObj_GetFontSize returns the font size of a text object.
FPDFTextObj_GetFontSize(request *requests.FPDFTextObj_GetFontSize) (*responses.FPDFTextObj_GetFontSize, error)
// FPDFFont_Close closes a loaded PDF font
FPDFFont_Close(request *requests.FPDFFont_Close) (*responses.FPDFFont_Close, error)
// FPDFPageObj_CreateTextObj creates a new text object using a loaded font.
FPDFPageObj_CreateTextObj(request *requests.FPDFPageObj_CreateTextObj) (*responses.FPDFPageObj_CreateTextObj, error)
// FPDFTextObj_GetTextRenderMode returns the text rendering mode of a text object.
FPDFTextObj_GetTextRenderMode(request *requests.FPDFTextObj_GetTextRenderMode) (*responses.FPDFTextObj_GetTextRenderMode, error)
// FPDFTextObj_SetTextRenderMode sets the text rendering mode of a text object.
// Experimental API.
FPDFTextObj_SetTextRenderMode(request *requests.FPDFTextObj_SetTextRenderMode) (*responses.FPDFTextObj_SetTextRenderMode, error)
// FPDFTextObj_GetText returns the text of a text object.
FPDFTextObj_GetText(request *requests.FPDFTextObj_GetText) (*responses.FPDFTextObj_GetText, error)
// FPDFTextObj_GetRenderedBitmap returns a bitmap rasterization of the given text object.
// To render correctly, the caller must provide the document associated with the text object.
// If there is a page associated with text object, the caller should provide that as well.
// The returned bitmap will be owned by the caller, and FPDFBitmap_Destroy()
// must be called on the returned bitmap when it is no longer needed.
// Experimental API.
FPDFTextObj_GetRenderedBitmap(request *requests.FPDFTextObj_GetRenderedBitmap) (*responses.FPDFTextObj_GetRenderedBitmap, error)
// FPDFTextObj_GetFont returns the font of a text object.
// Experimental API.
FPDFTextObj_GetFont(request *requests.FPDFTextObj_GetFont) (*responses.FPDFTextObj_GetFont, error)
// FPDFFont_GetBaseFontName returns the base font name of a font.
// Experimental API.
FPDFFont_GetBaseFontName(request *requests.FPDFFont_GetBaseFontName) (*responses.FPDFFont_GetBaseFontName, error)
// FPDFFont_GetFamilyName returns the family name of a font.
// Experimental API.
FPDFFont_GetFamilyName(request *requests.FPDFFont_GetFamilyName) (*responses.FPDFFont_GetFamilyName, error)
// FPDFFont_GetFontData returns the decoded data from the given font.
// Experimental API.
FPDFFont_GetFontData(request *requests.FPDFFont_GetFontData) (*responses.FPDFFont_GetFontData, error)
// FPDFFont_GetIsEmbedded returns whether the given font is embedded or not.
// Experimental API.
FPDFFont_GetIsEmbedded(request *requests.FPDFFont_GetIsEmbedded) (*responses.FPDFFont_GetIsEmbedded, error)
// FPDFFont_GetFlags returns the descriptor flags of a font.
// Returns the bit flags specifying various characteristics of the font as
// defined in ISO 32000-1:2008, table 123.
// Experimental API.
FPDFFont_GetFlags(request *requests.FPDFFont_GetFlags) (*responses.FPDFFont_GetFlags, error)
// FPDFFont_GetWeight returns the font weight of a font.
// Typical values are 400 (normal) and 700 (bold).
// Experimental API.
FPDFFont_GetWeight(request *requests.FPDFFont_GetWeight) (*responses.FPDFFont_GetWeight, error)
// FPDFFont_GetItalicAngle returns the italic angle of a font.
// The italic angle of a font is defined as degrees counterclockwise
// from vertical. For a font that slopes to the right, this will be negative.
// Experimental API.
FPDFFont_GetItalicAngle(request *requests.FPDFFont_GetItalicAngle) (*responses.FPDFFont_GetItalicAngle, error)
// FPDFFont_GetAscent returns ascent distance of a font.
// Ascent is the maximum distance in points above the baseline reached by the
// glyphs of the font. One point is 1/72 inch (around 0.3528 mm).
// Experimental API.
FPDFFont_GetAscent(request *requests.FPDFFont_GetAscent) (*responses.FPDFFont_GetAscent, error)
// FPDFFont_GetDescent returns the descent distance of a font.
// Descent is the maximum distance in points below the baseline reached by the
// glyphs of the font. One point is 1/72 inch (around 0.3528 mm).
// Experimental API.
FPDFFont_GetDescent(request *requests.FPDFFont_GetDescent) (*responses.FPDFFont_GetDescent, error)
// FPDFFont_GetGlyphWidth returns the width of a glyph in a font.
// Glyph width is the distance from the end of the prior glyph to the next
// glyph. This will be the vertical distance for vertical writing.
// Experimental API.
FPDFFont_GetGlyphWidth(request *requests.FPDFFont_GetGlyphWidth) (*responses.FPDFFont_GetGlyphWidth, error)
// FPDFFont_GetGlyphPath returns the glyphpath describing how to draw a font glyph.
// Experimental API.
FPDFFont_GetGlyphPath(request *requests.FPDFFont_GetGlyphPath) (*responses.FPDFFont_GetGlyphPath, error)
// FPDFGlyphPath_CountGlyphSegments returns the number of segments inside the given glyphpath.
// Experimental API.
FPDFGlyphPath_CountGlyphSegments(request *requests.FPDFGlyphPath_CountGlyphSegments) (*responses.FPDFGlyphPath_CountGlyphSegments, error)
// FPDFGlyphPath_GetGlyphPathSegment returns the segment in glyphpath at the given index.
// Experimental API.
FPDFGlyphPath_GetGlyphPathSegment(request *requests.FPDFGlyphPath_GetGlyphPathSegment) (*responses.FPDFGlyphPath_GetGlyphPathSegment, error)
// FPDFFormObj_CountObjects returns the number of page objects inside the given form object.
FPDFFormObj_CountObjects(request *requests.FPDFFormObj_CountObjects) (*responses.FPDFFormObj_CountObjects, error)
// FPDFFormObj_GetObject returns the page object in the given form object at the given index.
FPDFFormObj_GetObject(request *requests.FPDFFormObj_GetObject) (*responses.FPDFFormObj_GetObject, error)
// End fpdf_edit.h
// Start fpdf_ppo.h
// FPDF_ImportPages imports some pages from one PDF document to another one.
FPDF_ImportPages(request *requests.FPDF_ImportPages) (*responses.FPDF_ImportPages, error)
// FPDF_CopyViewerPreferences copies the viewer preferences from one PDF document to another
FPDF_CopyViewerPreferences(request *requests.FPDF_CopyViewerPreferences) (*responses.FPDF_CopyViewerPreferences, error)
// FPDF_ImportPagesByIndex imports pages to a FPDF_DOCUMENT.
// Experimental API.
FPDF_ImportPagesByIndex(request *requests.FPDF_ImportPagesByIndex) (*responses.FPDF_ImportPagesByIndex, error)
// FPDF_ImportNPagesToOne creates a new document from source document. The pages of source document will be
// combined to provide NumPagesOnXAxis x NumPagesOnYAxis pages per page of the output document.
// Experimental API.
FPDF_ImportNPagesToOne(request *requests.FPDF_ImportNPagesToOne) (*responses.FPDF_ImportNPagesToOne, error)
// FPDF_NewXObjectFromPage creates a template to generate form xobjects from the source document's page at
// the given index, for use in the destination document.
// Experimental API.
FPDF_NewXObjectFromPage(request *requests.FPDF_NewXObjectFromPage) (*responses.FPDF_NewXObjectFromPage, error)
// FPDF_CloseXObject closes an FPDF_XOBJECT handle created by FPDF_NewXObjectFromPage().
// Experimental API.
FPDF_CloseXObject(request *requests.FPDF_CloseXObject) (*responses.FPDF_CloseXObject, error)
// FPDF_NewFormObjectFromXObject creates a new form object from an FPDF_XOBJECT object.
// Experimental API.
FPDF_NewFormObjectFromXObject(request *requests.FPDF_NewFormObjectFromXObject) (*responses.FPDF_NewFormObjectFromXObject, error)
// End fpdf_ppo.h
// Start fpdf_flatten.h
// FPDFPage_Flatten makes annotations and form fields become part of the page contents itself
FPDFPage_Flatten(request *requests.FPDFPage_Flatten) (*responses.FPDFPage_Flatten, error)
// End fpdf_flatten.h
// Start fpdf_ext.h
// FPDFDoc_GetPageMode returns the document's page mode, which describes how the references should be displayed when opened.
FPDFDoc_GetPageMode(request *requests.FPDFDoc_GetPageMode) (*responses.FPDFDoc_GetPageMode, error)
// FSDK_SetUnSpObjProcessHandler set ups an unsupported object handler.
// Since callbacks can't be transferred between processes in gRPC, you can only use this in single-threaded mode.
FSDK_SetUnSpObjProcessHandler(request *requests.FSDK_SetUnSpObjProcessHandler) (*responses.FSDK_SetUnSpObjProcessHandler, error)
// FSDK_SetTimeFunction sets a replacement function for calls to time().
// This API is intended to be used only for testing, thus may cause PDFium to behave poorly in production environments.
// Since callbacks can't be transferred between processes in gRPC, you can only use this in single-threaded mode.
FSDK_SetTimeFunction(request *requests.FSDK_SetTimeFunction) (*responses.FSDK_SetTimeFunction, error)
// FSDK_SetLocaltimeFunction sets a replacement function for calls to localtime().
// This API is intended to be used only for testing, thus may cause PDFium to behave poorly in production environments.
// Since callbacks can't be transferred between processes in gRPC, you can only use this in single-threaded mode.
FSDK_SetLocaltimeFunction(request *requests.FSDK_SetLocaltimeFunction) (*responses.FSDK_SetLocaltimeFunction, error)
// End fpdf_ext.h
// Start fpdf_doc.h
// FPDFBookmark_GetFirstChild returns the first child of a bookmark item, or the first top level bookmark item.
// Note that another name for the bookmarks is the document outline, as
// described in ISO 32000-1:2008, section 12.3.3.
FPDFBookmark_GetFirstChild(request *requests.FPDFBookmark_GetFirstChild) (*responses.FPDFBookmark_GetFirstChild, error)
// FPDFBookmark_GetNextSibling returns the next bookmark item at the same level.
// Note that the caller is responsible for handling circular bookmark
// references, as may arise from malformed documents.
FPDFBookmark_GetNextSibling(request *requests.FPDFBookmark_GetNextSibling) (*responses.FPDFBookmark_GetNextSibling, error)
// FPDFBookmark_GetTitle returns the title of a bookmark.
FPDFBookmark_GetTitle(request *requests.FPDFBookmark_GetTitle) (*responses.FPDFBookmark_GetTitle, error)
// FPDFBookmark_GetCount returns the number of children of a bookmark.
// Experimental API.
FPDFBookmark_GetCount(request *requests.FPDFBookmark_GetCount) (*responses.FPDFBookmark_GetCount, error)
// FPDFBookmark_Find finds a bookmark in the document, using the bookmark title.
FPDFBookmark_Find(request *requests.FPDFBookmark_Find) (*responses.FPDFBookmark_Find, error)
// FPDFBookmark_GetDest returns the destination associated with a bookmark item.
// If the returned destination is nil, none is associated to the bookmark item.
FPDFBookmark_GetDest(request *requests.FPDFBookmark_GetDest) (*responses.FPDFBookmark_GetDest, error)
// FPDFBookmark_GetAction returns the action associated with a bookmark item.
// If this function returns a valid handle, it is valid as long as the bookmark is
// valid.
// If the returned action is nil, you should try FPDFBookmark_GetDest.
FPDFBookmark_GetAction(request *requests.FPDFBookmark_GetAction) (*responses.FPDFBookmark_GetAction, error)
// FPDFAction_GetType returns the action associated with a bookmark item.
FPDFAction_GetType(request *requests.FPDFAction_GetType) (*responses.FPDFAction_GetType, error)
// FPDFAction_GetDest returns the destination of a specific go-to or remote-goto action.
// Only action with type PDF_ACTION_ACTION_GOTO and PDF_ACTION_ACTION_REMOTEGOTO can have destination data.
// In case of remote goto action, the application should first use function FPDFAction_GetFilePath to get file path, then load that particular document, and use its document handle to call this function.
FPDFAction_GetDest(request *requests.FPDFAction_GetDest) (*responses.FPDFAction_GetDest, error)
// FPDFAction_GetFilePath returns the file path from a remote goto or launch action.
// Only works on actions that have the type FPDF_ACTION_ACTION_REMOTEGOTO or FPDF_ACTION_ACTION_LAUNCH.
FPDFAction_GetFilePath(request *requests.FPDFAction_GetFilePath) (*responses.FPDFAction_GetFilePath, error)
// FPDFAction_GetURIPath returns the URI path from a URI action.
FPDFAction_GetURIPath(request *requests.FPDFAction_GetURIPath) (*responses.FPDFAction_GetURIPath, error)
// FPDFDest_GetDestPageIndex returns the page index from destination data.
FPDFDest_GetDestPageIndex(request *requests.FPDFDest_GetDestPageIndex) (*responses.FPDFDest_GetDestPageIndex, error)
// FPDF_GetFileIdentifier Get the file identifier defined in the trailer of a document.
// Experimental API.
FPDF_GetFileIdentifier(request *requests.FPDF_GetFileIdentifier) (*responses.FPDF_GetFileIdentifier, error)
// FPDF_GetMetaText returns the requested metadata.
FPDF_GetMetaText(request *requests.FPDF_GetMetaText) (*responses.FPDF_GetMetaText, error)
// FPDF_GetPageLabel returns the label for the given page.
FPDF_GetPageLabel(request *requests.FPDF_GetPageLabel) (*responses.FPDF_GetPageLabel, error)
// FPDFDest_GetView returns the view (fit type) for a given dest.
// Experimental API.
FPDFDest_GetView(request *requests.FPDFDest_GetView) (*responses.FPDFDest_GetView, error)
// FPDFDest_GetLocationInPage returns the (x, y, zoom) location of dest in the destination page, if the
// destination is in [page /XYZ x y zoom] syntax.
FPDFDest_GetLocationInPage(request *requests.FPDFDest_GetLocationInPage) (*responses.FPDFDest_GetLocationInPage, error)
// FPDFLink_GetLinkAtPoint finds a link at a point on a page.
// You can convert coordinates from screen coordinates to page coordinates using
// FPDF_DeviceToPage().
FPDFLink_GetLinkAtPoint(request *requests.FPDFLink_GetLinkAtPoint) (*responses.FPDFLink_GetLinkAtPoint, error)
// FPDFLink_GetLinkZOrderAtPoint finds the Z-order of link at a point on a page.
// You can convert coordinates from screen coordinates to page coordinates using
// FPDF_DeviceToPage().
FPDFLink_GetLinkZOrderAtPoint(request *requests.FPDFLink_GetLinkZOrderAtPoint) (*responses.FPDFLink_GetLinkZOrderAtPoint, error)
// FPDFLink_GetDest returns the destination info for a link.
FPDFLink_GetDest(request *requests.FPDFLink_GetDest) (*responses.FPDFLink_GetDest, error)
// FPDFLink_GetAction returns the action info for a link
// If this function returns a valid handle, it is valid as long as the link is
// valid.