Is it possible to embed a FormCalc script (like we do with javascript ) ? (well, I believe that it's like javascript...) Thanks in advance luigi PS Why FormCalc ? Because it's seem that Reader for PocketPC 2.0 support it . (cfr https://www.planetpdf.com/forumarchive/126183.asp)
luigi scarso wrote:
Is it possible to embed a FormCalc script (like we do with javascript ) ? (well, I believe that it's like javascript...)
Thanks in advance luigi
PS Why FormCalc ? Because it's seem that Reader for PocketPC 2.0 support it . (cfr https://www.planetpdf.com/forumarchive/126183.asp)
is there a spec then on how to embed that in a pdf doc? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
I have downloaded http://partners.adobe.com/public/developer/en/xml/formcalc_2.0.pdf If I have understand it FormCalc seem to be a simple script language Seem that Acrobat 7.0 can do this, but I'm not sure; asap I try to make an example. Thanks luigi
luigi scarso wrote:
I have downloaded http://partners.adobe.com/public/developer/en/xml/formcalc_2.0.pdf If I have understand it FormCalc seem to be a simple script language Seem that Acrobat 7.0 can do this, but I'm not sure; asap I try to make an example.
i played with xfa stuff some time ago; it boils down to sending an xml file to acrobat with a ref to a pdf file and additional form data; so maybe the form calc code stays outside the pdf file in a parallel file Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 4/10/06, Hans Hagen
luigi scarso wrote:
I have downloaded http://partners.adobe.com/public/developer/en/xml/formcalc_2.0.pdf If I have understand it FormCalc seem to be a simple script language Seem that Acrobat 7.0 can do this, but I'm not sure; asap I try to make an example.
i played with xfa stuff some time ago; it boils down to sending an xml file to acrobat with a ref to a pdf file and additional form data; so maybe the form calc code stays outside the pdf file in a parallel file
I have put a simple example under http://www.logosrl.it/context/test/tex.pdf It was done with Designer; it is var Quantity=100 (I wasn't able to make uncompress vers. for pdf 1.6, so I downgraded to 1.5) It seem that xml data are embedded into pdf.
luigi scarso wrote:
On 4/10/06, Hans Hagen
wrote: luigi scarso wrote:
I have downloaded http://partners.adobe.com/public/developer/en/xml/formcalc_2.0.pdf If I have understand it FormCalc seem to be a simple script language Seem that Acrobat 7.0 can do this, but I'm not sure; asap I try to make an example.
i played with xfa stuff some time ago; it boils down to sending an xml file to acrobat with a ref to a pdf file and additional form data; so maybe the form calc code stays outside the pdf file in a parallel file
I have put a simple example under http://www.logosrl.it/context/test/tex.pdf It was done with Designer; it is var Quantity=100 (I wasn't able to make uncompress vers. for pdf 1.6, so I downgraded to 1.5) It seem that xml data are embedded into pdf.
as far as i can see it boils down to embedding a bunch of xml snippets (none of which is valid xml in itself) and add an /XFA entry to the Acroform dictionary in the Catalog; no big deal; the plugin reassembles the embedded files to something valid xml and then does something with it, probably depending on the javascript;
(looks like a real mess of mixing javascript and another language; i wonder why they didn't use javascript for everything; maybe the xml hype stroke 'm)
So, here's something rather preliminary to play with ... (use / in filenames)
\unprotect
\def\startembed
{\bgroup
\catcode`\%=\other
\dodoubleargument\dostartembed}
\long\def\dostartembed[#1][#2]#3% let's gobble the next space, else
{\dodostartembed[#1][#2]#3} % we get a space before <?xml
\long\def\dodostartembed[#1][#2]#3\stopembed
{\immediate\pdfobj stream attr {/Type /EmbeddedFile} {#3}%
\edef\temp{\executeifdefined{embedded:#1}{ }}%
\setxvalue{embedded:#1}{\temp (#2) \the\pdflastobj\space0 R }%
\egroup}
\def\embeddednames#1%
{\executeifdefined{embedded:#1}{}}
\def\flushFDFnames
{\ifbuildFDFdictionary
\ifx\FDFcollection\empty\else
\ifbuildFDFencodingvector
\doPDFdictionaryobject class FDF name local:encodingvector data
\FDFencodingvector
\fi
\defineFDFfonts
\doPDFarrayobject class FDF name local:fields data \FDFcollection
\doPDFarrayobject class FDF name local:xfa data {\embeddednames{xfa}}%
\doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreferenceA
\doPDFgetobjectreference{FDF}{local:xfa}\PDFobjectreferenceB
% The /NeedAppearances is pretty important because
% otherwise Acrobat 5 blows up on cloned radio widgets
\doPDFdictionaryobject class FDF name local:acroform data
{/Fields \PDFobjectreferenceA\space
/XFA \PDFobjectreferenceB\space
/NeedAppearances true
\doFDFiffieldset\PDFcalculationset{/CO [\doFDFgetfieldset\PDFcalculationset]}
/DR << /Font << \FDFfonts >> >>
/DA (/Helv 10 Tf 0 g)}%
\doPDFgetobjectreference{FDF}{local:acroform}\PDFobjectreference
\doPDFaddtocatalog
{/AcroForm \PDFobjectreference}%
\global\let\FDFcollection\empty
\global\let\flushFDFnames\relax
\fi
\fi}
\protect
\startembed[xfa][preamble]
<?xml version="1.0" encoding="UTF-8"?>
luigi scarso wrote:
hmm, Designer does not show tufte, Acrobat7.0 yes.
quite cryptic, this message -) i assume that you mean that Designer is flawed with respect to pdf viewing ... no surprise ... the one time i played with it, the pdf's etc also looked like crap, so ... don't take that program as a reference Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 4/11/06, Hans Hagen
luigi scarso wrote:
hmm, Designer does not show tufte, Acrobat7.0 yes.
quite cryptic, this message -) Sorry; see http://www.logosrl.it/context/test/s.pdf
If I open s.pdf with Designer only one text field is shown (with label example) and no other text :( by the way, thanks for the examples. luigi
On 4/11/06, Hans Hagen
luigi scarso wrote:
hmm, Designer does not show tufte, Acrobat7.0 yes.
quite cryptic, this message -)
i assume that you mean that Designer is flawed with respect to pdf viewing ... no surprise ... the one time i played with it, the pdf's etc also looked like crap, so ... don't take that program as a reference It seems that Designer open only forms; I will investigate it.
luigi
It seems that Designer open only forms; I will investigate it. I put a test in http://www.logosrl.it/context/test/xfa/s2.pdf
It was made from s2.xdp with Designer; it was uncompressed with pdftk. I try to replicate it with s2-0001.tex, but I have a problem: I don'know how to to group fields Briefly,I have subform modulo1 subform unnamed field Campo1 field Campo2 field Somma Ie modulo1 contains unnamed which in turn contains Campo1,Campo2,Somma . But with context I have made 3 distinct groups field Campo1 field Campo2 field Somma and this is not what I need.
participants (2)
-
Hans Hagen
-
luigi scarso