-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlibpycpdf.c
1658 lines (1219 loc) · 37.3 KB
/
libpycpdf.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cpdflibwrapper.h"
/* CHAPTER 0. Preliminaries */
int pycpdf_startup(char **argv) {
// char *argv[] = {"program_name", NULL};
cpdf_startup(argv);
return 0;
}
char* pycpdf_version() {
return cpdf_version();
}
void pycpdf_setFast() {
return cpdf_setFast();
}
void pycpdf_setSlow() {
return cpdf_setSlow();
}
void pycpdf_embedStd14(int embed) {
return cpdf_embedStd14(embed);
}
void pycpdf_embedStd14Dir(char* d) {
return cpdf_embedStd14Dir(d);
}
void pycpdf_JSONUTF8(int utf8) {
return cpdf_JSONUTF8(utf8);
}
int pycpdf_lastError(void) {
return cpdf_lastError;
}
char *pycpdf_lastErrorString(void) {
// printf("cpdf_lastErrorString is %s\n", cpdf_lastErrorString);
return cpdf_lastErrorString;
}
void pycpdf_clearError(void) {
cpdf_clearError();
cpdf_lastError = 0;
cpdf_lastErrorString = "";
// printf("after clearerror, cpdf_lastErrorString is %s\n",
// cpdf_lastErrorString);
return;
}
void pycpdf_onExit() {
return cpdf_onExit();
}
/* CHAPTER 1. Basics */
int pycpdf_fromFile(char *filename, char *userpw) {
return cpdf_fromFile(filename, userpw);
}
int pycpdf_fromFileLazy(char *filename, char *userpw) {
return cpdf_fromFileLazy(filename, userpw);
}
int pycpdf_fromMemory(void *data, int len, char *userpw) {
return cpdf_fromMemory(data, len, userpw);
}
int pycpdf_fromMemoryLazy(void *data, int len, char *userpw) {
return cpdf_fromMemoryLazy(data, len, userpw);
}
void pycpdf_deletePdf(int pdf) {
return cpdf_deletePdf(pdf);
}
void pycpdf_replacePdf(int pdf, int pdf2) {
return cpdf_replacePdf(pdf, pdf2);
}
double pycpdf_ptOfCm(double i) {
return cpdf_ptOfCm(i);
}
double pycpdf_ptOfMm(double i) {
return cpdf_ptOfMm(i);
}
double pycpdf_ptOfIn(double i) {
return cpdf_ptOfIn(i);
}
double pycpdf_cmOfPt(double i) {
return cpdf_cmOfPt(i);
}
double pycpdf_mmOfPt(double i) {
return cpdf_mmOfPt(i);
}
double pycpdf_inOfPt(double i) {
return cpdf_inOfPt(i);
}
void pycpdf_startEnumeratePDFs() {
return cpdf_startEnumeratePDFs();
}
int pycpdf_enumeratePDFsKey(int n) {
return cpdf_enumeratePDFsKey(n);
}
char* pycpdf_enumeratePDFsInfo(int n) {
return cpdf_enumeratePDFsInfo(n);
}
void pycpdf_endEnumeratePDFs() {
return cpdf_endEnumeratePDFs();
}
int pycpdf_parsePagespec(int pdf, char *pagespec) {
return cpdf_parsePagespec(pdf, pagespec);
}
int pycpdf_validatePagespec(char *pagespec) {
return cpdf_validatePagespec(pagespec);
}
char* pycpdf_stringOfPagespec(int pdf, int range) {
return cpdf_stringOfPagespec(pdf, range);
}
int pycpdf_blankRange() {
return cpdf_blankRange();
}
void pycpdf_deleteRange(int r) {
return cpdf_deleteRange(r);
}
int pycpdf_pageRange(int f, int t) { return cpdf_range(f, t); }
int pycpdf_all(int r) {
return cpdf_all(r);
}
int pycpdf_even(int r) {
return cpdf_even(r);
}
int pycpdf_odd(int r) {
return cpdf_odd(r);
}
int pycpdf_rangeUnion(int a, int b) {
return cpdf_rangeUnion(a, b);
}
int pycpdf_difference(int a, int b) {
return cpdf_difference(a, b);
}
int pycpdf_removeDuplicates(int r) {
return cpdf_removeDuplicates(r);
}
int pycpdf_rangeLength(int r) {
return cpdf_rangeLength(r);
}
int pycpdf_rangeGet(int r, int n) {
return cpdf_rangeGet(r, n);
}
int pycpdf_rangeAdd(int r, int p) {
return cpdf_rangeAdd(r, p);
}
int pycpdf_isInRange(int r, int p) {
return cpdf_isInRange(r, p);
}
int pycpdf_pages(int pdf) {
return cpdf_pages(pdf);
}
int pycpdf_pagesFast(char *filename, char *userpw) {
return cpdf_pagesFast(filename, userpw);
}
void pycpdf_toFile(int pdf, char *filename, int linearize, int make_id) {
return cpdf_toFile(pdf, filename, linearize, make_id);
}
void pycpdf_toFileExt(int pdf, char *filename, int linearize, int make_id, int preserve_objstm, int generate_objstm, int compress_objstm) {
return cpdf_toFileExt(pdf, filename, linearize, make_id, preserve_objstm, generate_objstm, compress_objstm);
}
// We want to return a piece of memory which will be copied into a python
// string, and the C string deallocated.
void *toMemoryData;
void *pycpdf_toMemory(int pdf, int linearize, int make_id, int *length) {
toMemoryData = cpdf_toMemory(pdf, linearize, make_id, length);
return toMemoryData;
}
void pycpdf_toMemoryFree(void) {
free(toMemoryData);
return;
}
int pycpdf_isEncrypted(int pdf) {
return cpdf_isEncrypted(pdf);
}
void pycpdf_toFileEncrypted(int pdf, int method, int *permissions, int permlength, char *ownerpw, char *userpw, int linearize, int makeid, char *filename) {
return cpdf_toFileEncrypted(pdf, method, permissions, permlength, ownerpw, userpw, linearize, makeid, filename);
}
void pycpdf_toFileEncryptedExt(int pdf, int method, int *permissions, int permlength, char *ownerpw, char *userpw, int linearize, int makeid, int preserve_objstm, int generate_objstm, int compress_objstm, char *filename) {
return cpdf_toFileEncryptedExt(pdf, method, permissions, permlength, ownerpw, userpw, linearize, makeid, preserve_objstm, generate_objstm, compress_objstm, filename);
}
void pycpdf_decryptPdf(int pdf, char *userpw) {
return cpdf_decryptPdf(pdf, userpw);
}
void pycpdf_decryptPdfOwner(int pdf, char *ownerpw) {
return cpdf_decryptPdfOwner(pdf, ownerpw);
}
int pycpdf_hasPermission(int pdf, int perm) {
return cpdf_hasPermission(pdf, perm);
}
int pycpdf_encryptionKind(int pdf) {
return cpdf_encryptionKind(pdf);
}
void pycpdf_loadFont(char* name, char* filename) {
return cpdf_loadFont(name, filename);
}
/* CHAPTER 2. Merging and Splitting */
int pycpdf_mergeSimple(int *pdfs, int len) {
return cpdf_mergeSimple(pdfs, len);
}
int pycpdf_merge(int *pdfs, int len, int retain_numbering, int remove_duplicate_fonts) {
return cpdf_merge(pdfs, len, retain_numbering, remove_duplicate_fonts);
}
int pycpdf_mergeSame(int *pdfs, int len, int retain_numbering, int remove_duplicate_fonts, int *ranges) {
return cpdf_mergeSame(pdfs, len, retain_numbering, remove_duplicate_fonts, ranges);
}
int pycpdf_selectPages(int pdf, int r) {
return cpdf_selectPages(pdf, r);
}
/* CHAPTER 3. Pages */
void pycpdf_scalePages(int pdf, int r, double sx, double sy) {
return cpdf_scalePages(pdf, r, sx, sy);
}
void pycpdf_scaleToFit(int pdf, int r, double sx, double sy, double scale_to_fit_scale) {
return cpdf_scaleToFit(pdf, r, sx, sy, scale_to_fit_scale);
}
void pycpdf_scaleToFitPaper(int pdf, int r, int papersize, double scale_to_fit_scale) {
return cpdf_scaleToFitPaper(pdf, r, papersize, scale_to_fit_scale);
}
void pycpdf_scaleContents(int pdf, int r, int pos, double p1, double p2, double scale) {
struct cpdf_position p = {
.cpdf_anchor = pos, .cpdf_coord1 = p1, .cpdf_coord2 = p2};
cpdf_scaleContents(pdf, r, p, scale);
}
void pycpdf_shiftContents(int pdf, int r, double dx, double dy) {
return cpdf_shiftContents(pdf, r, dx, dy);
}
void pycpdf_shiftBoxes(int pdf, int r, double dx, double dy) {
return cpdf_shiftBoxes(pdf, r, dx, dy);
}
void pycpdf_rotate(int pdf, int r, int rotation) {
return cpdf_rotate(pdf, r, rotation);
}
void pycpdf_rotateBy(int pdf, int r, int rotation) {
return cpdf_rotateBy(pdf, r, rotation);
}
void pycpdf_rotateContents(int pdf, int r, double rotation) {
return cpdf_rotateContents(pdf, r, rotation);
}
void pycpdf_upright(int pdf, int r) {
return cpdf_upright(pdf, r);
}
void pycpdf_hFlip(int pdf, int r) {
return cpdf_hFlip(pdf, r);
}
void pycpdf_vFlip(int pdf, int r) {
return cpdf_vFlip(pdf, r);
}
void pycpdf_crop(int pdf, int r, double x, double y, double w, double h) {
return cpdf_crop(pdf, r, x, y, w, h);
}
void pycpdf_removeCrop(int pdf, int r) {
return cpdf_removeCrop(pdf, r);
}
void pycpdf_removeTrim(int pdf, int r) {
return cpdf_removeTrim(pdf, r);
}
void pycpdf_removeArt(int pdf, int r) {
return cpdf_removeArt(pdf, r);
}
void pycpdf_removeBleed(int pdf, int r) {
return cpdf_removeBleed(pdf, r);
}
void pycpdf_trimMarks(int pdf, int r) {
return cpdf_trimMarks(pdf, r);
}
void pycpdf_showBoxes(int pdf, int r) {
return cpdf_showBoxes(pdf, r);
}
void pycpdf_hardBox(int pdf, int r, char *boxname) {
return cpdf_hardBox(pdf, r, boxname);
}
/* CHAPTER 4. Encryption */
/* Encryption covered under Chapter 1 in cpdflib. */
/* CHAPTER 5. Compression */
void pycpdf_compress(int pdf) {
return cpdf_compress(pdf);
}
void pycpdf_decompress(int pdf) {
return cpdf_decompress(pdf);
}
void pycpdf_squeezeInMemory(int pdf) {
return cpdf_squeezeInMemory(pdf);
}
/* CHAPTER 6. Bookmarks */
void pycpdf_startGetBookmarkInfo(int pdf) {
return cpdf_startGetBookmarkInfo(pdf);
}
int pycpdf_numberBookmarks() {
return cpdf_numberBookmarks();
}
int pycpdf_getBookmarkLevel(int n) {
return cpdf_getBookmarkLevel(n);
}
int pycpdf_getBookmarkPage(int pdf, int page) {
return cpdf_getBookmarkPage(pdf, page);
}
char* pycpdf_getBookmarkText(int n) {
return cpdf_getBookmarkText(n);
}
int pycpdf_getBookmarkOpenStatus(int n) {
return cpdf_getBookmarkOpenStatus(n);
}
void pycpdf_endGetBookmarkInfo() {
return cpdf_endGetBookmarkInfo();
}
void pycpdf_startSetBookmarkInfo(int n) {
return cpdf_startSetBookmarkInfo(n);
}
void pycpdf_setBookmarkLevel(int n, int level) {
return cpdf_setBookmarkLevel(n, level);
}
void pycpdf_setBookmarkPage(int pdf, int n, int targetpage) {
return cpdf_setBookmarkPage(pdf, n, targetpage);
}
void pycpdf_setBookmarkOpenStatus(int n, int status) {
return cpdf_setBookmarkOpenStatus(n, status);
}
void pycpdf_setBookmarkText(int n, char *text) {
return cpdf_setBookmarkText(n, text);
}
void pycpdf_endSetBookmarkInfo(int pdf) {
return cpdf_endSetBookmarkInfo(pdf);
}
void *getBookmarksJSONData;
void *pycpdf_getBookmarksJSON(int pdf, int *length) {
getBookmarksJSONData = cpdf_getBookmarksJSON(pdf, length);
return getBookmarksJSONData;
}
void pycpdf_getBookmarksJSONFree(void) {
free(getBookmarksJSONData);
return;
}
void pycpdf_setBookmarksJSON(int pdf, void* data, int length) {
return cpdf_setBookmarksJSON(pdf, data, length);
}
void pycpdf_tableOfContents(int pdf, char* font, double fontsize, char* title, int bookmark) {
return cpdf_tableOfContents(pdf, font, fontsize, title, bookmark);
}
/* CHAPTER 7. Presentations */
/* Not included in the library version */
/* CHAPTER 8. Logos, Watermarks and Stamps */
void pycpdf_stampOn(int pdf, int pdf2, int r) {
return cpdf_stampOn(pdf, pdf2, r);
}
void pycpdf_stampUnder(int pdf, int pdf2, int r) {
return cpdf_stampUnder(pdf, pdf2, r);
}
void pycpdf_stampExtended(int pdf, int pdf2, int r, int isover,
int scale_stamp_to_fit, int pos, int c1, int c2,
int relative_to_cropbox) {
struct cpdf_position position = {
.cpdf_anchor = pos, .cpdf_coord1 = c1, .cpdf_coord2 = c2};
cpdf_stampExtended(pdf, pdf2, r, isover, scale_stamp_to_fit, position,
relative_to_cropbox);
return;
}
void pycpdf_combinePages(int pdf, int pdf2) {
return cpdf_combinePages(pdf, pdf2);
}
void pycpdf_addText(int metrics, int pdf, int r, char *text, int pos, double p1,
double p2, double line_spacing, int bates, char* font,
double size, double red, double green, double blue,
int underneath, int relative_to_cropbox, int outline,
double opacity, int justification, int midline, int topline,
char *filename, double line_width, int embed_fonts) {
struct cpdf_position position = {
.cpdf_anchor = pos, .cpdf_coord1 = p1, .cpdf_coord2 = p2};
cpdf_addText(metrics, pdf, r, text, position, line_spacing, bates, font, size,
red, green, blue, underneath, relative_to_cropbox, outline,
opacity, justification, midline, topline, filename, line_width,
embed_fonts);
return;
}
void pycpdf_addTextSimple(int pdf, int r, char *text, int pos, double p1,
double p2, char* font, double size) {
struct cpdf_position position = {
.cpdf_anchor = pos, .cpdf_coord1 = p1, .cpdf_coord2 = p2};
cpdf_addTextSimple(pdf, r, text, position, font, size);
return;
}
void pycpdf_removeText(int pdf, int r) {
return cpdf_removeText(pdf, r);
}
int pycpdf_textWidth(char* font, char* string) {
return cpdf_textWidth(font, string);
}
void pycpdf_addContent(char* content, int before, int pdf, int r) {
return cpdf_addContent(content, before, pdf, r);
}
char* pycpdf_stampAsXObject(int pdf, int r, int stamp_pdf) {
return cpdf_stampAsXObject(pdf, r, stamp_pdf);
}
/* CHAPTER 9. Multipage facilities */
void pycpdf_impose(int pdf, double x, double y, int fit, int columns, int rtl, int btt, int center, double margin, double spacing, double linewidth) {
return cpdf_impose(pdf, x, y, fit, columns, rtl, btt, center, margin, spacing, linewidth);
}
void pycpdf_chop(int pdf, int range, int x, int y, int columns, int rtl, int btt) {
return cpdf_chop(pdf, range, x, y, columns, rtl, btt);
}
void pycpdf_chopH(int pdf, int range, int columns, double y) {
return cpdf_chopH(pdf, range, columns, y);
}
void pycpdf_chopV(int pdf, int range, int columns, double x) {
return cpdf_chopV(pdf, range, columns, x);
}
void pycpdf_twoUp(int pdf) {
return cpdf_twoUp(pdf);
}
void pycpdf_twoUpStack(int pdf) {
return cpdf_twoUpStack(pdf);
}
void pycpdf_padBefore(int pdf, int r) {
return cpdf_padBefore(pdf, r);
}
void pycpdf_padAfter(int pdf, int r) {
return cpdf_padAfter(pdf, r);
}
void pycpdf_padEvery(int pdf, int r) {
return cpdf_padEvery(pdf, r);
}
void pycpdf_padMultiple(int pdf, int n) {
return cpdf_padMultiple(pdf, n);
}
void pycpdf_padMultipleBefore(int pdf, int n) {
return cpdf_padMultipleBefore(pdf, n);
}
/* CHAPTER 10. Annotations */
void *annotationsJSONData;
void *pycpdf_annotationsJSON(int pdf, int *length) {
annotationsJSONData = cpdf_annotationsJSON(pdf, length);
return annotationsJSONData;
}
void pycpdf_annotationsJSONFree(void) {
free(annotationsJSONData);
return;
}
void pycpdf_removeAnnotations(int pdf, int range) {
return cpdf_removeAnnotations(pdf, range);
}
void pycpdf_setAnnotationsJSON(int pdf, void* data, int length) {
return cpdf_setAnnotationsJSON(pdf, data, length);
}
/* CHAPTER 11. Document Information and Metadata */
int pycpdf_isLinearized(char *filename) {
return cpdf_isLinearized(filename);
}
int pycpdf_hasObjectStreams(int pdf) {
return cpdf_hasObjectStreams(pdf);
}
char* pycpdf_id1(int pdf) {
return cpdf_id1(pdf);
}
char* pycpdf_id2(int pdf) {
return cpdf_id2(pdf);
}
int pycpdf_hasAcroForm(int pdf) {
return cpdf_hasAcroForm(pdf);
}
int pycpdf_startGetSubformats(int pdf) {
return cpdf_startGetSubformats(pdf);
}
char* pycpdf_getSubformat(int s) {
return cpdf_getSubformat(s);
}
void pycpdf_endGetSubformats() {
return cpdf_endGetSubformats();
}
int pycpdf_getVersion(int pdf) {
return cpdf_getVersion(pdf);
}
int pycpdf_getMajorVersion(int pdf) {
return cpdf_getMajorVersion(pdf);
}
char* pycpdf_getTitle(int pdf) {
return cpdf_getTitle(pdf);
}
char* pycpdf_getAuthor(int pdf) {
return cpdf_getAuthor(pdf);
}
char* pycpdf_getSubject(int pdf) {
return cpdf_getSubject(pdf);
}
char* pycpdf_getKeywords(int pdf) {
return cpdf_getKeywords(pdf);
}
char* pycpdf_getCreator(int pdf) {
return cpdf_getCreator(pdf);
}
char* pycpdf_getProducer(int pdf) {
return cpdf_getProducer(pdf);
}
char* pycpdf_getCreationDate(int pdf) {
return cpdf_getCreationDate(pdf);
}
char* pycpdf_getModificationDate(int pdf) {
return cpdf_getModificationDate(pdf);
}
char* pycpdf_getTitleXMP(int pdf) {
return cpdf_getTitleXMP(pdf);
}
char* pycpdf_getAuthorXMP(int pdf) {
return cpdf_getAuthorXMP(pdf);
}
char* pycpdf_getSubjectXMP(int pdf) {
return cpdf_getSubjectXMP(pdf);
}
char* pycpdf_getKeywordsXMP(int pdf) {
return cpdf_getKeywordsXMP(pdf);
}
char* pycpdf_getCreatorXMP(int pdf) {
return cpdf_getCreatorXMP(pdf);
}
char* pycpdf_getProducerXMP(int pdf) {
return cpdf_getProducerXMP(pdf);
}
char* pycpdf_getCreationDateXMP(int pdf) {
return cpdf_getCreationDateXMP(pdf);
}
char* pycpdf_getModificationDateXMP(int pdf) {
return cpdf_getModificationDateXMP(pdf);
}
void pycpdf_setTitle(int pdf, char *s) {
return cpdf_setTitle(pdf, s);
}
void pycpdf_setAuthor(int pdf, char *s) {
return cpdf_setAuthor(pdf, s);
}
void pycpdf_setSubject(int pdf, char *s) {
return cpdf_setSubject(pdf, s);
}
void pycpdf_setKeywords(int pdf, char *s) {
return cpdf_setKeywords(pdf, s);
}
void pycpdf_setCreator(int pdf, char *s) {
return cpdf_setCreator(pdf, s);
}
void pycpdf_setProducer(int pdf, char *s) {
return cpdf_setProducer(pdf, s);
}
void pycpdf_setCreationDate(int pdf, char *s) {
return cpdf_setCreationDate(pdf, s);
}
void pycpdf_setModificationDate(int pdf, char *s) {
return cpdf_setModificationDate(pdf, s);
}
void pycpdf_setTitleXMP(int pdf, char *s) {
return cpdf_setTitleXMP(pdf, s);
}
void pycpdf_setAuthorXMP(int pdf, char *s) {
return cpdf_setAuthorXMP(pdf, s);
}
void pycpdf_setSubjectXMP(int pdf, char *s) {
return cpdf_setSubjectXMP(pdf, s);
}
void pycpdf_setKeywordsXMP(int pdf, char *s) {
return cpdf_setKeywordsXMP(pdf, s);
}
void pycpdf_setCreatorXMP(int pdf, char *s) {
return cpdf_setCreatorXMP(pdf, s);
}
void pycpdf_setProducerXMP(int pdf, char *s) {
return cpdf_setProducerXMP(pdf, s);
}
void pycpdf_setCreationDateXMP(int pdf, char *s) {
return cpdf_setCreationDateXMP(pdf, s);
}
void pycpdf_setModificationDateXMP(int pdf, char *s) {
return cpdf_setModificationDateXMP(pdf, s);
}
void pycpdf_getDateComponents(char *str, int *year, int *month, int *day, int *hour, int *minute, int *second, int *hour_offset, int *minute_offset) {
return cpdf_getDateComponents(str, year, month, day, hour, minute, second, hour_offset, minute_offset);
}
char* pycpdf_dateStringOfComponents(int year, int month, int day, int hour, int minute, int second, int hour_offset, int minute_offset) {
return cpdf_dateStringOfComponents(year, month, day, hour, minute, second, hour_offset, minute_offset);
}
int pycpdf_getPageRotation(int pdf, int pagenumber) {
return cpdf_getPageRotation(pdf, pagenumber);
}
int pycpdf_hasBox(int pdf, int pagenumber, char *box) {
return cpdf_hasBox(pdf, pagenumber, box);
}
int pycpdf_numAnnots(int pdf, int pagenumber) {
return cpdf_numAnnots(pdf, pagenumber);
}
void pycpdf_getMediaBox(int pdf, int pagenumber, double *minx, double *maxx, double *miny, double *maxy) {
return cpdf_getMediaBox(pdf, pagenumber, minx, maxx, miny, maxy);
}
void pycpdf_getCropBox(int pdf, int pagenumber, double *minx, double *maxx, double *miny, double *maxy) {
return cpdf_getCropBox(pdf, pagenumber, minx, maxx, miny, maxy);
}
void pycpdf_getTrimBox(int pdf, int pagenumber, double *minx, double *maxx, double *miny, double *maxy) {
return cpdf_getTrimBox(pdf, pagenumber, minx, maxx, miny, maxy);
}
void pycpdf_getArtBox(int pdf, int pagenumber, double *minx, double *maxx, double *miny, double *maxy) {
return cpdf_getArtBox(pdf, pagenumber, minx, maxx, miny, maxy);
}
void pycpdf_getBleedBox(int pdf, int pagenumber, double *minx, double *maxx, double *miny, double *maxy) {
return cpdf_getBleedBox(pdf, pagenumber, minx, maxx, miny, maxy);
}
void pycpdf_setMediaBox(int pdf, int range, double minx, double maxx,
double miny, double maxy) {
cpdf_setMediabox(pdf, range, minx, maxx, miny, maxy);
return;
}
void pycpdf_setCropBox(int pdf, int range, double minx, double maxx, double miny, double maxy) {
return cpdf_setCropBox(pdf, range, minx, maxx, miny, maxy);
}
void pycpdf_setTrimBox(int pdf, int range, double minx, double maxx, double miny, double maxy) {
return cpdf_setTrimBox(pdf, range, minx, maxx, miny, maxy);
}
void pycpdf_setArtBox(int pdf, int range, double minx, double maxx, double miny, double maxy) {
return cpdf_setArtBox(pdf, range, minx, maxx, miny, maxy);
}
void pycpdf_setBleedBox(int pdf, int range, double minx, double maxx, double miny, double maxy) {
return cpdf_setBleedBox(pdf, range, minx, maxx, miny, maxy);
}
void *pageInfoJSONData;
void *pycpdf_pageInfoJSON(int pdf, int *length) {
pageInfoJSONData = cpdf_pageInfoJSON(pdf, length);
return pageInfoJSONData;
}
void pycpdf_pageInfoJSONFree(void) {
free(pageInfoJSONData);
return;
}
void pycpdf_markTrapped(int pdf) {
return cpdf_markTrapped(pdf);
}
void pycpdf_markUntrapped(int pdf) {
return cpdf_markUntrapped(pdf);
}
void pycpdf_markTrappedXMP(int pdf) {
return cpdf_markTrappedXMP(pdf);
}
void pycpdf_markUntrappedXMP(int pdf) {
return cpdf_markUntrappedXMP(pdf);
}
void pycpdf_setPageLayout(int pdf, int layout) {
return cpdf_setPageLayout(pdf, layout);
}
int pycpdf_getPageLayout(int pdf) {
return cpdf_getPageLayout(pdf);
}
void pycpdf_setPageMode(int pdf, int mode) {
return cpdf_setPageMode(pdf, mode);
}
int pycpdf_getPageMode(int pdf) {
return cpdf_getPageMode(pdf);
}
void pycpdf_hideToolbar(int pdf, int flag) {
return cpdf_hideToolbar(pdf, flag);
}
int pycpdf_getHideToolbar(int pdf) {
return cpdf_getHideToolbar(pdf);
}
void pycpdf_hideMenubar(int pdf, int flag) {
return cpdf_hideMenubar(pdf, flag);
}
int pycpdf_getHideMenubar(int pdf) {
return cpdf_getHideMenubar(pdf);
}
void pycpdf_hideWindowUi(int pdf, int flag) {
return cpdf_hideWindowUi(pdf, flag);
}
int pycpdf_getHideWindowUi(int pdf) {
return cpdf_getHideWindowUi(pdf);
}
void pycpdf_fitWindow(int pdf, int flag) {
return cpdf_fitWindow(pdf, flag);
}
int pycpdf_getFitWindow(int pdf) {
return cpdf_getFitWindow(pdf);
}
void pycpdf_centerWindow(int pdf, int flag) {
return cpdf_centerWindow(pdf, flag);
}
int pycpdf_getCenterWindow(int pdf) {
return cpdf_getCenterWindow(pdf);
}
void pycpdf_displayDocTitle(int pdf, int flag) {
return cpdf_displayDocTitle(pdf, flag);
}
int pycpdf_getDisplayDocTitle(int pdf) {
return cpdf_getDisplayDocTitle(pdf);
}
void pycpdf_nonFullScreenPageMode(int pdf, int flag) {
return cpdf_nonFullScreenPageMode(pdf, flag);
}
int pycpdf_getNonFullScreenPageMode(int pdf) {
return cpdf_getNonFullScreenPageMode(pdf);
}
void pycpdf_openAtPage(int pdf, int flag, int pagenumber) {
return cpdf_openAtPage(pdf, flag, pagenumber);
}
void pycpdf_openAtPageCustom(int pdf, char* custom) {
return cpdf_openAtPageCustom(pdf, custom);
}
void pycpdf_setMetadataFromFile(int pdf, char* filename) {
return cpdf_setMetadataFromFile(pdf, filename);
}
void pycpdf_setMetadataFromByteArray(int pdf, void* data, int len) {
return cpdf_setMetadataFromByteArray(pdf, data, len);
}
void *getMetadataData;
void *pycpdf_getMetadata(int pdf, int *length) {
getMetadataData = cpdf_getMetadata(pdf, length);
return getMetadataData;
}
void pycpdf_getMetadataFree(void) {
free(getMetadataData);
return;
}
void pycpdf_removeMetadata(int pdf) {
return cpdf_removeMetadata(pdf);
}
void pycpdf_createMetadata(int pdf) {
return cpdf_createMetadata(pdf);
}
void pycpdf_setMetadataDate(int pdf, char* date) {
return cpdf_setMetadataDate(pdf, date);
}
int pycpdf_startGetPageLabels(int pdf) {
return cpdf_startGetPageLabels(pdf);
}
int pycpdf_getPageLabelStyle(int n) {
return cpdf_getPageLabelStyle(n);
}
char* pycpdf_getPageLabelPrefix(int n) {
return cpdf_getPageLabelPrefix(n);
}
int pycpdf_getPageLabelOffset(int n) {
return cpdf_getPageLabelOffset(n);
}
int pycpdf_getPageLabelRange(int n) {
return cpdf_getPageLabelRange(n);
}
void pycpdf_endGetPageLabels() {
return cpdf_endGetPageLabels();
}
void pycpdf_addPageLabels(int pdf, int style, char *prefix, int offset, int range, int progress) {
return cpdf_addPageLabels(pdf, style, prefix, offset, range, progress);
}
void pycpdf_removePageLabels(int pdf) {
return cpdf_removePageLabels(pdf);