From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22310 Path: news.gmane.org!not-for-mail From: "luigi.scarso" Newsgroups: gmane.comp.tex.context Subject: Filling forms Date: Tue, 06 Sep 2005 15:18:10 +0200 Message-ID: <431D9712.5060107@logosrl.it> References: <431D92C0.3020706@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1126013215 4939 80.91.229.2 (6 Sep 2005 13:26:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Sep 2005 13:26:55 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 06 15:26:44 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECdOl-0002LJ-A3 for gctc-ntg-context-518@m.gmane.org; Tue, 06 Sep 2005 15:22:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E6B44127C9; Tue, 6 Sep 2005 15:22:02 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19019-06; Tue, 6 Sep 2005 15:22:02 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 01E73127C5; Tue, 6 Sep 2005 15:18:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AEE60127C5 for ; Tue, 6 Sep 2005 15:18:26 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18973-09-2 for ; Tue, 6 Sep 2005 15:18:25 +0200 (CEST) Original-Received: from ServerNotes.logosrl.it (81-208-99-91.ip.fastwebnet.it [81.208.99.91]) by ronja.ntg.nl (Postfix) with ESMTP id 810D6127C0 for ; Tue, 6 Sep 2005 15:18:25 +0200 (CEST) Original-Received: from [192.168.2.85] ([192.168.2.85]) by ServerNotes.logosrl.it (Lotus Domino Release 6.5.1) with ESMTP id 2005090615182555-408 ; Tue, 6 Sep 2005 15:18:25 +0200 User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <431D92C0.3020706@gmail.com> X-MIMETrack: Itemize by SMTP Server on ServerNotes/Logo(Release 6.5.1|January 21, 2004) at 06/09/2005 15.18.25, Serialize by Router on ServerNotes/Logo(Release 6.5.1|January 21, 2004) at 06/09/2005 15.18.26, Serialize complete at 06/09/2005 15.18.26 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22310 Archived-At: Hi, I'm working on a project that require filling forms. Every field has (x,y,width,height) dimension and ui=(barcode,texEdit) type (textEdit has some attributes too) I wrote this %-------------- \unprotect \definelayer[BackLayer]% \setupbackgrounds[page][background={BackLayer}] \setuplayout[topspace=0pt,backspace=0pt,margin=0pt,leftmargin=0pt,location=middle, rightmargin=0pt,header=0pt,footer=0pt,top=0pt,bottom=0pt, leftedge=0pt,rightedge=0pt,headerdistance=0pt,footerdistance=0pt, topdistance=0pt,leftmargindistance=0pt,rightmargindistance=0pt, leftedgedistance=0pt,rightedgedistance=0pt,width=fit,height=fit] \def\BarcodeThreeOfNine#1{#1} %% todo.... \def\Field[#1]{% \bgroup \getparameters[!!][#1]%% collect key/val % % %%%% textEdit \doifsamestring{\!!ui}{textEdit}{% text field \setlayer[BackLayer][x=\!!x,y=\!!y ,location=br]{% \expanded{\getparameters[!!textEdit@][\!!textEdit]}% collect textEdit attributes \expanded{\getparameters[!!para@][\!!para]}% collect para attributes \ruledvbox to \!!h{\hsize=\!!w % \vss \doifsamestringelse{\!!textEdit@multiLine}{0}{% single line \doifsamestring{\!!para@hAlign}{}{% \hbox to \!!w {\getvalue\s!dummy \vphantom{K}\getvalue\!!name \hss}% }% \doifsamestring{\!!para@hAlign}{left}{% \hbox to \!!w {\getvalue\s!dummy \vphantom{K} \getvalue\!!name \hss}% }% \doifsamestring{\!!para@hAlign}{right}{% \hbox to \!!w {\hss \getvalue\s!dummy \vphantom{K} \getvalue\!!name}% }% \doifsamestring{\!!para@hAlign}{center}{% \hbox to \!!w {\hss \getvalue\s!dummy \getvalue\!!name \hss}% }% }{% multiline \getvalue\s!dummy \getvalue\!!name% } % \vss }}}% %%%% barcode \doifsamestring{\!!ui}{barcode}{% barcode (todo..) \setlayer[BackLayer][x=\!!x,y=\!!y ,location=br]{% \doifsamestring{\!!type}{39}{% type of barcode \ruledvbox to \!!h{\hsize=\!!w \vss \centerline{\expanded{\BarcodeThreeOfNine{\getvalue{\!!name}}}} \vss} }% }} \egroup } \protect %% %% Macros for filling forms %% \def\FillForm{% %% %% I have really 200 Fields %% \Field[% name={codicearticolo_len6},% ui={textEdit},% textEdit={multiLine={0},},% %x={0.520in},% x={0.520in},% y={0.217in},% w={3.096in},% h={0.882in},% para={vAlign={middle},hAlign={}},%% ] \Field[% ui={barcode},% type={39},% name={barcode_codice___matricola},% x={0.434in},% y={1.259in},% w={4.210in},% h={0.651in},% para={vAlign={middle},hAlign={}},%% ] } \starttext \bgroup %% I have really 200 \setvalue .... \setvalue{codicearticolo_len6}{957803} \setvalue{barcode_codice___matricola}{*9F9578030052201312*} \hskip1sp%% force flush layer ?? \FillForm\page \egroup %% and so on for 1000 /1500 pages... \stoptext %---------------- Problems 1) I have 200 fields for a single page; 2) I have 1000/1500 pages My code it's very slow: does anybody has another approach ? Thanks in advance luigi