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.
Printed Date: 19 Oct 2019 at 8:14am
Software Version: Web Wiz Forums 11.10 -

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?


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)  

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -