priPrinter: Resizing the final output - priPrinter

Jump to content

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

Resizing the final output

#1 User is offline   Holger 

  • Newbie
  • Pip
  • Group: Senior Members
  • Posts: 3
  • Joined: 21-June 16

Posted 31 January 2017 - 08:37 AM

We are using priprinter to print big templates.
The windows API doesn't allow to set the canvas bigger than 2^15 = 32768 tenth millimeter. So the limit is at about 3.27 meters.

For bigger prints you have to scale the print to M1:2 and rescale by 200% within of priprinter.

That is possible. But imagine you have a mix of prints (M1:1 and M1:2) which has to be printed in original size together on a plotter.
This does not work.

So with the help of Alex who gave me the initial ideas we wrote the following script.

local lSequenceEnd="@";

local ns=layout.GetNumSheets();
for(local i=0;i<ns;i++)
  local s=layout.GetSheet(i);
  local np=s.GetNumPages()
  for(local j=0;j<np;j++)
    local page=s.GetPage(j);
    local job=page.document;
    local scale=1.0;
    // calculate scale factor
    local name=job.jobname;  //filename

    // search for scaling information
    local lSequence1Anf="@pri:M";
    local lSequence1Len=lSequence1Anf.len();
    local lPos1 = name.find(lSequence1Anf);
      // search for end of sequence
      local lPos2 = name.find(lSequenceEnd, lPos1 + 1);
      local lMassStabString = name.slice( lPos1 + lSequence1Anf.len(), lPos2 ); 

All I have to to is adding to my print jobs the scaling information. I decided to wrapped it with '@' and start with "pri:".
So I add in the name of all my printjobs a '@pri:M1@' or '@pri:M2@'
And depending on the integer value between '@pri:M' and '@' the print job will be scaled.

I know that most users won't have to scale their prints. But starting with scripting is difficult and the more examples you have the easier it is to understand.
So I decided to publish it here. I hope it will help.

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