Print Page | Close Window

Script to Flatten Layers

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2122
Printed Date: 27 Apr 2018 at 1:58am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Script to Flatten Layers
Posted By: warrden
Subject: Script to Flatten Layers
Date Posted: 09 Feb 2017 at 9:08pm
Does anyone know how to flatten layers thru javascript? Or apply the function to a button?

Thanks,
Jason



Replies:
Posted By: warrden
Date Posted: 13 Feb 2017 at 3:14pm
Found it!  Before running the below code you need to create a new preflight profile in adobe.

Tools>Print Production>Preflight>Options>Create New Preflight Profile
(You may have to select the drop down at the top of the Tools Pane to show the Print Production Tab)
Name it Flatten Layers
Under Custom Profiles, expand new profile (Flatten Layers)
Select Fixups
In the all available fixups list, select "Discard hidden layer content and flatten visible layers"
Select blue left facing arrow at bottom of list to move it to your profile
select OK

Add following code to button

var oProfile = Preflight.getProfileByName("Flatten Layers");  
if (oProfile != undefined)  
    this.preflight(oProfile);





Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net