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 9, 2017

Ok, I have gotten a start and already have run into something that I need assistance.

How do I set up the code to tile??

/*-------------------------------------------------------

  Replaced method callback implementation

-------------------------------------------------------*/

ACCB1 void ACCB2 UEIAVDocDoPrint (AVDoc doc)

{

  // TODO: Implement your replacement function

  PDDoc d = (PDDoc)doc;

  if (d == NULL){

  return;

  }

  AVDocPrintParamsRec r;

  memset(&r, 0, sizeof(AVDocPrintParamsRec));

  r.size = sizeof(AVDocPrintParamsRec);

  r.pageSpec = PDAllPages;

  // if true, displays dialog boxes; otherwise does not display dialog boxes.

  r.emitToPrinter = true;  //  only emitToPrinter or emitToFile must be true

  r.emitToFile = false;

  r.interactive = false; // sets no user interaction

  r.cancelDialog = true;

  r.emitFontOption = kAVEmitFontAllFonts;

  r.ranges = NULL;

  r.numRanges = 0;

  r.printAsImage = false;

  r.reverse = false;

  AVDocPrintTileDataRec tdr;

  memset(&tdr, 0, sizeof(AVDocPrintTileDataRec));

  tdr.scale = 1;

  r.transparencyLevel = 3; //The transparency level range from 1 to 5

  ASInt32 error = 0;

  DURING

  AVDocPrintPagesWithParams((AVDoc)doc, &r);

  HANDLER

  error = ERRORCODE;

  ASRaise(error);

  END_HANDLER

}

I think I need to do something with tiledata but that does not seem like enough....

Some assistance, please.

Thanks

Kory

Legend
June 10, 2017

Looking over your code I see multiple problems - the usual errors when starting out with plugins - in your use of AVDocPrintTileDataRec

Almost all the plugin structures require you to zero the area and set a length. You do not set a length.

You set an ASFixed value to the integer 1.  ASFixed must not be treated as integer, it's a special opaque type and you must convert to/from C types.

As far as I can see you create the structure but do not pass its address, directly or indirectly, to any API.

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

It’s better to just pass that as part of an “execute this javascript” call. There are samples in the SDK.

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