Skip to main content
Inspiring
June 8, 2017
Question

How do you get Acrobat pragmatically printing tiled (poster) settings

  • June 8, 2017
  • 4 replies
  • 2609 views

I

How do you get Acrobat pragmatically printing tiled (poster) settings? I know what the support (reference document for Javascript states). Use TileAll.... that did not work at all. I have large images that I need to add a couple barcodes to the top and then print without changing the size of the image. So they need to print out at 100%. I can do it manually but I need to automate this process ASAP. Can someone help me? Right now I have a C# app that sends the document through OLE to open, now I just need to modify and PRINT tiled. Of course, this process needs to be duplicatable. I wanted to do this all in OLE but I do not see where I can modify the printer settings.... therefore I was thinking OLE to Javascript. I could do OLE to plugins also but I can not get my new plugin (sample for SDK) to even show up.

I am using Acrobat Pro DC.

Thanks

Kory

How do you get Acrobat pragmatically printing tiled (poster) settings

This topic has been closed for replies.

4 replies

Legend
June 8, 2017

> I did not see it in the help => plugins.

Common assumption. A plug-in appears there if it has code to put itself there. It isn't done by Acrobat, and the plug-in might or might not do that. Read the code.

> I should be able to access it through C#

You can run a named menu item, by its internal code, with no parameters or user interface. Don't assume you can easily do anything else.

koryd3149Author
Inspiring
June 8, 2017

Thanks, I will see if I have more questions come up as I go back to the drawing board....

Legend
June 8, 2017

How do you KNOW that snippet runner didn't load? What exactly did you look for to see whether it loaded? Don't assume ANYTHING.

koryd3149Author
Inspiring
June 8, 2017

ok I did not see it in the help => plugins. OK, so I put the plugin in the plugin directory and then I should be able to access it through C# I hope.... I will see if I can find some code on that through the SDK. Any hints on where to start would be greatly appreciated. It has taken me too long to get to this point. Part of that is I did not post here.... Plus most of the time I try to get all the information myself.

Thanks

Kory

lrosenth
Adobe Employee
Adobe Employee
June 8, 2017

Have you tried writing the JavaScript and then calling that? That’s certainly easiest.

koryd3149Author
Inspiring
June 8, 2017

This is what I wrote through the samples... I want to be able to call this from C#. I am VERY VERY new at acrobat objects and trying to code them in javascript. Does the js file get reloaded everytime I close and open acrobat?

function TilePrint(theDoc)

{

  pp = this.getPrintParams();

  //pp.pageHandling = pp.constants.handling.nUp;

  pp.pageHandling = pp.constants.handling.tileAll;

  pp.interactive = pp.constants.interactionLevel.silent;

  pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal;

  pp.nUpNumPagesH = 2;

  pp.nUpNumPagesV = 2;

  pp.nUpPageBorder=true;

  this.print(pp);

}

lrosenth
Adobe Employee
Adobe Employee
June 8, 2017

Is there any way around this? I am trying to write this to save the users time.... That is probably why I am getting false when I try to run it in C# call acroapp.MenuItemExecute("TilePrint"); ....

Please let me know.
BTW thanks for the quick responses.

Kory

Here is my Javascript in entirety... so far a lot more to do just trying to get through this first

/*********************************************************************

CREATE THE INFORMATION TO PRINT

---------------------------------------------------------------------

TilePrint.js

- Folder level Javascript code created by Adobe Acrobat SDK.

*********************************************************************/

/*

  * The sample will add "UEI Modify and Print" under Acrobat File menu.

  * Click it to print the front document to the default printer without user interface.

  * It works for Reader, too.

  *

  * See Acrobat JavaScript reference and guide SDK documents for further information.

  */

if ( typeof sdkMenuItem == "undefined")

  var sdkMenuItem = false;

if (!sdkMenuItem) {

  sdkMenuItem = true;

  app.addSubMenu( {

  cName:"ACROSDK:JSSubMenu",

  cUser: "Acrobat SDK JavaScript",

  cParent: "Edit",

  nPos: 0

  });

}

/*

* Add a menu item

* you can execute this menu item from other programs such as IAC VB / VC code.

*/

app.addMenuItem( {

  cName: "ACROSDK:TilePrint",

  cUser: "TilePrint",

  cParent: "ACROSDK:JSSubMenu",

   cEnable: "event.rc = (event.target != null);",

   cExec: "TilePrint(event.target)"

});

/**

* trustedPrint function: Exercise the print function in the privileged context

*

* @param doc The Doc object of the target document

* @param pparam The PrintParams object containing print settings

*/

trustedPrint = app.trustedFunction(

  function(doc, pparams) {

  app.beginPriv();

  doc.print(pparams);

  app.endPriv();

  }

);

/**

* Main function: Print silently

*

* @param theDoc The event target of executing the menu item of this sample.

*/

function TilePrint(theDoc)

{

  pp = this.getPrintParams();

  //pp.pageHandling = pp.constants.handling.nUp;

  pp.pageHandling = pp.constants.handling.tileAll;

  pp.interactive = pp.constants.interactionLevel.silent;

  pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal;

  pp.nUpNumPagesH = 2;

  pp.nUpNumPagesV = 2;

  pp.nUpPageBorder=true;

  this.print(pp);

}


You can write a custom plugin, that still allows silent print because it requires a user to manually install it.

Otherwise, no. The whole point of security is to not be worked around.

Legend
June 8, 2017

If a sample plugin doesn't show up it may be that it isn't supposed to. A plugin only adds to menus or About if it contains code to do so.

koryd3149Author
Inspiring
June 8, 2017

I can not seem to get the sample plugin to show up in loaded plugins so I am not sure what I am doing wrong there....

Thanks

Kory