priPrinter: Holger - Viewing Profile - priPrinter

Jump to content

Holger's Profile User Rating: -----

Reputation: 0 Neutral
Group:
Senior Members
Active Posts:
3 (0.01 per day)
Most Active In:
Suggestions and Feedback (2 posts)
Joined:
21-June 16
Profile Views:
1648
Last Active:
User is offline Dec 11 2017 02:12 PM
Currently:
Offline

My Information

Member Title:
Newbie
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Not Telling Not Telling

Contact Information

E-mail:
Private

Topics I've Started

  1. Resizing the final output

    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);
    		if(lPos1>=0)
        {  
          // search for end of sequence
          local lPos2 = name.find(lSequenceEnd, lPos1 + 1);
      		if(lPos2>=0)
      		{
          local lMassStabString = name.slice( lPos1 + lSequence1Anf.len(), lPos2 ); 
          scale=lMassStabString.tointeger();
          }
        }
        
        s.SetPageScale(page,scale);
      }
    }



    All I have to do is adding to my print jobs the scaling information. I decided to wrap 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.

Friends

Holger hasn't added any friends yet.

Comments

Holger has no profile comments yet. Why not say hello?