github.com/pdfcpu/pdfcpu@v0.11.1/pkg/testdata/json/create/boxesAndMargin.json (about) 1 { 2 "paper": "A4L", 3 "crop": "10", 4 "origin": "LowerLeft", 5 "contentBox": true, 6 "debug": false, 7 "guides": true, 8 "colors": { 9 "DarkSalmon": "#E9967A" 10 }, 11 "bgcol": "#BEDED9", 12 "timestamp": "Monday, 2.Jan 2006 15:04:05", 13 "dirs": { 14 "images": "../../testdata/resources" 15 }, 16 "files": { 17 "logo1": "$images/logoVerySmall.png", 18 "logo2": "$images/github.png" 19 }, 20 "fonts": { 21 "myCourier": { 22 "name": "Courier", 23 "size": 12, 24 "col": "#00AA00" 25 } 26 }, 27 "borders": { 28 "myBorder": { 29 "width": 5, 30 "col": "#0000FF", 31 "style": "round" 32 } 33 }, 34 "margin": { 35 "width": 20 36 }, 37 "header": { 38 "font": { 39 "name": "Courier-Bold", 40 "size": 24, 41 "col": "#0000FF" 42 }, 43 "left": "$logo1", 44 "center": "Boxes & Margin", 45 "right": "$logo2", 46 "height": 40, 47 "dx": 5, 48 "dy": 10, 49 "border": false 50 }, 51 "footer": { 52 "font": { 53 "name": "$myCourier", 54 "col": "Black" 55 }, 56 "left": "pdfcpu: %v\nCreated: %t", 57 "center": "Page %p of %P", 58 "right": "Source:\ntestdata/json/create/boxesAndMargin.json", 59 "height": 30, 60 "dx": 5, 61 "dy": 5, 62 "border": false 63 }, 64 "images": { 65 "logo1": { 66 "src": "$logo1", 67 "url": "https://pdfcpu.io", 68 "margin": { 69 "width": 5 70 } 71 }, 72 "logo2": { 73 "src": "$logo2", 74 "url": "https://github.com/pdfcpu/pdfcpu", 75 "margin": { 76 "width": 5 77 } 78 } 79 }, 80 "pages": { 81 "1": { 82 "content": { 83 "guides": [ 84 { 85 "pos": [ 86 -1, 87 -1 88 ] 89 }, 90 { 91 "pos": [ 92 10, 93 10 94 ] 95 } 96 ], 97 "text": [ 98 { 99 "anchor": "center", 100 "dy": 80, 101 "value": "Anchored Textboxes with margin", 102 "font": { 103 "name": "Courier", 104 "size": 18 105 } 106 }, 107 108 { 109 "value": "TopLeft", 110 "anchor": "topLeft", 111 "bgCol": "#032890", 112 "font": { 113 "name": "$myCourier" 114 }, 115 "margin": { 116 "width": 10 117 }, 118 "border": { 119 "name": "$myBorder", 120 "col": "White" 121 }, 122 "padding": { 123 "width": 20 124 } 125 }, 126 { 127 "value": "TopCenter", 128 "anchor": "topCenter", 129 "bgCol": "#032890", 130 "font": { 131 "name": "$myCourier" 132 }, 133 "margin": { 134 "width": 10 135 }, 136 "border": { 137 "name": "$myBorder", 138 "col": "White" 139 }, 140 "padding": { 141 "width": 20 142 } 143 }, 144 { 145 "value": "TopRight", 146 "anchor": "topRight", 147 "bgCol": "#032890", 148 "font": { 149 "name": "$myCourier" 150 }, 151 "margin": { 152 "width": 10 153 }, 154 "border": { 155 "name": "$myBorder", 156 "col": "White" 157 }, 158 "padding": { 159 "width": 20 160 } 161 }, 162 { 163 "value": "Left", 164 "anchor": "left", 165 "bgCol": "#032890", 166 "font": { 167 "name": "$myCourier" 168 }, 169 "margin": { 170 "width": 10 171 }, 172 "border": { 173 "name": "$myBorder", 174 "col": "White" 175 }, 176 "padding": { 177 "width": 20 178 } 179 }, 180 { 181 "value": "Center", 182 "anchor": "center", 183 "bgCol": "#032890", 184 "font": { 185 "name": "$myCourier" 186 }, 187 "margin": { 188 "width": 10 189 }, 190 "border": { 191 "name": "$myBorder", 192 "col": "White" 193 }, 194 "padding": { 195 "width":20 196 } 197 }, 198 { 199 "value": "Right", 200 "anchor": "right", 201 "bgCol": "#032890", 202 "font": { 203 "name": "$myCourier" 204 }, 205 "margin": { 206 "width": 10 207 }, 208 "border": { 209 "name": "$myBorder", 210 "col": "White" 211 }, 212 "padding": { 213 "width": 20 214 } 215 }, 216 { 217 "value": "BottomLeft", 218 "anchor": "bottomleft", 219 "bgCol": "#032890", 220 "font": { 221 "name": "$myCourier" 222 }, 223 "margin": { 224 "width": 10 225 }, 226 "border": { 227 "name": "$myBorder", 228 "col": "White" 229 }, 230 "padding": { 231 "width": 20 232 } 233 }, 234 { 235 "value": "BottomCenter", 236 "anchor": "bottomCenter", 237 "bgCol": "#032890", 238 "font": { 239 "name": "$myCourier" 240 }, 241 "margin": { 242 "width": 10 243 }, 244 "border": { 245 "name": "$myBorder", 246 "col": "White" 247 }, 248 "padding": { 249 "width": 20 250 } 251 }, 252 { 253 "value": "BottomRight", 254 "anchor": "bottomRight", 255 "bgCol": "#032890", 256 "font": { 257 "name": "$myCourier" 258 }, 259 "margin": { 260 "width": 10 261 }, 262 "border": { 263 "name": "$myBorder", 264 "col": "White" 265 }, 266 "padding": { 267 "width": 20 268 } 269 } 270 ] 271 } 272 }, 273 "2": { 274 "content": { 275 "guides": [ 276 { 277 "pos": [ 278 -1, 279 -1 280 ] 281 }, 282 { 283 "pos": [ 284 10, 285 10 286 ] 287 }, 288 { 289 "pos": [ 290 100, 291 100 292 ] 293 } 294 ], 295 "text": [ 296 { 297 "hide": false, 298 "anchor": "center", 299 "dy": 80, 300 "value": "Positioned Textboxes with margin", 301 "font": { 302 "name": "Courier", 303 "size": 18 304 } 305 }, 306 307 { 308 "hide": false, 309 "value": "Test", 310 "pos": [ 311 100, 312 100 313 ], 314 "bgCol": "#032890", 315 "font": { 316 "name": "$myCourier" 317 }, 318 "margin": { 319 "width": 10 320 }, 321 "border": { 322 "name": "$myBorder", 323 "col": "White" 324 }, 325 "padding": { 326 "width": 10 327 } 328 }, 329 330 { 331 "hide": false, 332 "value": "TopLeft", 333 "anchor": "topLeft", 334 "//pos": [ 335 0, 336 500 337 ], 338 "bgCol": "#032890", 339 "font": { 340 "name": "$myCourier" 341 }, 342 "margin": { 343 "width": 10 344 }, 345 "border": { 346 "name": "$myBorder", 347 "col": "White" 348 }, 349 "padding": { 350 "width": 10 351 } 352 }, 353 { 354 "value": "TopCenter", 355 "//align": "center", 356 "anchor": "topCenter", 357 "//pos": [ 358 -1, 359 500 360 ], 361 "bgCol": "#032890", 362 "font": { 363 "name": "$myCourier" 364 }, 365 "margin": { 366 "width": 10 367 }, 368 "border": { 369 "name": "$myBorder", 370 "col": "White" 371 }, 372 "padding": { 373 "width": 10 374 } 375 }, 376 { 377 "hide": false, 378 "value": "TopRight", 379 "anchor": "topRight", 380 "//pos": [ 381 800, 382 500 383 ], 384 "bgCol": "#032890", 385 "font": { 386 "name": "$myCourier" 387 }, 388 "margin": { 389 "width": 10 390 }, 391 "border": { 392 "name": "$myBorder", 393 "col": "White" 394 }, 395 "padding": { 396 "width": 10 397 } 398 }, 399 { 400 "hide": false, 401 "value": "Left", 402 "pos": [ 403 0, 404 -1 405 ], 406 "bgCol": "#032890", 407 "font": { 408 "name": "$myCourier" 409 }, 410 "margin": { 411 "width": 10 412 }, 413 "border": { 414 "name": "$myBorder", 415 "col": "White" 416 }, 417 "padding": { 418 "width": 10 419 } 420 }, 421 { 422 "hide": false, 423 "value": "Center", 424 "align": "center", 425 "pos": [ 426 -1, 427 -1 428 ], 429 "bgCol": "#032890", 430 "font": { 431 "name": "$myCourier" 432 }, 433 "margin": { 434 "left": 10, 435 "right": 20 436 }, 437 "border": { 438 "name": "$myBorder", 439 "col": "White" 440 }, 441 "padding": { 442 "width":10 443 } 444 }, 445 { 446 "hide": false, 447 "value": "Right", 448 "anchor": "right", 449 "//pos": [ 450 800, 451 -1 452 ], 453 "bgCol": "#032890", 454 "font": { 455 "name": "$myCourier" 456 }, 457 "margin": { 458 "width": 10 459 }, 460 "border": { 461 "name": "$myBorder", 462 "col": "White" 463 }, 464 "padding": { 465 "width": 10 466 } 467 }, 468 { 469 "hide": false, 470 "value": "BottomLeft", 471 "pos": [ 472 0, 473 0 474 ], 475 "bgCol": "#032890", 476 "font": { 477 "name": "$myCourier" 478 }, 479 "margin": { 480 "width": 10 481 }, 482 "border": { 483 "name": "$myBorder", 484 "col": "White" 485 }, 486 "padding": { 487 "width": 10 488 } 489 }, 490 { 491 "hide": false, 492 "value": "BottomCenter", 493 "align": "center", 494 "pos": [ 495 -1, 496 0 497 ], 498 "bgCol": "#032890", 499 "font": { 500 "name": "$myCourier" 501 }, 502 "margin": { 503 "width": 10 504 }, 505 "border": { 506 "name": "$myBorder", 507 "col": "White" 508 }, 509 "padding": { 510 "width": 10 511 } 512 }, 513 { 514 "hide": false, 515 "value": "BottomRight", 516 "anchor": "bottomRight", 517 "//pos": [ 518 800, 519 0 520 ], 521 "bgCol": "#032890", 522 "font": { 523 "name": "$myCourier" 524 }, 525 "margin": { 526 "width": 10 527 }, 528 "border": { 529 "name": "$myBorder", 530 "col": "White" 531 }, 532 "padding": { 533 "width": 10 534 } 535 } 536 ] 537 } 538 }, 539 "3": { 540 "content": { 541 "guides": [ 542 { 543 "pos": [ 544 -1, 545 -1 546 ] 547 }, 548 { 549 "pos": [ 550 10, 551 10 552 ] 553 } 554 ], 555 "text": [ 556 { 557 "anchor": "center", 558 "dy": 80, 559 "value": "Anchored Imageboxes with margin", 560 "font": { 561 "name": "Courier", 562 "size": 18 563 } 564 } 565 ], 566 "image": [ 567 { 568 "anchor": "topleft", 569 "src": "../../testdata/resources/demo.png", 570 "height": 100, 571 "margin": { 572 "width": 10 573 } 574 }, 575 { 576 "anchor": "topcenter", 577 "src": "../../testdata/resources/demo.png", 578 "height": 100, 579 "margin": { 580 "width": 10 581 }, 582 "border": { 583 "name": "$myBorder" 584 } 585 }, 586 { 587 "anchor": "topright", 588 "src": "../../testdata/resources/demo.png", 589 "height": 100, 590 "margin": { 591 "width": 10 592 }, 593 "border": { 594 "name": "$myBorder" 595 }, 596 "padding": { 597 "width": 10 598 } 599 }, 600 601 { 602 "anchor": "left", 603 "src": "../../testdata/resources/demo.png", 604 "height": 100, 605 "margin": { 606 "width": 10 607 } 608 }, 609 { 610 "anchor": "center", 611 "src": "../../testdata/resources/demo.png", 612 "height": 100, 613 "margin": { 614 "width": 10 615 }, 616 "border": { 617 "name": "$myBorder" 618 } 619 }, 620 { 621 "anchor": "right", 622 "src": "../../testdata/resources/demo.png", 623 "height": 100, 624 "margin": { 625 "width": 10 626 }, 627 "border": { 628 "name": "$myBorder" 629 }, 630 "padding": { 631 "width": 10 632 } 633 }, 634 635 { 636 "anchor": "bottomleft", 637 "src": "../../testdata/resources/demo.png", 638 "height": 100, 639 "margin": { 640 "width": 10 641 } 642 }, 643 { 644 "anchor": "bottomcenter", 645 "src": "../../testdata/resources/demo.png", 646 "height": 100, 647 "margin": { 648 "width": 10 649 }, 650 "border": { 651 "name": "$myBorder" 652 } 653 }, 654 { 655 "anchor": "bottomright", 656 "src": "../../testdata/resources/demo.png", 657 "height": 100, 658 "margin": { 659 "width": 10 660 }, 661 "border": { 662 "name": "$myBorder" 663 }, 664 "padding": { 665 "width": 10 666 } 667 } 668 ] 669 } 670 }, 671 "4": { 672 "content": { 673 "guides": [ 674 { 675 "pos": [ 676 -1, 677 -1 678 ] 679 }, 680 { 681 "pos": [ 682 10, 683 10 684 ] 685 }, 686 { 687 "pos": [ 688 100, 689 100 690 ] 691 } 692 ], 693 "text": [ 694 { 695 "anchor": "center", 696 "dy": 80, 697 "value": "Positioned Imageboxes with margin", 698 "font": { 699 "name": "Courier", 700 "size": 18 701 } 702 } 703 ], 704 "image": [ 705 { 706 "pos": [ 707 100, 708 100 709 ], 710 "src": "../../testdata/resources/demo.png", 711 "height": 70, 712 "margin": { 713 "width": 10 714 }, 715 "border": { 716 "name": "$myBorder" 717 }, 718 "padding": { 719 "width": 10 720 } 721 }, 722 { 723 "pos": [ 724 0, 725 500 726 ], 727 "src": "../../testdata/resources/demo.png", 728 "height": 70, 729 "margin": { 730 "width": 10 731 } 732 }, 733 { 734 "pos": [ 735 -1, 736 500 737 ], 738 "src": "../../testdata/resources/demo.png", 739 "height": 70, 740 "margin": { 741 "width": 10 742 }, 743 "border": { 744 "name": "$myBorder" 745 } 746 }, 747 { 748 "pos": [ 749 1000, 750 500 751 ], 752 "src": "../../testdata/resources/demo.png", 753 "height": 70, 754 "margin": { 755 "width": 10 756 }, 757 "border": { 758 "name": "$myBorder" 759 }, 760 "padding": { 761 "width": 10 762 } 763 }, 764 765 { 766 "pos": [ 767 0, 768 -1 769 ], 770 "src": "../../testdata/resources/demo.png", 771 "height": 70, 772 "margin": { 773 "width": 10 774 } 775 }, 776 { 777 "pos": [ 778 -1, 779 -1 780 ], 781 "src": "../../testdata/resources/demo.png", 782 "height": 70, 783 "margin": { 784 "width": 10 785 }, 786 "border": { 787 "name": "$myBorder" 788 } 789 }, 790 { 791 "pos": [ 792 1000, 793 -1 794 ], 795 "src": "../../testdata/resources/demo.png", 796 "height": 70, 797 "margin": { 798 "width": 10 799 }, 800 "border": { 801 "name": "$myBorder" 802 }, 803 "padding": { 804 "width": 10 805 } 806 }, 807 808 { 809 "pos": [ 810 0, 811 0 812 ], 813 "src": "../../testdata/resources/demo.png", 814 "height": 70, 815 "margin": { 816 "width": 10 817 } 818 }, 819 { 820 "pos": [ 821 -1, 822 0 823 ], 824 "src": "../../testdata/resources/demo.png", 825 "height": 70, 826 "margin": { 827 "width": 10 828 }, 829 "border": { 830 "name": "$myBorder" 831 } 832 }, 833 { 834 "pos": [ 835 1000, 836 0 837 ], 838 "src": "../../testdata/resources/demo.png", 839 "height": 70, 840 "margin": { 841 "width": 10 842 }, 843 "border": { 844 "name": "$myBorder" 845 }, 846 "padding": { 847 "width": 10 848 } 849 } 850 ] 851 } 852 }, 853 "5": { 854 "content": { 855 "guides": [ 856 { 857 "pos": [ 858 -1, 859 -1 860 ] 861 }, 862 { 863 "pos": [ 864 10, 865 10 866 ] 867 } 868 ], 869 "text": [ 870 { 871 "anchor": "center", 872 "dy": 80, 873 "value": "Anchored Simpleboxes with margin", 874 "font": { 875 "name": "Courier", 876 "size": 18 877 } 878 } 879 ], 880 "box": [ 881 { 882 "anchor": "topleft", 883 "width": 150, 884 "height": 100, 885 "fillCol": "$DarkSalmon", 886 "margin": { 887 "width": 10 888 } 889 }, 890 { 891 "anchor": "topcenter", 892 "width": 150, 893 "height": 100, 894 "fillCol": "$DarkSalmon", 895 "margin": { 896 "width": 10 897 }, 898 "border": { 899 "name": "$myBorder" 900 } 901 }, 902 { 903 "anchor": "topright", 904 "width": 150, 905 "height": 100, 906 "margin": { 907 "width": 10 908 }, 909 "border": { 910 "name": "$myBorder" 911 } 912 }, 913 914 { 915 "anchor": "left", 916 "width": 150, 917 "height": 100, 918 "fillCol": "$DarkSalmon", 919 "margin": { 920 "width": 10 921 } 922 }, 923 { 924 "anchor": "center", 925 "width": 150, 926 "height": 100, 927 "fillCol": "$DarkSalmon", 928 "margin": { 929 "width": 10 930 }, 931 "border": { 932 "name": "$myBorder" 933 } 934 }, 935 { 936 "anchor": "right", 937 "width": 150, 938 "height": 100, 939 "margin": { 940 "width": 10 941 }, 942 "border": { 943 "name": "$myBorder" 944 } 945 }, 946 947 { 948 "anchor": "bottomleft", 949 "width": 150, 950 "height": 100, 951 "fillCol": "$DarkSalmon", 952 "margin": { 953 "width": 10 954 } 955 }, 956 { 957 "anchor": "bottomcenter", 958 "width": 150, 959 "height": 100, 960 "fillCol": "$DarkSalmon", 961 "margin": { 962 "width": 10 963 }, 964 "border": { 965 "name": "$myBorder" 966 } 967 }, 968 { 969 "anchor": "bottomright", 970 "width": 150, 971 "height": 100, 972 "margin": { 973 "width": 10 974 }, 975 "border": { 976 "name": "$myBorder" 977 } 978 } 979 ] 980 } 981 }, 982 "6": { 983 "content": { 984 "guides": [ 985 { 986 "pos": [ 987 -1, 988 -1 989 ] 990 }, 991 { 992 "pos": [ 993 10, 994 10 995 ] 996 }, 997 { 998 "pos": [ 999 100, 1000 100 1001 ] 1002 } 1003 ], 1004 "text": [ 1005 { 1006 "anchor": "center", 1007 "dy": 80, 1008 "value": "Positioned Simpleboxes with margin", 1009 "font": { 1010 "name": "Courier", 1011 "size": 18 1012 } 1013 } 1014 ], 1015 "box": [ 1016 { 1017 "pos": [ 1018 100, 1019 100 1020 ], 1021 "width": 100, 1022 "height": 50, 1023 "fillCol": "$DarkSalmon", 1024 "margin": { 1025 "width": 10 1026 }, 1027 "border": { 1028 "name": "$myBorder" 1029 } 1030 }, 1031 { 1032 "pos": [ 1033 0, 1034 500 1035 ], 1036 "width": 100, 1037 "height": 50, 1038 "fillCol": "$DarkSalmon", 1039 "margin": { 1040 "width": 10 1041 } 1042 }, 1043 { 1044 "pos": [ 1045 -1, 1046 500 1047 ], 1048 "width": 100, 1049 "height": 50, 1050 "fillCol": "$DarkSalmon", 1051 "margin": { 1052 "width": 10 1053 }, 1054 "border": { 1055 "name": "$myBorder" 1056 } 1057 }, 1058 { 1059 "pos": [ 1060 1000, 1061 500 1062 ], 1063 "width": 100, 1064 "height": 50, 1065 "margin": { 1066 "width": 10 1067 }, 1068 "border": { 1069 "name": "$myBorder" 1070 } 1071 }, 1072 1073 { 1074 "pos": [ 1075 0, 1076 -1 1077 ], 1078 "width": 100, 1079 "height": 50, 1080 "fillCol": "$DarkSalmon", 1081 "margin": { 1082 "width": 10 1083 } 1084 }, 1085 { 1086 "pos": [ 1087 -1, 1088 -1 1089 ], 1090 "width": 100, 1091 "height": 50, 1092 "fillCol": "$DarkSalmon", 1093 "margin": { 1094 "width": 10 1095 }, 1096 "border": { 1097 "name": "$myBorder" 1098 } 1099 }, 1100 { 1101 "pos": [ 1102 1000, 1103 -1 1104 ], 1105 "width": 100, 1106 "height": 50, 1107 "margin": { 1108 "width": 10 1109 }, 1110 "border": { 1111 "name": "$myBorder" 1112 } 1113 }, 1114 1115 { 1116 "pos": [ 1117 0, 1118 0 1119 ], 1120 "width": 100, 1121 "height": 50, 1122 "fillCol": "$DarkSalmon", 1123 "margin": { 1124 "width": 10 1125 } 1126 }, 1127 { 1128 "pos": [ 1129 -1, 1130 0 1131 ], 1132 "width": 100, 1133 "height": 50, 1134 "fillCol": "$DarkSalmon", 1135 "margin": { 1136 "width": 10 1137 }, 1138 "border": { 1139 "name": "$myBorder" 1140 } 1141 }, 1142 { 1143 "pos": [ 1144 1000, 1145 0 1146 ], 1147 "width": 100, 1148 "height": 50, 1149 "margin": { 1150 "width": 10 1151 }, 1152 "border": { 1153 "name": "$myBorder" 1154 } 1155 } 1156 ] 1157 } 1158 } 1159 } 1160 }