priPrinter: Add a different date to each copy printed - priPrinter

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add a different date to each copy printed Print 3 copies of a page. Each page has a different month

#1 User is offline   Jonathan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 06-April 15

Posted 06 April 2015 - 06:10 PM

Hi,

I would like to be able print multiple copies of the same page and have a different date added to each one:

So, I would print 3 copies of one page (from system dialogue)

Copy #1 adds "Do not use before 11/6/15"
Copy #2 adds "Do not use before 12/6/15"
Copy #3 adds "Do not use before 1/5/16"

Note: the "Do not use before" date is automatically updated based on today's date (i.e. 1, 2, and 3 months from today).

---------------
priPrinter is an amazing product, well done! Thank you!
0

#2 User is offline   Alex 

  • Administrator
  • Group: Administrators
  • Posts: 238
  • Joined: 28-February 10
  • LocationHungary

Posted 07 April 2015 - 12:52 PM

Hello,

Something like that:

function CreateText(doc,page,delta)
{
//Do not use before
  local tt=Time(); 
  tt.month+=delta;
  if(tt.month>12){tt.month-=11;tt.year++;}
  local m=page.CreateMarkup("string");
  m.pos=Point(0.5,0.5);
  m.text="Do not use before "+tt.day+"/"+tt.month+"/"+tt.year+"["+delta+"]";
  m.alpha=0.5;
  m.angle=45;
  m.color=Color(255,0,0);
  local f=m.font;
  f.height=36;
  f.name="Verdana";
  m.font=f;
  m.outline=true;
}


local doc=window.GetDocument();
local page1=doc.GetPage(0);
local page3=doc.DuplicatePage(page1,1);
local page2=doc.DuplicatePage(page1,2);

CreateText(doc,page1,1);
CreateText(doc,page2,2);
CreateText(doc,page3,3);


But this code does not respect different number of days in months.

Thanks,
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users