简体   繁体   中英

How do I change the Javascript injected into PDFs by IBM Maximo's “Direct Print” feature?

Background

When a user in IBM Maximo utilizes the Direct Print or Direct Print with Attachments feature for a report, Maximo creates a PDF with the output of the report and with injected JavaScript to make the reader send it to the user's default printer. However, the reader is popping up a dialog, asking the user if they want to allow the document to print itself, and the users are annoyed because they already said they wanted this thing printed.

So far, the best solution I have found for this problem is on an acrobatusers forum. It says to put the code below into a "folder-level script", meaning in a folder such as C:\\Program Files (x86)\\Adobe\\Reader 10.0\\Reader\\Javascripts , called sPrint.js .

sPrint = app.trustedFunction(
    function(){
        app.beginPriv();
        this.print({bUI:false, bSilent:true, bShrinkToFit:false});
        app.endPriv();
    }
)

Then, and this is where the rub comes in, I have to change the JavaScript that gets injected to call this new sPrint() instead of just print() like it does now.

Question

Where can I change the JavaScript that Maximo injects into Direct Print PDFs? Is it stored in a .js file somewhere and the Java just copies it in? What file? Or is it hard-coded in the Java? Which class?

Thanks!

如果您使用的是Adobe 8.1.2,则可以将Adobe Reader客户端升级到9.4或9.5,这将解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM