ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Widget and mandatory Rect field?
@ 2011-04-18  5:31 Reviczky, Adam
  2011-04-18  8:35 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Reviczky, Adam @ 2011-04-18  5:31 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

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
%%%

[-- Attachment #2: widget.pdf --]
[-- Type: application/pdf, Size: 3903 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Widget and mandatory Rect field?
  2011-04-18  5:31 Widget and mandatory Rect field? Reviczky, Adam
@ 2011-04-18  8:35 ` Hans Hagen
  2011-04-18  9:02   ` Reviczky, Adam
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-04-18  8:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Reviczky, Adam

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Widget and mandatory Rect field?
  2011-04-18  8:35 ` Hans Hagen
@ 2011-04-18  9:02   ` Reviczky, Adam
  0 siblings, 0 replies; 3+ messages in thread
From: Reviczky, Adam @ 2011-04-18  9:02 UTC (permalink / raw)
  To: Hans Hagen, mailing list for ConTeXt users

> 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-18  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-18  5:31 Widget and mandatory Rect field? Reviczky, Adam
2011-04-18  8:35 ` Hans Hagen
2011-04-18  9:02   ` Reviczky, Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).