Re: [NTG-context] Widget and mandatory Rect field?

2011-04-18 Thread Hans Hagen

On 18-4-2011 7:31, Reviczky, Adam wrote:

Hi

I have a PDF with widgets and everything's fine with it, and I'm testing it by 
opening it with Adobe Reader.

Now I had a look again with other viewers and when I open it with evince 
(poppler based), then it gives me some strange errors like this:
Error: Annotation rectangle is wrong type
Though it opens it fine and no problems at all.


there can also be a puzzling

FormFieldButton::setState called on a readOnly field


I googled a bit and found a bug report on this:
https://bugs.freedesktop.org/show_bug.cgi?id=29954

There it is said that its ConTeXt's fault, as It has a Widget annotation without 
the mandatory Rect field.
Is it really so? I couldn't find any threads on this on the list.


\nopdfcompression

\setupinteraction[state=start]

\definefieldbody[email][type=line]

\starttext
\startTEXpage
\fieldbody[email]
\par
\fieldbody[email]
\stopTEXpage
\stoptext

gives

17 0 obj

/Type /Annot
/Q 0 /Subtype /Widget /Parent 16 0 R /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 
0 rg 0 0 0 RG) /MK  /CA ()  /F 4

/Rect [0 14.4275 59.7758 26.3827]

endobj
18 0 obj

/Type /Annot
/Q 0 /Subtype /Widget /Parent 16 0 R /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 
0 rg 0 0 0 RG) /MK  /CA ()  /F 4

/Rect [0 0 59.7758 11.9552]

endobj

which look like Annot's with Rect's to me. There is a parent field

16 0 obj
 /Q 0 /Subtype /Widget /T feff0065006d00610069006c /F 4 /Kids 15 0 R 
/V feff /DV feff /Ff 0 /MaxLen 1024 /FT /Tx /DA (/rmtf 11.9552 Tf 
1.1955 Ts 0 0 0 rg 0 0 0 RG) 

endobj

but it's not an annot (just a container for shared data). (Actually 
children can have different rectangles so it would not make sense to 
share one).



Can someone confirm this, can this be even fixed?


Are you saying that Evince does forms (and Javascript as it's 
associated) or is it checking something that is not interpreted anyway? 
Officially a viewer should ignore annots that it cannot handle.


Anyhow, in context we've always had such widgets implemented using a 
parent / child model and it's the child that matters for rendering (and 
it definitely has a Rect as it's an Annot) while the parent is just a 
dictionary and not an annot (one can argue that the Subtype key is not 
needed there but - at least in the past - it had to be there.)


BTW, I'm currently playing with the luatex epdf interface (under 
construction and being cleaned up for 0.70) and I noticed the same 
message. Interesting is that there are such widget tests in popler but 
at the same time more important tests (arrays getting out of bounds 
leading to crashes) are not there. But Hartmut is working on getting 
that all fixed in the luatex variant (interface) eventually. The 
mentioned message probably have to be intercepted as well and be fed 
into the regular message system.


So, unless I'm sure what (and if something) is wrong I'll do nothing. 
(Acrobat preflights the document all right and some widgets types are 
too instable to mess with too much anyway.)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Widget and mandatory Rect field?

2011-04-18 Thread Reviczky, Adam
 17 0 obj
 
 /Type /Annot
 /Q 0 /Subtype /Widget /Parent 16 0 R /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0
 0 rg 0 0 0 RG) /MK  /CA ()  /F 4
 /Rect [0 14.4275 59.7758 26.3827]
  
 endobj
 18 0 obj
 
 /Type /Annot
 /Q 0 /Subtype /Widget /Parent 16 0 R /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0
 0 rg 0 0 0 RG) /MK  /CA ()  /F 4
 /Rect [0 0 59.7758 11.9552]
  
 endobj
 
 which look like Annot's with Rect's to me. There is a parent field
I was puzzled by this too, but apparently its the parent where the error 
message is thrown out (rightly or falsely).

 Are you saying that Evince does forms (and Javascript as it's
 associated) or is it checking something that is not interpreted anyway?
 Officially a viewer should ignore annots that it cannot handle.
Evince does forms by now, at least to some extent, without JavaScript of course.
I've tested this:
http://help.adobe.com/en_US/Acrobat/9.0/Samples/interactiveform_enabled.pdf
which gives me a Unimplemented annotation: POPPLER_ANNOT_LINE, please post a 
bug report in Evince bugzilla (http://bugzilla.gnome.org) with a testcase.
So there must be some checking.

 Anyhow, in context we've always had such widgets implemented using a
 parent / child model and it's the child that matters for rendering (and
 it definitely has a Rect as it's an Annot) while the parent is just a
 dictionary and not an annot (one can argue that the Subtype key is not
 needed there but - at least in the past - it had to be there.)
Sounds fair enough, and I'm not complaining :).

 So, unless I'm sure what (and if something) is wrong I'll do nothing.
 (Acrobat preflights the document all right and some widgets types are
 too instable to mess with too much anyway.)
That's fine, and as long as its working I don't really care.

 Hans
Cheers

Adam
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Widget and mandatory Rect field?

2011-04-17 Thread Reviczky, Adam
Hi

I have a PDF with widgets and everything's fine with it, and I'm testing it by 
opening it with Adobe Reader.

Now I had a look again with other viewers and when I open it with evince 
(poppler based), then it gives me some strange errors like this:
Error: Annotation rectangle is wrong type
Though it opens it fine and no problems at all.

I googled a bit and found a bug report on this:
https://bugs.freedesktop.org/show_bug.cgi?id=29954

There it is said that its ConTeXt's fault, as It has a Widget annotation 
without the mandatory Rect field.
Is it really so? I couldn't find any threads on this on the list.

Can someone confirm this, can this be even fixed?

Adam


PS: As there's an attached PDF on the bug report, but with mkii, I'm attaching 
a minimal mkiv PDF (widget.pdf), if that helps.

made with:
%%%
\setupinteraction[state=start]
\setuppagenumbering[location=]
\starttext
\definefieldbody[email][type=line]
\fieldbody[email]
\stoptext
%%%


widget.pdf
Description: widget.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___