priPrinter: Script to add document - priPrinter

Jump to content

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

Script to add document Trying to add a predefined document

#1 User is offline   Earlysettler 

  • Newbie
  • Pip
  • Group: Senior Members
  • Posts: 3
  • Joined: 13-April 16

  Posted 13 April 2016 - 07:38 AM

Hi

I've come across Priprint when looking at solutions for our company to automatically add T&C's to our invoices. The scripting engine seems like the best "dumb user" solution to automatically add a document and print. I have been toying with the sample scripts trying to add a document but it never seems to work. Has anyone done this before , the file is always going to be in one location on all machines , so when they print the invoice they select to run this script , it adds the document and prints to the default printer ( duplex obviously ).

Any help with this would be greatly appreciated.

Thanks

Kevin
0

#2 User is offline   Alex 

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

Posted 13 April 2016 - 08:27 AM

Hi Kevin,

Do you want to add T&C automatically - based on page content or manually - by pressing specific button?
Last one is very easy. First one - may be possible.

Alex.
0

#3 User is offline   Earlysettler 

  • Newbie
  • Pip
  • Group: Senior Members
  • Posts: 3
  • Joined: 13-April 16

Posted 14 April 2016 - 07:06 AM

Thanks for the quick reply Alex,

They print the invoice > selecting priprinter as the print > priprinter opens , they click on the script which I would sit in the quicklaunch area ( specific button I assume ) > the script adds the document ( document resides for example in c:\preprint\documents\terms.priprint )and prints to the default printer , done. no more interaction fro the user

Trying to keep it simple for the staff. If they want T&C's they click this button , if not just click print.

Kevin.



View PostAlex, on 13 April 2016 - 08:27 AM, said:

Hi Kevin,

Do you want to add T&C automatically - based on page content or manually - by pressing specific button?
Last one is very easy. First one - may be possible.

Alex.

0

#4 User is offline   Alex 

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

Posted 14 April 2016 - 09:06 AM

Sounds very easy, will send you an example soon.
0

#5 User is offline   Alex 

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

Posted 16 April 2016 - 07:12 PM

Here is the script:

line 1 - Merge document with Terms and Conditions.
line 2 - Print to default printer with default parameters
line 3 - Exit

window.Merge("C:/Users/Alexander/Documents/T&C.priPrinter");
layout.Print();
window.Exit();

0

#6 User is offline   Earlysettler 

  • Newbie
  • Pip
  • Group: Senior Members
  • Posts: 3
  • Joined: 13-April 16

Posted 18 April 2016 - 12:10 AM

Thanks for that Alex,

That code worked with a little tweaking. It would print the t&c file by itself fine , but if I printed something first , like the invoice then then ran the script it just closed. I had to modify the layout.Print with some options as detailed below

layout.Print({dialog=false, printnow=true});

It's now doing exactly what I want. Thanks for your help greatly.

View PostAlex, on 16 April 2016 - 07:12 PM, said:

Here is the script:

line 1 - Merge document with Terms and Conditions.
line 2 - Print to default printer with default parameters
line 3 - Exit

window.Merge("C:/Users/Alexander/Documents/T&C.priPrinter");
layout.Print();
window.Exit();


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