Print Page | Close Window

Print thru PrintParams

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=1075
Printed Date: 17 Jun 2019 at 7:53pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Print thru PrintParams
Posted By: NetMan
Subject: Print thru PrintParams
Date Posted: 21 Jan 2014 at 11:01am
Hello everybody.
I need to print first page into the file. I have trusted function:

pPrint = app.trustedFunction( function(this,pp)
{
app.beginPriv();
try
{
var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.silent;
pp.firstPage = 0;
pp.lastPage = 0;
pp.fileName = "/c/temp/temp.pdf";
pp.printerName = "Adobe PDF";
this.print(pp);
}
catch(e)
{
        app.alert("Error Trusted Function");
}
app.endPriv();
}
);

and code for the button:

if(typeof(pPrint) == "function")
{
    var pp = this.getPrintParams();
    pp.interactive = pp.constants.interactionLevel.silent;
    pp.firstPage = 0;
    pp.lastPage = 0;
    pp.fileName = "/c/temp/temp.pdf";
    pp.printerName = "Adobe PDF";
    pPrint(pp);
}
else
{
app.alert("Error Button");
}

but it not work with error for buttons code:

SyntaxError: missing formal parameter
28:Folder-Level:App:Config.jsAcrobat EScript Built-in Functions Version 10.0
Acrobat SOAP 10.0

I just start to programming for Acrobat JavaScript not long ago and not  understand why buttons code not work.
Would you be so kind to help me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net