Re: [Tip of the Week] Create PDF Mailing Labels

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Tip of the Week] Create PDF Mailing Labels

Andreas Steinmann
How can I automaticly add more pages to the pdf?

This example kan output 30 mailing labels, but if i have 68 in my
found set, it still only outputs one page with the first 30.

The Language guide mentions the [PDF_Doc->AddPage] tag, but I'm not
shure, where to put it.

Andreas

>The tip of the week for July 30, 2004 discusses how to create a set
>of mailing labels using the PDF tags built-in to Lasso Professional
>7.  The article includes a sample sheet of labels and full source
>code.
>
><http://support.blueworld.com/article.lasso?id=7302004687>
>

--
  N A T F I L M    F E S T I V A L
  --------------------------------
  St. Kannikestr. 6
  DK-1169 Copenhagen K     Denmark
  Tel. +45 3312 0005
  Fax  +45 3312 7505
  --------------------------------
  <mailto:[hidden email]>
  <http://www.natfilm.dk>

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [Tip of the Week] Create PDF Mailing Labels

jc-15
I'm using that tip to produce a LOT of labels.

On top of the page I set some vars:

     var: 'label_text' = (array);
     var: 'label_container' = (array);
     var:'tempArray'=(array);
     var: 'label_temp' = string;
     var: 'label_rows' = 7;
     var: 'label_cols' = 3;
     var: 'newPageCheck' = $label_rows * $label_cols;

Then in the Record container I populate the label_temp like this:

         if: (field:'person_lastname') || (field:'person_firstname');
             $label_temp += (field:'person_firstname') '  
' (field:'person_lastname') '\r';
         /if;
         if: (field:'organisation_name');
             $label_temp +=  (field:'organisation_name') '\r';
         /if;
etc
At the end of the Record container I move the var into an array:

     $label_text->(insert: $label_temp);
     var: 'label_temp' = string;


After the Record part comes this:

     iterate:  $label_text, (var: 'temp');
         $tempArray->(insert: $temp);
         if: (Loop_Count % $newPageCheck) == 0;
             $label_container->(insert: $tempArray);
             var: 'tempArray' = (array);
         /if;
     /iterate;
     if: !(($label_text->Size) % $newPageCheck) == 0;

         $label_container->(insert: $tempArray);
     /if;

Then I iterate the label_container
     iterate:  $label_container, (var: 'label_text');

And follows all the fancy stuff that Fletcher found out

And the end of the iteration I have this:

         if: Loop_Count < $label_container->Size;
             $template->AddPage;
         /if;
     /iterate;


It's possible that I forgot some part necessary for understanding my  
solution but I can validate that I have a robust multipage label  
routine based on Fletchers tip.

HDB
JC

2 jun 2005 kl. 09.11 skrev Andreas Steinmann:

> How can I automaticly add more pages to the pdf?
>
> This example kan output 30 mailing labels, but if i have 68 in my  
> found set, it still only outputs one page with the first 30.
>
> The Language guide mentions the [PDF_Doc->AddPage] tag, but I'm not  
> shure, where to put it.
>
> Andreas
>
>
>> The tip of the week for July 30, 2004 discusses how to create a  
>> set of mailing labels using the PDF tags built-in to Lasso  
>> Professional 7.  The article includes a sample sheet of labels and  
>> full source code.
>>
>> <http://support.blueworld.com/article.lasso?id=7302004687>
>>
>>
>
> --
>  N A T F I L M    F E S T I V A L
>  --------------------------------
>  St. Kannikestr. 6
>  DK-1169 Copenhagen K     Denmark
>  Tel. +45 3312 0005
>  Fax  +45 3312 7505
>  --------------------------------
>  <mailto:[hidden email]>
>  <http://www.natfilm.dk>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: [Tip of the Week] Create PDF Mailing Labels

Andreas Steinmann
In reply to this post by Andreas Steinmann
Great. This works fine.

Thanks, JC
Andreas

>I'm using that tip to produce a LOT of labels.
>
>On top of the page I set some vars:
>
>     var: 'label_text' = (array);
>     var: 'label_container' = (array);
>     var:'tempArray'=(array);
>     var: 'label_temp' = string;
>     var: 'label_rows' = 7;
>     var: 'label_cols' = 3;
>     var: 'newPageCheck' = $label_rows * $label_cols;
>
>Then in the Record container I populate the label_temp like this:
>
>         if: (field:'person_lastname') || (field:'person_firstname');
>             $label_temp += (field:'person_firstname') ' '
>(field:'person_lastname') '\r';
>         /if;
>         if: (field:'organisation_name');
>             $label_temp +=  (field:'organisation_name') '\r';
>         /if;
>etc
>At the end of the Record container I move the var into an array:
>
>     $label_text->(insert: $label_temp);
>     var: 'label_temp' = string;
>
>
>After the Record part comes this:
>
>     iterate:  $label_text, (var: 'temp');
>         $tempArray->(insert: $temp);
>         if: (Loop_Count % $newPageCheck) == 0;
>             $label_container->(insert: $tempArray);
>             var: 'tempArray' = (array);
>         /if;
>     /iterate;
>     if: !(($label_text->Size) % $newPageCheck) == 0;
>
>         $label_container->(insert: $tempArray);
>     /if;
>
>Then I iterate the label_container
>     iterate:  $label_container, (var: 'label_text');
>
>And follows all the fancy stuff that Fletcher found out
>
>And the end of the iteration I have this:
>
>         if: Loop_Count < $label_container->Size;
>             $template->AddPage;
>         /if;
>     /iterate;
>
>
>It's possible that I forgot some part necessary for understanding my
>solution but I can validate that I have a robust multipage label
>routine based on Fletchers tip.
>
>HDB
>JC
>
>2 jun 2005 kl. 09.11 skrev Andreas Steinmann:
>
>>How can I automaticly add more pages to the pdf?
>>
>>This example kan output 30 mailing labels, but if i have 68 in my
>>found set, it still only outputs one page with the first 30.
>>
>>The Language guide mentions the [PDF_Doc->AddPage] tag, but I'm not
>>shure, where to put it.
>>
>>Andreas
>>
>>>The tip of the week for July 30, 2004 discusses how to create a
>>>set of mailing labels using the PDF tags built-in to Lasso
>>>Professional 7.  The article includes a sample sheet of labels and
>>>full source code.
>>>
>>><http://support.blueworld.com/article.lasso?id=7302004687>
>>>
>>
>>--
>>  N A T F I L M    F E S T I V A L
>>  --------------------------------
>>  St. Kannikestr. 6
>>  DK-1169 Copenhagen K     Denmark
>>  Tel. +45 3312 0005
>>  Fax  +45 3312 7505
>>  --------------------------------
>>  <mailto:[hidden email]>
>>  <http://www.natfilm.dk>
>>
>>--
>>------------------------------
>>Lasso Support: http://support.omnipilot.com/
>>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>>Manage your list subscription:
>>http://www.listsearch.com/lassotalk.lasso?manage
>>
>
>
>--
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:
>http://www.listsearch.com/lassotalk.lasso?manage


--
  N A T F I L M    F E S T I V A L
  --------------------------------
  St. Kannikestr. 6
  DK-1169 Copenhagen K     Denmark
  Tel. +45 3312 0005
  Fax  +45 3312 7505
  --------------------------------
  <mailto:[hidden email]>
  <http://www.natfilm.dk>

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage