Document security trimming functionality