#!/usr/bin/perl use strict; use warnings; use CAM::PDF; use Data::Dumper::Concise; use base qw(CAM::PDF::GS::NoText); my $file = shift @ARGV; my $log = '/root/Desktop/gs.log'; binmode STDOUT, ":encoding(utf8)"; open STDOUT, '>', $log; my $pdf = CAM::PDF->new($file); my $contentTree = $pdf->getPageContentTree(5); my $gs = $contentTree->computeGS; print Dumper($gs): close STDOUT;