1 29 30 package com.caucho.quercus.lib.pdf; 31 32 import com.caucho.quercus.QuercusModuleException; 33 import com.caucho.quercus.annotation.NotNull; 34 import com.caucho.quercus.annotation.Optional; 35 import com.caucho.quercus.env.BooleanValue; 36 import com.caucho.quercus.env.Env; 37 import com.caucho.quercus.env.Value; 38 import com.caucho.quercus.module.AbstractQuercusModule; 39 import com.caucho.util.L10N; 40 import com.caucho.vfs.Path; 41 42 import java.io.IOException ; 43 import java.util.logging.Logger ; 44 45 48 public class PDFModule extends AbstractQuercusModule { 49 private static final L10N L = new L10N(PDFModule.class); 50 51 private static final Logger log = 52 Logger.getLogger(PDFModule.class.getName()); 53 54 57 public String []getLoadedExtensions() 58 { 59 return new String [] { "pdf" }; 60 } 61 62 65 public static boolean pdf_activate_item(Env env, 66 @NotNull PDF pdf, 67 int id) 68 { 69 env.stub("pdf_activate_item"); 70 71 return false; 72 } 73 74 77 public static boolean pdf_add_annotation(Env env, 78 @NotNull PDF pdf) 79 { 80 env.stub("pdf_add_annotation"); 81 82 return false; 83 } 84 85 88 public static boolean pdf_add_bookmark(Env env, 89 @NotNull PDF pdf) 90 { 91 env.stub("pdf_add_bookmark"); 92 93 return false; 94 } 95 96 99 public static boolean pdf_add_launchlink(Env env, 100 @NotNull PDF pdf, 101 double llx, 102 double lly, 103 double urx, 104 double ury, 105 String filename) 106 { 107 env.stub("pdf_add_launchlink"); 108 109 return false; 110 } 111 112 115 public static boolean pdf_add_locallink(Env env, 116 @NotNull PDF pdf, 117 double llx, 118 double lly, 119 double urx, 120 double ury, 121 int page, 122 String dest) 123 { 124 env.stub("pdf_add_locallink"); 125 126 return false; 127 } 128 129 132 public static boolean pdf_add_nameddest(Env env, 133 @NotNull PDF pdf, 134 String name, 135 @Optional String optlist) 136 { 137 env.stub("pdf_add_nameddest"); 138 139 return false; 140 } 141 142 145 public static boolean pdf_add_note(Env env, 146 @NotNull PDF pdf, 147 double llx, 148 double lly, 149 double urx, 150 double ury, 151 String contents, 152 String title, 153 String icon, 154 int open) 155 { 156 env.stub("pdf_add_note"); 157 158 return false; 159 } 160 161 164 public static boolean pdf_add_outline(Env env, 165 @NotNull PDF pdf, 166 String name, 167 @Optional String optlist) 168 { 169 env.stub("pdf_add_outline"); 170 171 return false; 172 } 173 174 177 public static boolean pdf_add_pdflink(Env env, 178 @NotNull PDF pdf, 179 double llx, 180 double lly, 181 double urx, 182 double ury, 183 String filename, 184 int page, 185 String dest) 186 { 187 env.stub("pdf_add_pdflink"); 188 189 return false; 190 } 191 192 195 public static boolean pdf_add_thumbnail(Env env, 196 @NotNull PDF pdf, 197 @NotNull PDFImage image) 198 { 199 env.stub("pdf_add_thumbnail"); 200 201 return false; 202 } 203 204 207 public static boolean pdf_add_weblink(Env env, 208 @NotNull PDF pdf, 209 double llx, 210 double lly, 211 double urx, 212 double ury, 213 String url) 214 { 215 env.stub("pdf_add_weblink"); 216 217 return false; 218 } 219 220 223 public static boolean pdf_arc(@NotNull PDF pdf, 224 double x1, double y1, 225 double r, double a, double b) 226 { 227 if (pdf == null) 228 return false; 229 230 return pdf.arc(x1, y1, r, a, b); 231 } 232 233 236 public static boolean pdf_arcn(@NotNull PDF pdf, 237 double x1, double y1, 238 double r, double a, double b) 239 { 240 if (pdf == null) 241 return false; 242 243 return pdf.arcn(x1, y1, r, a, b); 244 } 245 246 249 public static boolean pdf_attach_file(Env env, 250 @NotNull PDF pdf, 251 double llx, 252 double lly, 253 double urx, 254 double ury, 255 String filename, 256 String description, 257 String author, 258 String mimetype, 259 String icon) 260 { 261 env.stub("pdf_attach_file"); 262 263 return false; 264 } 265 266 269 public static boolean pdf_begin_document(@NotNull PDF pdf, 270 @Optional String fileName, 271 @Optional String optList) 272 { 273 try { 274 if (pdf == null) 275 return false; 276 277 return pdf.begin_document(fileName, optList); 278 } catch (IOException e) { 279 throw new QuercusModuleException(e); 280 } 281 } 282 283 286 public static boolean pdf_begin_font(Env env, 287 @NotNull PDF pdf, 288 String fileName, 289 double a, 290 double b, 291 double c, 292 double d, 293 double e, 294 double f, 295 @Optional String optList) 296 { 297 env.stub("pdf_begin_font"); 298 299 return false; 300 } 301 302 305 public static boolean pdf_begin_glyph(Env env, 306 @NotNull PDF pdf, 307 String glyphname, 308 double wx, 309 double llx, 310 double lly, 311 double urx, 312 double ury) 313 { 314 env.stub("pdf_begin_glyph"); 315 316 return false; 317 } 318 319 322 public static boolean pdf_begin_item(Env env, 323 @NotNull PDF pdf, 324 String tag, 325 String optlist) 326 { 327 env.stub("pdf_begin_item"); 328 329 return false; 330 } 331 332 335 public static boolean pdf_begin_layer(Env env, 336 @NotNull PDF pdf, 337 int layer) 338 { 339 env.stub("pdf_begin_layer"); 340 341 return false; 342 } 343 344 347 public static boolean pdf_begin_page_ext(@NotNull PDF pdf, 348 double w, double h, 349 @Optional String optlist) 350 { 351 try { 352 if (pdf == null) 353 return false; 354 355 return pdf.begin_page_ext(w, h, optlist); 356 } catch (IOException e) { 357 throw new QuercusModuleException(e); 358 } 359 } 360 361 364 public static boolean pdf_begin_page(@NotNull PDF pdf, 365 double w, double h) 366 { 367 try { 368 if (pdf == null) 369 return false; 370 371 return pdf.begin_page(w, h); 372 } catch (IOException e) { 373 throw new QuercusModuleException(e); 374 } 375 } 376 377 380 public static boolean pdf_begin_pattern(Env env, 381 @NotNull PDF pdf, 382 double w, 383 double h, 384 double xStep, 385 double yStep, 386 int paintType) 387 { 388 env.stub("pdf_begin_pattern"); 389 390 return false; 391 } 392 393 396 public static boolean pdf_begin_template(Env env, 397 @NotNull PDF pdf, 398 double w, 399 double h) 400 { 401 env.stub("pdf_begin_template"); 402 403 return false; 404 } 405 406 409 public static boolean pdf_circle(@NotNull PDF pdf, 410 double x, 411 double y, 412 double r) 413 { 414 if (pdf == null) 415 return false; 416 417 return pdf.circle(x, y, r); 418 } 419 420 423 public static boolean pdf_clip(@NotNull PDF pdf) 424 { 425 if (pdf == null) 426 return false; 427 428 return pdf.clip(); 429 } 430 431 434 public static boolean pdf_close_image(Env env, 435 @NotNull PDF pdf, 436 PDFImage image) 437 { 438 env.stub("pdf_close_image"); 439 440 return false; 441 } 442 443 446 public static boolean pdf_close_pdi_page(Env env, 447 @NotNull PDF pdf, 448 int page) 449 { 450 env.stub("pdf_close_pdi_page"); 451 452 return false; 453 } 454 455 458 public static boolean pdf_close_pdi(Env env, 459 @NotNull PDF pdf, 460 int doc) 461 { 462 env.stub("pdf_close_pdi"); 463 464 return false; 465 } 466 467 470 public static boolean pdf_close(@NotNull PDF pdf) 471 { 472 try { 473 if (pdf == null) 474 return false; 475 476 return pdf.close(); 477 } catch (IOException e) { 478 throw new QuercusModuleException(e); 479 } 480 } 481 482 485 public static boolean pdf_closepath_fill_stroke(@NotNull PDF pdf) 486 { 487 if (pdf == null) 488 return false; 489 490 return pdf.closepath_fill_stroke(); 491 } 492 493 496 public static boolean pdf_closepath_stroke(@NotNull PDF pdf) 497 { 498 if (pdf == null) 499 return false; 500 501 return pdf.closepath_stroke(); 502 } 503 504 507 public static boolean pdf_closepath(@NotNull PDF pdf) 508 { 509 if (pdf == null) 510 return false; 511 512 return pdf.closepath(); 513 } 514 515 518 public static boolean pdf_concat(@NotNull PDF pdf, 519 double a, 520 double b, 521 double c, 522 double d, 523 double e, 524 double f) 525 { 526 if (pdf == null) 527 return false; 528 529 return pdf.concat(a, b,c, d, e, f); 530 } 531 532 535 public static boolean pdf_continue_text(@NotNull PDF pdf, 536 String text) 537 { 538 if (pdf == null) 539 return false; 540 541 return pdf.continue_text(text); 542 } 543 544 547 public static boolean pdf_create_action(Env env, 548 @NotNull PDF pdf, 549 String type, 550 @Optional String optList) 551 { 552 env.stub("pdf_create_action"); 553 554 return false; 555 } 556 557 560 public static boolean pdf_create_annotation(Env env, 561 @NotNull PDF pdf, 562 double llx, 563 double lly, 564 double urx, 565 double ury, 566 String type, 567 @Optional String optList) 568 { 569 env.stub("pdf_create_annotation"); 570 571 return false; 572 } 573 574 577 public static boolean pdf_create_bookmark(Env env, 578 @NotNull PDF pdf, 579 String text, 580 @Optional String optList) 581 { 582 env.stub("pdf_create_bookmark"); 583 584 return false; 585 } 586 587 590 public static boolean pdf_create_field(Env env, 591 @NotNull PDF pdf, 592 double llx, 593 double lly, 594 double urx, 595 double ury, 596 String name, 597 String type, 598 @Optional String optList) 599 { 600 env.stub("pdf_create_field"); 601 602 return false; 603 } 604 605 608 public static boolean pdf_create_fieldgroup(Env env, 609 @NotNull PDF pdf, 610 String name, 611 @Optional String optList) 612 { 613 env.stub("pdf_create_fieldgroup"); 614 615 return false; 616 } 617 618 621 public static boolean pdf_create_gstate(Env env, 622 @NotNull PDF pdf, 623 @Optional String optList) 624 { 625 env.stub("pdf_create_gstate"); 626 627 return false; 628 } 629 630 633 public static boolean pdf_create_pvf(Env env, 634 @NotNull PDF pdf, 635 String filename, 636 String data, 637 @Optional String optList) 638 { 639 env.stub("pdf_create_pvf"); 640 641 return false; 642 } 643 644 647 public static boolean pdf_create_textflow(Env env, 648 @NotNull PDF pdf, 649 String text, 650 @Optional String optList) 651 { 652 env.stub("pdf_create_textflow"); 653 654 return false; 655 } 656 657 660 public static boolean pdf_curveto(@NotNull PDF pdf, 661 double x1, 662 double y1, 663 double x2, 664 double y2, 665 double x3, 666 double y3) 667 { 668 if (pdf == null) 669 return false; 670 671 return pdf.curveto(x1, y1, x2, y2, x3, y3); 672 } 673 674 677 public static boolean pdf_define_layer(Env env, 678 @NotNull PDF pdf, 679 String name, 680 @Optional String optList) 681 { 682 env.stub("pdf_define_layer"); 683 684 return false; 685 } 686 687 690 public static boolean pdf_delete_pvf(Env env, 691 @NotNull PDF pdf, 692 String name) 693 { 694 env.stub("pdf_delete_pvf"); 695 696 return false; 697 } 698 699 702 public static boolean pdf_delete_textflow(Env env, 703 @NotNull PDF pdf, 704 int textflow) 705 { 706 env.stub("pdf_delete_textflow"); 707 708 return false; 709 } 710 711 714 public static boolean pdf_delete(@NotNull PDF pdf) 715 { 716 try { 717 if (pdf == null) 718 return false; 719 720 return pdf.delete(); 721 } catch (IOException e) { 722 throw new QuercusModuleException(e); 723 } 724 } 725 726 729 public static boolean pdf_encoding_set_char(Env env, 730 @NotNull PDF pdf, 731 String encoding, 732 int slow, 733 String glyphname, 734 int uv) 735 { 736 env.stub("pdf_encoding_set_char"); 737 738 return false; 739 } 740 741 744 public static boolean pdf_end_document(@NotNull PDF pdf, 745 @Optional String optlist) 746 { 747 try { 748 if (pdf == null) 749 return false; 750 751 return pdf.end_document(optlist); 752 } catch (IOException e) { 753 throw new QuercusModuleException(e); 754 } 755 } 756 757 760 public static boolean pdf_end_font(Env env, 761 @NotNull PDF pdf) 762 { 763 env.stub("pdf_end_font"); 764 765 return false; 766 } 767 768 771 public static boolean pdf_end_glyph(Env env, 772 @NotNull PDF pdf) 773 { 774 env.stub("pdf_end_glyph"); 775 776 return false; 777 } 778 779 782 public static boolean pdf_end_item(Env env, 783 @NotNull PDF pdf, 784 int id) 785 { 786 env.stub("pdf_end_item"); 787 788 return false; 789 } 790 791 794 public static boolean pdf_end_layer(Env env, 795 @NotNull PDF pdf) 796 { 797 env.stub("pdf_end_layer"); 798 799 return false; 800 } 801 802 805 public static boolean pdf_end_page_ext(@NotNull PDF pdf, 806 @Optional String optlist) 807 { 808 if (pdf == null) 809 return false; 810 811 return pdf.end_page_ext(optlist); 812 } 813 814 817 public static boolean pdf_end_page(@NotNull PDF pdf) 818 { 819 if (pdf == null) 820 return false; 821 822 return pdf.end_page(); 823 } 824 825 828 public static boolean pdf_end_pattern(Env env, 829 @NotNull PDF pdf) 830 { 831 env.stub("pdf_end_pattern"); 832 833 return false; 834 } 835 836 839 public static boolean pdf_end_template(Env env, 840 @NotNull PDF pdf) 841 { 842 env.stub("pdf_end_template"); 843 844 return false; 845 } 846 847 850 public static boolean pdf_end_path(@NotNull PDF pdf) 851 { 852 if (pdf == null) 853 return false; 854 855 return pdf.endpath(); 856 } 857 858 861 public static boolean pdf_fill_imageblock(Env env, 862 @NotNull PDF pdf, 863 int page, 864 String blockname, 865 int image, 866 @Optional String optlist) 867 { 868 env.stub("pdf_fill_imageblock"); 869 870 return false; 871 } 872 873 876 public static boolean pdf_fill_pdfblock(Env env, 877 @NotNull PDF pdf, 878 int page, 879 String blockname, 880 int contents, 881 @Optional String optlist) 882 { 883 env.stub("pdf_fill_pdfblock"); 884 885 return false; 886 } 887 888 891 public static boolean pdf_fill_stroke(@NotNull PDF pdf) 892 { 893 if (pdf == null) 894 return false; 895 896 return pdf.fill_stroke(); 897 } 898 899 902 public static boolean pdf_fill_textblock(Env env, 903 @NotNull PDF pdf, 904 int page, 905 String block, 906 String text, 907 @Optional String optlist) 908 { 909 env.stub("pdf_fill_textblock"); 910 911 return false; 912 } 913 914 917 public static boolean pdf_fill(@NotNull PDF pdf) 918 { 919 if (pdf == null) 920 return false; 921 922 return pdf.fill(); 923 } 924 925 928 public static boolean pdf_findfont(Env env, 929 @NotNull PDF pdf, 930 String fontname, 931 String encoding, 932 int embed) 933 { 934 env.stub("pdf_findfont"); 935 936 return false; 937 } 938 939 942 public static boolean pdf_fit_image(@NotNull PDF pdf, 943 @NotNull PDFImage image, 944 double x, 945 double y, 946 @Optional String optlist) 947 { 948 if (pdf == null) 949 return false; 950 951 return pdf.fit_image(image, x, y, optlist); 952 } 953 954 957 public static boolean pdf_fit_pdi_page(Env env, 958 @NotNull PDF pdf, 959 int page, 960 double x, 961 double y, 962 @Optional String optlist) 963 { 964 env.stub("pdf_fit_pdi_page"); 965 966 return false; 967 } 968 969 972 public static boolean pdf_fit_textflow(Env env, 973 @NotNull PDF pdf, 974 int textflow, 975 double llx, 976 double lly, 977 double urx, 978 double ury, 979 @Optional String optlist) 980 { 981 env.stub("pdf_fit_textflow"); 982 983 return false; 984 } 985 986 989 public static boolean pdf_fit_textline(Env env, 990 @NotNull PDF pdf, 991 String text, 992 double x, 993 double y, 994 @Optional String optlist) 995 { 996 env.stub("pdf_fit_textline"); 997 998 return false; 999 } 1000 1001 1004 public static String pdf_get_apiname(Env env, 1005 @NotNull PDF pdf) 1006 { 1007 env.stub("pdf_get_apiname"); 1008 1009 return ""; 1010 } 1011 1012 1015 public static Value pdf_get_buffer(Env env, 1016 @NotNull PDF pdf) 1017 { 1018 if (pdf == null) 1019 return BooleanValue.FALSE; 1020 1021 return pdf.get_buffer(); 1022 } 1023 1024 1027 public static String pdf_get_errmsg(PDF pdf) 1028 { 1029 if (pdf != null) 1030 return pdf.get_errmsg(); 1031 else 1032 return ""; 1033 } 1034 1035 1038 public static int pdf_get_errnum(PDF pdf) 1039 { 1040 if (pdf != null) 1041 return pdf.get_errnum(); 1042 else 1043 return 0; 1044 } 1045 1046 1049 public static double pdf_get_image_height(@NotNull PDFImage image) 1050 { 1051 if (image != null) 1052 return image.get_height(); 1053 else 1054 return 0; 1055 } 1056 1057 1060 public static double pdf_get_image_width(@NotNull PDFImage image) 1061 { 1062 if (image != null) 1063 return image.get_width(); 1064 else 1065 return 0; 1066 } 1067 1068 1071 public static Value pdf_get_buffer(@NotNull PDF pdf) 1072 { 1073 if (pdf != null) 1074 return pdf.get_buffer(); 1075 else 1076 return BooleanValue.FALSE; 1077 } 1078 1079 1082 public static String pdf_get_parameter(@NotNull PDF pdf, 1083 String key, 1084 @Optional double modifier) 1085 { 1086 if (pdf != null) 1087 return pdf.get_parameter(key, modifier); 1088 else 1089 return ""; 1090 } 1091 1092 1095 public static String pdf_get_pdi_parameter(Env env, 1096 @NotNull PDF pdf, 1097 String key, 1098 int doc, 1099 int page, 1100 int reserved) 1101 { 1102 env.stub("pdf_get_pdi_parameter"); 1103 1104 return ""; 1105 } 1106 1107 1110 public static double pdf_get_pdi_value(Env env, 1111 @NotNull PDF pdf, 1112 String key, 1113 int doc, 1114 int page, 1115 int reserved) 1116 { 1117 env.stub("pdf_get_pdi_value"); 1118 1119 return 0; 1120 } 1121 1122 1125 public static double pdf_get_value(@NotNull PDF pdf, 1126 String key, 1127 @Optional double modifier) 1128 { 1129 if (pdf != null) 1130 return pdf.get_value(key, modifier); 1131 else 1132 return 0; 1133 } 1134 1135 1138 public static double pdf_info_textflow(Env env, 1139 @NotNull PDF pdf, 1140 int textflow, 1141 String key) 1142 { 1143 env.stub("pdf_info_textflow"); 1144 1145 return 0; 1146 } 1147 1148 1151 public static boolean pdf_initgraphics(Env env, 1152 @NotNull PDF pdf) 1153 { 1154 if (pdf != null) 1155 return pdf.initgraphics(env); 1156 else 1157 return false; 1158 } 1159 1160 1163 public static boolean pdf_lineto(@NotNull PDF pdf, 1164 double x, 1165 double y) 1166 { 1167 if (pdf == null) 1168 return false; 1169 1170 return pdf.lineto(x, y); 1171 } 1172 1173 1176 public static PDFFont pdf_load_font(@NotNull PDF pdf, 1177 String fontname, 1178 String encoding, 1179 @Optional String optlist) 1180 { 1181 try { 1182 if (pdf == null) 1183 return null; 1184 1185 return pdf.load_font(fontname, encoding, optlist); 1186 } catch (IOException e) { 1187 throw new QuercusModuleException(e); 1188 } 1189 } 1190 1191 1194 public static boolean pdf_load_iccprofile(Env env, 1195 @NotNull PDF pdf, 1196 String profileName, 1197 @Optional String optlist) 1198 { 1199 env.stub("pdf_load_iccprofile"); 1200 1201 return false; 1202 } 1203 1204 1207 public static PDFImage pdf_load_image(@NotNull PDF pdf, 1208 String imageType, 1209 Path path, 1210 @Optional String optlist) 1211 { 1212 try { 1213 if (pdf == null) 1214 return null; 1215 1216 return pdf.load_image(imageType, path, optlist); 1217 } catch (IOException e) { 1218 throw new QuercusModuleException(e); 1219 } 1220 } 1221 1222 1225 public static boolean pdf_makespotcolor(Env env, 1226 @NotNull PDF pdf, 1227 String spotname) 1228 { 1229 env.stub("pdf_makespotcolor"); 1230 1231 return false; 1232 } 1233 1234 1237 public static boolean pdf_moveto(@NotNull PDF pdf, 1238 double x, 1239 double y) 1240 { 1241 if (pdf == null) 1242 return false; 1243 1244 return pdf.moveto(x, y); 1245 } 1246 1247 1250 public static PDF pdf_new(Env env) 1251 { 1252 return new PDF(env); 1253 } 1254 1255 1258 public static boolean pdf_open_file(@NotNull PDF pdf, 1259 String filename) 1260 { 1261 return pdf_begin_document(pdf, filename, ""); 1262 } 1263 1264 1267 public static PDFImage pdf_open_image_file(@NotNull PDF pdf, 1268 String imagetype, 1269 Path filename, 1270 String stringparam, 1271 int intparam) 1272 { 1273 return pdf_load_image(pdf, imagetype, filename, ""); 1274 } 1275 1276 1279 public static boolean pdf_open_image_data(Env env, 1280 @NotNull PDF pdf, 1281 String imagetype, 1282 String source, 1283 String data, 1284 long length, 1285 long width, 1286 long height, 1287 int components, 1288 int bpc, 1289 String params) 1290 { 1291 env.stub("pdf_open_image_data"); 1292 1293 return false; 1294 } 1295 1296 1299 public static boolean pdf_open_pdi_page(Env env, 1300 @NotNull PDF pdf, 1301 int doc, 1302 int pagenumber, 1303 @Optional String optlist) 1304 { 1305 env.stub("pdf_open_pdi_page"); 1306 1307 return false; 1308 } 1309 1310 1313 public static boolean pdf_open_pdi(Env env, 1314 @NotNull PDF pdf, 1315 String filename, 1316 @Optional String optlist) 1317 { 1318 env.stub("pdf_open_pdi"); 1319 1320 return false; 1321 } 1322 1323 1326 public static boolean pdf_place_image(@NotNull PDF pdf, 1327 PDFImage image, 1328 double x, 1329 double y, 1330 double scale) 1331 { 1332 return pdf_fit_image(pdf, image, x, y, ""); 1333 } 1334 1335 1338 public static boolean pdf_place_pdi_page(Env env, 1339 @NotNull PDF pdf, 1340 int page, 1341 double x, 1342 double y, 1343 double scaleX, 1344 double scaleY) 1345 { 1346 return pdf_fit_pdi_page(env, pdf, page, x, y, ""); 1347 } 1348 1349 1352 public static boolean pdf_process_pdi(Env env, 1353 @NotNull PDF pdf, 1354 int doc, 1355 int page, 1356 @Optional String optlist) 1357 { 1358 env.stub("pdf_process_pdi"); 1359 1360 return false; 1361 } 1362 1363 1366 public static boolean pdf_rect(@NotNull PDF pdf, 1367 double x, double y, 1368 double width, double height) 1369 { 1370 if (pdf == null) 1371 return false; 1372 1373 return pdf.rect(x, y, width, height); 1374 } 1375 1376 1379 public static boolean pdf_restore(@NotNull PDF pdf) 1380 { 1381 if (pdf == null) 1382 return false; 1383 1384 return pdf.restore(); 1385 } 1386 1387 1390 public static boolean pdf_rotate(@NotNull PDF pdf, 1391 double phi) 1392 { 1393 if (pdf == null) 1394 return false; 1395 1396 return pdf.rotate(phi); 1397 } 1398 1399 1402 public static boolean pdf_save(@NotNull PDF pdf) 1403 { 1404 if (pdf == null) 1405 return false; 1406 1407 return pdf.save(); 1408 } 1409 1410 1413 public static boolean pdf_scale(@NotNull PDF pdf, 1414 double scaleX, 1415 double scaleY) 1416 { 1417 if (pdf == null) 1418 return false; 1419 1420 return pdf.scale(scaleX, scaleY); 1421 } 1422 1423 1426 public static boolean pdf_set_border_color(Env env, 1427 @NotNull PDF pdf, 1428 double red, 1429 double green, 1430 double blue) 1431 { 1432 env.stub("pdf_set_border_color"); 1433 1434 return false; 1435 } 1436 1437 1440 public static boolean pdf_set_border_dash(Env env, 1441 @NotNull PDF pdf, 1442 double black, 1443 double white) 1444 { 1445 env.stub("pdf_set_border_dash"); 1446 1447 return false; 1448 } 1449 1450 1453 public static boolean pdf_set_border_style(Env env, 1454 @NotNull PDF pdf, 1455 String style, 1456 double width) 1457 { 1458 env.stub("pdf_set_border_style"); 1459 1460 return false; 1461 } 1462 1463 1466 public static boolean pdf_set_gstate(Env env, 1467 @NotNull PDF pdf, 1468 int gstate) 1469 { 1470 env.stub("pdf_set_gstate"); 1471 1472 return false; 1473 } 1474 1475 1478 public static boolean pdf_set_info(@NotNull PDF pdf, 1479 String key, 1480 String value) 1481 { 1482 if (pdf == null) 1483 return false; 1484 1485 return pdf.set_info(key, value); 1486 } 1487 1488 1491 public static boolean pdf_set_layer_dependency(Env env, 1492 @NotNull PDF pdf, 1493 String type, 1494 @Optional String optlist) 1495 { 1496 env.stub("pdf_set_layer_dependency"); 1497 1498 return false; 1499 } 1500 1501 1504 public static boolean pdf_set_parameter(@NotNull PDF pdf, 1505 String key, 1506 String value) 1507 { 1508 if (pdf != null) 1509 return false; 1510 1511 return pdf.set_parameter(key, value); 1512 } 1513 1514 1517 public static boolean pdf_set_text_pos(@NotNull PDF pdf, 1518 double x, 1519 double y) 1520 { 1521 if (pdf == null) 1522 return false; 1523 1524 return pdf.set_text_pos(x, y); 1525 } 1526 1527 1530 public static boolean pdf_set_value(@NotNull PDF pdf, 1531 String key, 1532 double value) 1533 { 1534 if (pdf == null) 1535 return false; 1536 1537 return pdf.set_value(key, value); 1538 } 1539 1540 1543 public static boolean pdf_setcolor(@NotNull PDF pdf, 1544 String type, 1545 String colorspace, 1546 double c1, 1547 @Optional double c2, 1548 @Optional double c3, 1549 @Optional double c4) 1550 { 1551 if (pdf == null) 1552 return false; 1553 1554 return pdf.setcolor(type, colorspace, c1, c2, c3, c4); 1555 } 1556 1557 1560 public static boolean pdf_setdash(@NotNull PDF pdf, 1561 double black, 1562 double white) 1563 { 1564 if (pdf == null) 1565 return false; 1566 1567 return pdf.setdash(black, white); 1568 } 1569 1570 1573 public static boolean pdf_setdashpattern(Env env, 1574 @NotNull PDF pdf, 1575 String optlist) 1576 { 1577 if (pdf == null) 1578 return false; 1579 1580 return pdf.setdashpattern(env, optlist); 1581 } 1582 1583 1586 public static boolean pdf_setflat(Env env, 1587 @NotNull PDF pdf, 1588 double flatness) 1589 { 1590 if (pdf == null) 1591 return false; 1592 1593 return pdf.setflat(env, flatness); 1594 } 1595 1596 1599 public static boolean pdf_setfont(@NotNull PDF pdf, 1600 @NotNull PDFFont font, 1601 double size) 1602 { 1603 try { 1604 if (pdf == null) 1605 return false; 1606 1607 return pdf.setfont(font, size); 1608 } catch (IOException e) { 1609 throw new QuercusModuleException(e); 1610 } 1611 } 1612 1613 1616 public static boolean pdf_setgray_fill(@NotNull PDF pdf, 1617 double g) 1618 { 1619 if (pdf == null) 1620 return false; 1621 1622 return pdf.setgray_fill(g); 1623 } 1624 1625 1628 public static boolean pdf_setgray_stroke(@NotNull PDF pdf, 1629 double g) 1630 { 1631 if (pdf == null) 1632 return false; 1633 1634 return pdf.setgray_stroke(g); 1635 } 1636 1637 1640 public static boolean pdf_setgray(@NotNull PDF pdf, 1641 double g) 1642 { 1643 if (pdf == null) 1644 return false; 1645 1646 return pdf.setgray(g); 1647 } 1648 1649 1652 public static boolean pdf_setlinecap(Env env, 1653 @NotNull PDF pdf, 1654 int value) 1655 { 1656 if (pdf == null) 1657 return false; 1658 1659 return pdf.setlinecap(env, value); 1660 } 1661 1662 1665 public static boolean pdf_setlinejoin(Env env, 1666 @NotNull PDF pdf, 1667 int value) 1668 { 1669 if (pdf == null) 1670 return false; 1671 1672 return pdf.setlinejoin(env, value); 1673 } 1674 1675 1678 public static boolean pdf_setlinewidth(@NotNull PDF pdf, 1679 double width) 1680 { 1681 if (pdf == null) 1682 return false; 1683 1684 return pdf.setlinewidth(width); 1685 } 1686 1687 1690 public static boolean pdf_setmatrix(Env env, 1691 @NotNull PDF pdf, 1692 double a, 1693 double b, 1694 double c, 1695 double d, 1696 double e, 1697 double f) 1698 { 1699 if (pdf == null) 1700 return false; 1701 1702 return pdf.setmatrix(env, a, b, c, d, e, f); 1703 } 1704 1705 1708 public static boolean pdf_setmiterlimit(Env env, 1709 @NotNull PDF pdf, 1710 double value) 1711 { 1712 if (pdf == null) 1713 return false; 1714 1715 return pdf.setmiterlimit(env, value); 1716 } 1717 1718 1721 public static boolean pdf_setrgbcolor_fill(@NotNull PDF pdf, 1722 double red, 1723 double green, 1724 double blue) 1725 { 1726 if (pdf == null) 1727 return false; 1728 1729 return pdf.setrgbcolor_fill(red, green, blue); 1730 } 1731 1732 1735 public static boolean pdf_setrgbcolor_stroke(@NotNull PDF pdf, 1736 double red, 1737 double green, 1738 double blue) 1739 { 1740 if (pdf == null) 1741 return false; 1742 1743 return pdf.setrgbcolor_stroke(red, green, blue); 1744 } 1745 1746 1749 public static boolean pdf_setrgbcolor(@NotNull PDF pdf, 1750 double red, 1751 double green, 1752 double blue) 1753 { 1754 if (pdf == null) 1755 return false; 1756 1757 return pdf.setrgbcolor(red, green, blue); 1758 } 1759 1760 1763 public static boolean pdf_shading_pattern(Env env, 1764 @NotNull PDF pdf, 1765 int shading, 1766 @Optional String optlist) 1767 { 1768 if (pdf == null) 1769 return false; 1770 1771 return pdf.shading_pattern(env, shading, optlist); 1772 } 1773 1774 1777 public static int pdf_shading(Env env, 1778 @NotNull PDF pdf, 1779 String type, 1780 double x1, 1781 double y1, 1782 double x2, 1783 double y2, 1784 double c1, 1785 double c2, 1786 double c3, 1787 double c4, 1788 @Optional String optlist) 1789 { 1790 if (pdf == null) 1791 return 0; 1792 1793 return pdf.shading(env, type, x1, y1, x2, y2, c1, c2, c3, c4, optlist); 1794 } 1795 1796 1799 public static boolean pdf_shfill(Env env, 1800 @NotNull PDF pdf, 1801 int shading) 1802 { 1803 if (pdf == null) 1804 return false; 1805 1806 return pdf.shfill(env, shading); 1807 } 1808 1809 1812 public static boolean pdf_show_boxed(Env env, 1813 @NotNull PDF pdf, 1814 String text, 1815 double x, 1816 double y, 1817 double width, 1818 double height, 1819 String mode, 1820 @Optional String feature) 1821 { 1822 if (pdf == null) 1823 return false; 1824 1825 return pdf.show_boxed(text, x, y, width, height, mode, feature); 1826 } 1827 1828 1831 public static boolean pdf_show_xy(Env env, 1832 @NotNull PDF pdf, 1833 String text, 1834 double x, 1835 double y) 1836 { 1837 if (pdf == null) 1838 return false; 1839 1840 return pdf.show_xy(text, x, y); 1841 } 1842 1843 1846 public static boolean pdf_show(Env env, 1847 @NotNull PDF pdf, 1848 String text) 1849 { 1850 if (pdf == null) 1851 return false; 1852 1853 return pdf.show(text); 1854 } 1855 1856 1859 public static boolean pdf_skew(@NotNull PDF pdf, 1860 double alpha, 1861 double beta) 1862 { 1863 if (pdf == null) 1864 return false; 1865 1866 return pdf.skew(alpha, beta); 1867 } 1868 1869 1872 public static double pdf_stringwidth(@NotNull PDF pdf, 1873 String text, 1874 @NotNull PDFFont font, 1875 double size) 1876 { 1877 if (pdf == null) 1878 return 0; 1879 1880 return pdf.stringwidth(text, font, size); 1881 } 1882 1883 1886 public static boolean pdf_stroke(@NotNull PDF pdf) 1887 { 1888 if (pdf == null) 1889 return false; 1890 1891 return pdf.stroke(); 1892 } 1893 1894 1897 public static boolean pdf_suspend_page(Env env, 1898 @NotNull PDF pdf, 1899 @Optional String optlist) 1900 { 1901 env.stub("pdf_suspend_page"); 1902 1903 return false; 1904 } 1905 1906 1909 public static boolean pdf_translate(@NotNull PDF pdf, 1910 double x, 1911 double y) 1912 { 1913 if (pdf == null) 1914 return false; 1915 1916 return pdf.translate(x, y); 1917 } 1918 1919 1922 public static String pdf_utf16_to_utf8(Env env, 1923 @NotNull PDF pdf, 1924 String utf16string) 1925 { 1926 env.stub("pdf_utf16_to_utf8"); 1927 1928 return utf16string; 1929 } 1930 1931 1934 public static String pdf_utf8_to_utf16(Env env, 1935 @NotNull PDF pdf, 1936 String utf8string) 1937 { 1938 env.stub("pdf_utf16_to_utf8"); 1939 1940 return utf8string; 1941 } 1942} 1943 | Popular Tags |