Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How Can I Print Attachments Within a PDF file from Command Line?

New Here ,
Jul 07, 2016 Jul 07, 2016

For my organization, we have a lot of .pdf files, each of which contain multiple .pdf files within them as attachments (i.e. one single .pdf file that contains other .pdf files within it). I know I can print a .pdf file with the following command via command prompt.

"C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe" /n /t "filetoprint.pdf" "\\printerserver\printername"

While this will print the .pdf in question, it does not print any attachments within the file "filetoprint.pdf". I've scoured google and these forums, yet I haven't seem to found a switch or anything that would enable me to do this. Does anyone have any suggestions? It needs to be done by command line. I would appreciate any help! Thanks!

~Justin

TOPICS
Acrobat SDK and JavaScript
2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Jul 11, 2016 Jul 11, 2016

After a lot more research, I found the answer. To start with, rather than using a .bat file, I used the Action wizard to set up a script. I then set the script to process all the files within a given folder. I changed the folder to the one that would contain all the .pdf files (including the attachments) that I wanted to process. I then wrote the following javascript::

var d = this.dataObjects;

var pp = this.getPrintParams();

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

pp.printerName = "\

...
Translate
New Here ,
Jul 11, 2016 Jul 11, 2016

After a lot more research, I found the answer. To start with, rather than using a .bat file, I used the Action wizard to set up a script. I then set the script to process all the files within a given folder. I changed the folder to the one that would contain all the .pdf files (including the attachments) that I wanted to process. I then wrote the following javascript::

var d = this.dataObjects;

var pp = this.getPrintParams();

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

pp.printerName = "\\\\printerserver\\printer";

this.print(pp);

var oDoc;

for (var i = 0; i < d.length; i++)
{

oDoc = this.openDataObject(d.name);

oDoc.print(pp);

}

Yeah, it's not from command line like I originally wanted, but it will still work for what I need to do. It looks like you can trigger an action from a VBA Macro or something, though at this point I think that's more trouble than it is worth. Anyways, hope this helps out anyone else who is having the same problem!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2017 Oct 26, 2017
LATEST

I've created a form users can attach files to. Reviewers would like to print form with all attachments with one click. Will your Action Wizard solution work for just one document at a time? I'm a novice and was not clear on what to do after finding how to access the Action Wizard. Can you explain starting steps in more detail?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines