>mutool.exe draw -F stext document.pdf 2>nul ... #### >gswin64c -q -sDEVICE=txtwrite -dTextFormat=1 -o - document.pdf ... #### use strict; use warnings; use CAM::PDF; my $d = CAM::PDF-> new( 'document.pdf' ); my $t = $d-> getPageContentTree( 1 ); $t-> render( 'CAM::PDF::Renderer::Dump' ); __END__ ( 50.17, 549.24) ( 50.17, 549.24) 2/27/2020 ( 93.23, 549.24) ( 93.23, 549.24) 3:07 ( 113.51, 549.24) ( 113.51, 549.24) AM ( 677.77, 549.24) ( 677.77, 549.24) Quotations ( 724.17, 549.24) ( 724.17, 549.24) Due ( 743.33, 549.24) ( 743.33, 549.24) By: ( 760.28, 549.24) ( 760.28, 549.24) 01/22/2020 ( 288.40, 533.24) ( 288.40, 533.24) ABSTRA ( 344.41, 533.24) ( 344.41, 533.24) CT ( 367.36, 533.24) ( 367.36, 533.24) OF ( 390.30, 533.24) ( 390.30, 533.24) UNSTRAPPED ( 487.91, 533.24) ( 487.91, 533.24) (A .... #### package MyTestRenderer; use strict; use warnings; use base 'CAM::PDF::GS'; sub new { my ( $class, @args ) = @_; my $self = $class-> SUPER::new( @args ); $self-> { mode } = 'c'; # split into characters return $self } sub renderText { my ( $self, $string, $width ) = @_; my $fontsize = $self-> { Tfs }; my ( $xu, $yu ) = $self-> textToUser( 0, 0 ); my ( $xd, $yd ) = $self-> userToDevice( $xu, $yu ); printf "(x = %5.1f, y = %5.1f) (w = %.3f, h = %3.1f) %s\n", $xd, $yd, $width, $fontsize, $string; return; } 1; #### use strict; use warnings; use CAM::PDF; use lib '.'; my $d = CAM::PDF-> new( 'document.pdf' ); my $t = $d-> getPageContentTree( 1 ); $t-> render( 'MyTestRenderer' ); __END__ (x = 50.2, y = 549.2) (w = 0.500, h = 10.0) 2 (x = 55.2, y = 549.2) (w = 0.278, h = 10.0) / (x = 58.0, y = 549.2) (w = 0.500, h = 10.0) 2 (x = 63.0, y = 549.2) (w = 0.500, h = 10.0) 7 (x = 68.0, y = 549.2) (w = 0.278, h = 10.0) / (x = 70.7, y = 549.2) (w = 0.500, h = 10.0) 2 (x = 75.7, y = 549.2) (w = 0.500, h = 10.0) 0 (x = 80.7, y = 549.2) (w = 0.500, h = 10.0) 2 (x = 85.7, y = 549.2) (w = 0.500, h = 10.0) 0 (x = 93.2, y = 549.2) (w = 0.500, h = 10.0) 3 (x = 98.2, y = 549.2) (w = 0.278, h = 10.0) : (x = 101.0, y = 549.2) (w = 0.500, h = 10.0) 0 (x = 106.0, y = 549.2) (w = 0.500, h = 10.0) 7 (x = 113.5, y = 549.2) (w = 0.722, h = 10.0) A (x = 120.7, y = 549.2) (w = 0.889, h = 10.0) M (x = 677.8, y = 549.2) (w = 0.722, h = 10.0) Q (x = 685.0, y = 549.2) (w = 0.500, h = 10.0) u (x = 690.0, y = 549.2) (w = 0.500, h = 10.0) o (x = 695.0, y = 549.2) (w = 0.278, h = 10.0) t ....