ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* acrocrap.pl (wanna bypass a version 5 bug?) + nice demo
@ 2001-05-20 21:04 Hans Hagen
  2001-05-21  6:59 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Hagen @ 2001-05-20 21:04 UTC (permalink / raw)


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

Hello World, 

Acrobat 5 has problems with reading files that use forms with check fields
and use /DV (On) and /DV (Off) default values. 

Context happens to write default values as such, while acrobat 5 is only
happy with /DV /On

BTW, reading the specs and using acro4 to create a test file does not realy
help, since Yes No On and Off may happily be mixed with Foo and Bar (since
these are only placeholders).   

You can clean up files using the following perl script: 

-----------------------------------------------------------------------
$pdffile = $ARGV[0] ; 

exit unless              -e $pdffile       ; 
exit unless open (PDFINP, "<$pdffile")     ; binmode PDFINP ; 
exit unless open (PDFOUT, ">$pdffile.new") ; binmode PDFOUT ; 

$found = 0 ; 

while (<PDFINP>) 
  { if (s"(/Subtype\s*/Widget.*?/FT\s*/Btn.*?/DV\s*)\((.*?)\)"$1/$2 "gmois)
      { $found = 1 }  
    print PDFOUT $_ }   

close (PDFINP) ; 
close (PDFOUT) ; 

unlink "$pdffile.new" unless $found ; 
-----------------------------------------------------------------------

for non context files, you may need to change the regexp.

If you want to patch spec-fdf.tex, here you go: in 

  \doFDFpresetchoicefield 

locate 

  /DV (\FDFDefault)

and change this (2 times) into 

  /DV /\FDFDefault\space

Since this is a runtime loaded driver file, you don';t need to compile a
format, 

[took me a whole sunny sunday afternoon to locate this bug, and i really
don't look forward to cleaning up all my files]

The attached file should work on pdf 5 viewers and demonstrate a new
javascript trick, in order to start the demo, click on the page border. 

Hans

[-- Attachment #2: pdftest.zip --]
[-- Type: application/zip, Size: 6764 bytes --]

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

-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------

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

* Re: acrocrap.pl (wanna bypass a version 5 bug?) + nice demo
  2001-05-20 21:04 acrocrap.pl (wanna bypass a version 5 bug?) + nice demo Hans Hagen
@ 2001-05-21  6:59 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2001-05-21  6:59 UTC (permalink / raw)


Hi, 

>The attached file should work on pdf 5 viewers and demonstrate a new
>javascript trick, in order to start the demo, click on the page border. 

it also works in acro 4, kind of undocumented feature i guess

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2001-05-21  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-20 21:04 acrocrap.pl (wanna bypass a version 5 bug?) + nice demo Hans Hagen
2001-05-21  6:59 ` Hans Hagen

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).