Expand my Community achievements bar.

Javscript to "Adobe PDF" print or Flatten

Avatar

Level 5

Is anyone faimliar enough with the javascript to print a document as an "Adobe PDF" document, thus lowering the file size? I would like this action to occur in the postSign event and then attach to the email I that is sent out with this even. The following "flatten" javascript doesn't work even though it is listed in:

http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS_DesignerJS.pdf

on Page 26 as being available in LC.

Is there a javascript to print in "Adobe PDF"? Thank you.

Test File I have been working with.

https://workspaces.acrobat.com/?d=swAsrld7lYv2NIC3011GCQ

7 Replies

Avatar

Level 10

That function was removed, the documentation you're looking at is from Designer 7 which is pretty old now. I think 7 was the last version to have it.

I just happen to know this because I know someone who was trying to make it go again using old libraries but I don't think they managed to get it going.

Avatar

Level 5

Jono was a new Designer document published?

Avatar

Level 5

Sweet Jesus! Goldmine! Google searches don't bring up 9.0 for "Converting acrobat javascript for use in LiveCyle designer forms" Thanks Jono. I'll save these. So you don't know of a way to javascript the "Adobe PDF" print selection in the print dialogue? Even with a trust function?

Avatar

Level 10

I've never done anything with trying to script printing.

I've seen code around for selecting printers and printing to them so if you have Acrobat with the PDF printer installed I think it's probably doable. I think they took out the PDF flattener so people would need to buy the server product.

Avatar

Level 5

Thanks Jono. I'll do more research and see if I can find a way to print to "Adobe PDF" then attach to an email. Thanks again.

Avatar

Level 10

You wouldn't be able to script both. You'd need some other program to pick up the resulting pdf and feed it to an email program.

Another way to shrink file size is to not embed fonts. Stick with common fonts and the ones that come with Acrobat/Reader (includes Minion and Myriad and a few more I think). You can also turn off Accessibility tags.