#!/usr/bin/perl -T use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use FindBin qw($RealBin); my $safepath; BEGIN { if ($RealBin =~ m!^(/home/...path.../(test|uk)/www)!) { $safepath = "$1/../lib"; } else { die "Insecure access!"; } } use lib "$safepath"; use cPanelUserConfig; use PDF::API2; my $pdf = PDF::API2->open("/home/...path.../test/data/xmas/GiftSubscription.pdf"); my $font = $pdf->font("/home/...path.../test/data/xmas/Merriweather.ttf"); my $page = $pdf->open_page(1); my $text = $page->text; $text->font($font, 36); $text->position(656, 403); $text->text('XXX'); print "Content-type: application/pdf\n\n"; print $pdf->to_string;