diff options
-rw-r--r-- | Resource/Init/pdf_draw.ps | 92 |
1 files changed, 54 insertions, 38 deletions
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps index c239daf5d..6b0ba93e1 100644 --- a/Resource/Init/pdf_draw.ps +++ b/Resource/Init/pdf_draw.ps | |||
@@ -3445,6 +3445,19 @@ currentdict /set_bc_color undef | |||
3445 | } if | 3445 | } if |
3446 | }bind executeonly def | 3446 | }bind executeonly def |
3447 | 3447 | ||
3448 | /ValidateAP { | ||
3449 | dup /AP oknown { | ||
3450 | dup /AP oget | ||
3451 | /N oknown not { | ||
3452 | //false | ||
3453 | } { | ||
3454 | //true | ||
3455 | } ifelse | ||
3456 | } { | ||
3457 | //false | ||
3458 | }ifelse | ||
3459 | } bind executeonly def | ||
3460 | |||
3448 | % x0 y0 x1 y1 x2 y2 x3 y3 -> x0 y0 x1-x0 y1-y0 x2-x0 y2-y0 | 3461 | % x0 y0 x1 y1 x2 y2 x3 y3 -> x0 y0 x1-x0 y1-y0 x2-x0 y2-y0 |
3449 | /quadpoints2basis { | 3462 | /quadpoints2basis { |
3450 | 8 { oforce 8 1 roll } repeat | 3463 | 8 { oforce 8 1 roll } repeat |
@@ -3489,9 +3502,10 @@ currentdict /set_bc_color undef | |||
3489 | } bind executeonly def | 3502 | } bind executeonly def |
3490 | 3503 | ||
3491 | /Square { | 3504 | /Square { |
3492 | dup /AP oknown { | 3505 | //ValidateAP exec |
3506 | { | ||
3493 | //true | 3507 | //true |
3494 | }{ | 3508 | } { |
3495 | gsave | 3509 | gsave |
3496 | //startannottransparency exec | 3510 | //startannottransparency exec |
3497 | dup | 3511 | dup |
@@ -3532,9 +3546,10 @@ currentdict /set_bc_color undef | |||
3532 | }bind executeonly def | 3546 | }bind executeonly def |
3533 | 3547 | ||
3534 | /Circle { | 3548 | /Circle { |
3535 | dup /AP oknown { | 3549 | //ValidateAP exec |
3550 | { | ||
3536 | //true | 3551 | //true |
3537 | }{ | 3552 | } { |
3538 | gsave | 3553 | gsave |
3539 | //startannottransparency exec | 3554 | //startannottransparency exec |
3540 | dup annotrect 4 2 roll exch 3 index 2 div add exch 2 index 2 div add | 3555 | dup annotrect 4 2 roll exch 3 index 2 div add exch 2 index 2 div add |
@@ -3549,9 +3564,10 @@ currentdict /set_bc_color undef | |||
3549 | } bind executeonly def | 3564 | } bind executeonly def |
3550 | 3565 | ||
3551 | /Polygon { | 3566 | /Polygon { |
3552 | dup /AP oknown { | 3567 | //ValidateAP exec |
3568 | { | ||
3553 | //true | 3569 | //true |
3554 | }{ | 3570 | } { |
3555 | gsave | 3571 | gsave |
3556 | //startannottransparency exec | 3572 | //startannottransparency exec |
3557 | dup /Vertices knownoget { | 3573 | dup /Vertices knownoget { |
@@ -3802,7 +3818,8 @@ currentdict /set_bc_color undef | |||
3802 | currentdict end readonly def | 3818 | currentdict end readonly def |
3803 | 3819 | ||
3804 | /Line { | 3820 | /Line { |
3805 | dup /AP oknown { | 3821 | //ValidateAP exec |
3822 | { | ||
3806 | //true | 3823 | //true |
3807 | } { | 3824 | } { |
3808 | gsave | 3825 | gsave |
@@ -3844,9 +3861,10 @@ currentdict /set_bc_color undef | |||
3844 | } bind executeonly def | 3861 | } bind executeonly def |
3845 | 3862 | ||
3846 | /PolyLine { | 3863 | /PolyLine { |
3847 | dup /AP oknown { | 3864 | //ValidateAP exec |
3865 | { | ||
3848 | //true | 3866 | //true |
3849 | }{ | 3867 | } { |
3850 | gsave | 3868 | gsave |
3851 | //startannottransparency exec | 3869 | //startannottransparency exec |
3852 | dup /Vertices knownoget { | 3870 | dup /Vertices knownoget { |
@@ -3916,7 +3934,8 @@ currentdict /set_bc_color undef | |||
3916 | 3934 | ||
3917 | /Ink { % <annot> -> <annot> <true> | 3935 | /Ink { % <annot> -> <annot> <true> |
3918 | % <annot> -> <false> | 3936 | % <annot> -> <false> |
3919 | dup /AP oknown { | 3937 | //ValidateAP exec |
3938 | { | ||
3920 | //true | 3939 | //true |
3921 | } { | 3940 | } { |
3922 | //startannottransparency exec | 3941 | //startannottransparency exec |
@@ -3967,7 +3986,8 @@ currentdict /set_bc_color undef | |||
3967 | } bind executeonly def | 3986 | } bind executeonly def |
3968 | 3987 | ||
3969 | /Underline { | 3988 | /Underline { |
3970 | dup /AP oknown { | 3989 | //ValidateAP exec |
3990 | { | ||
3971 | //true | 3991 | //true |
3972 | } { | 3992 | } { |
3973 | 0 setlinecap | 3993 | 0 setlinecap |
@@ -4006,7 +4026,8 @@ currentdict /set_bc_color undef | |||
4006 | } bind executeonly def | 4026 | } bind executeonly def |
4007 | 4027 | ||
4008 | /StrikeOut { | 4028 | /StrikeOut { |
4009 | dup /AP oknown { | 4029 | //ValidateAP exec |
4030 | { | ||
4010 | //true | 4031 | //true |
4011 | } { | 4032 | } { |
4012 | 0 setlinecap | 4033 | 0 setlinecap |
@@ -4067,12 +4088,10 @@ currentdict /set_bc_color undef | |||
4067 | /emptydict 0 dict readonly def | 4088 | /emptydict 0 dict readonly def |
4068 | 4089 | ||
4069 | /Highlight { | 4090 | /Highlight { |
4070 | % technically we should apply an appearance stream if we have one, but if we do | 4091 | //ValidateAP exec |
4071 | % some test files don't match Acrobat. PDF 2.0 says appearance streams are mandatory, | 4092 | { |
4072 | % and take precedence over generatig new ones, so we may need to revisit this. | 4093 | //true |
4073 | % dup /AP oknown { | 4094 | } { |
4074 | % //true | ||
4075 | % }{ | ||
4076 | 0 setlinecap | 4095 | 0 setlinecap |
4077 | dup annotsetcolor { | 4096 | dup annotsetcolor { |
4078 | /QuadPoints knownoget { | 4097 | /QuadPoints knownoget { |
@@ -4096,13 +4115,14 @@ currentdict /set_bc_color undef | |||
4096 | } if | 4115 | } if |
4097 | } if | 4116 | } if |
4098 | //false | 4117 | //false |
4099 | % } ifelse | 4118 | } ifelse |
4100 | } bind executeonly def | 4119 | } bind executeonly def |
4101 | currentdict /emptydict undef | 4120 | currentdict /emptydict undef |
4102 | currentdict /highlight-arc undef | 4121 | currentdict /highlight-arc undef |
4103 | 4122 | ||
4104 | /Squiggly { | 4123 | /Squiggly { |
4105 | dup /AP oknown { | 4124 | //ValidateAP exec |
4125 | { | ||
4106 | //true | 4126 | //true |
4107 | } { | 4127 | } { |
4108 | //startannottransparency exec | 4128 | //startannottransparency exec |
@@ -4160,7 +4180,8 @@ currentdict /set_bc_color undef | |||
4160 | } bind executeonly def | 4180 | } bind executeonly def |
4161 | 4181 | ||
4162 | /Text { | 4182 | /Text { |
4163 | dup /AP oknown { | 4183 | //ValidateAP exec |
4184 | { | ||
4164 | //true | 4185 | //true |
4165 | } { | 4186 | } { |
4166 | //startannottransparency exec | 4187 | //startannottransparency exec |
@@ -4202,16 +4223,10 @@ currentdict /set_bc_color undef | |||
4202 | } bind executeonly def | 4223 | } bind executeonly def |
4203 | 4224 | ||
4204 | /FreeText { | 4225 | /FreeText { |
4205 | dup /AP knownoget { | 4226 | //ValidateAP exec |
4206 | %% Check minimal entriy in /AP dictionary | 4227 | { |
4207 | /N known not { | 4228 | //true |
4208 | //true | 4229 | } |
4209 | }{ | ||
4210 | //false | ||
4211 | }ifelse | ||
4212 | } { | ||
4213 | //true | ||
4214 | }ifelse | ||
4215 | %% We either have no appearance, or its invalid, make one up. | 4230 | %% We either have no appearance, or its invalid, make one up. |
4216 | { | 4231 | { |
4217 | gsave | 4232 | gsave |
@@ -4382,9 +4397,6 @@ currentdict /set_bc_color undef | |||
4382 | //endannottransparency exec | 4397 | //endannottransparency exec |
4383 | //false | 4398 | //false |
4384 | grestore | 4399 | grestore |
4385 | } | ||
4386 | { | ||
4387 | //true | ||
4388 | } ifelse | 4400 | } ifelse |
4389 | } bind executeonly def | 4401 | } bind executeonly def |
4390 | 4402 | ||
@@ -4499,7 +4511,8 @@ currentdict /set_bc_color undef | |||
4499 | {/text/frame/red/green/blue} {currentdict exch undef} forall | 4511 | {/text/frame/red/green/blue} {currentdict exch undef} forall |
4500 | 4512 | ||
4501 | /Stamp { | 4513 | /Stamp { |
4502 | dup /AP oknown { | 4514 | //ValidateAP exec |
4515 | { | ||
4503 | //true | 4516 | //true |
4504 | } { | 4517 | } { |
4505 | //startannottransparency exec | 4518 | //startannottransparency exec |
@@ -4533,9 +4546,10 @@ currentdict /set_bc_color undef | |||
4533 | /Popup { | 4546 | /Popup { |
4534 | dup /Open oknown { | 4547 | dup /Open oknown { |
4535 | dup /Open get { | 4548 | dup /Open get { |
4536 | dup /AP oknown { | 4549 | //ValidateAP exec |
4550 | { | ||
4537 | //true | 4551 | //true |
4538 | }{ | 4552 | } { |
4539 | gsave | 4553 | gsave |
4540 | //startannottransparency exec | 4554 | //startannottransparency exec |
4541 | newpath | 4555 | newpath |
@@ -4624,7 +4638,8 @@ currentdict /set_bc_color undef | |||
4624 | %% until the content is removed, before that the content should be present and | 4638 | %% until the content is removed, before that the content should be present and |
4625 | %% I beleive we should print it. So take no action for Redact annotations if they | 4639 | %% I beleive we should print it. So take no action for Redact annotations if they |
4626 | %% have no appearance. | 4640 | %% have no appearance. |
4627 | dup /AP oknown { | 4641 | //ValidateAP exec |
4642 | { | ||
4628 | //true | 4643 | //true |
4629 | } { | 4644 | } { |
4630 | //false | 4645 | //false |
@@ -4633,6 +4648,7 @@ currentdict /set_bc_color undef | |||
4633 | 4648 | ||
4634 | currentdict /startannottransparency undef | 4649 | currentdict /startannottransparency undef |
4635 | currentdict /endannottransparency undef | 4650 | currentdict /endannottransparency undef |
4651 | currentdict /ValidateAP undef | ||
4636 | currentdict /quadpoints2basis undef | 4652 | currentdict /quadpoints2basis undef |
4637 | currentdict /drawellipse undef | 4653 | currentdict /drawellipse undef |
4638 | currentdict end readonly def | 4654 | currentdict end readonly def |