Question: I have developed a custom DirectX UI library equipped with everything from buttons to a gridview. 

I need a screen-layout editor of some sort. It just takes too long to do it by hand, whether through a config file or hard-coding. 

I could spend a month or two developing a DirectX editing utility, but I don't have a month or two to spend on this. I could possibly justify a week.

Some requirements:

* I need to be able to create a new screen
* I need to place controls such as buttons, textboxes, and containers/windows/etc throughout the screen
* I need to adjust properties of these controls (Name, Text, Width, Height, Parent Container, etc)

Some of my ideas include:

* Using VB.NET's form editor... setting up forms and translating the form's control information into game screens.
* Setting up a web-based editor (seems like this would take more than week... wouldn't it have to be flash based?)
* Setup a VB.NET win32 editor that allows placement of .NET buttons, containers, etc that correspond to my library's buttons, containers, etc.

Is there a **best way** to handle this? 

Thanks

Answer: 
As part of my open-source [CAM::PDF](http://search.cpan.org/dist/CAM-PDF/) Perl library, I include a tiny front-end program called [changepagestring.pl](http://search.cpan.org/dist/CAM-PDF/bin/changepagestring.pl) which does what you ask.

However, it only replaces text that's contiguous in the PDF syntax. If you switch fonts, size, style, etc. mid-phrase then it won't match. If you do any advanced kerning then it won't match.

Those limitations aside, it's really easy to use and it's simple enough that you can easily fork it and hack it to your needs.
In Perl, you can parse the contents of your PDF using the [PDF::API2](http://search.cpan.org/dist/PDF-API2/lib/PDF/API2.pm) module. You should then be able to search and replace your target strings in the usual way (`s///`), and write the new document back to disk.