Exactly, manipulating pdf would be a contorted solution somewhere deep down the call chain, for a challenge that, without knowing the exact details, should be easily and quite naturally solvable in at an application/"driver program" level.
cheers
Jānis