ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: acrocrap.pl (wanna bypass a version 5 bug?) + nice demo
Date: Sun, 20 May 2001 23:04:48 +0200	[thread overview]
Message-ID: <3.0.6.32.20010520230448.009898e0@server-1> (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
-------------------------------------------------------------------------

             reply	other threads:[~2001-05-20 21:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-20 21:04 Hans Hagen [this message]
2001-05-21  6:59 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.6.32.20010520230448.009898e0@server-1 \
    --to=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).