My assumption was that originally the OP was using the value of the referrer to switch behavior on the target page. This is not a good way to do this even if the referrer value was reliable since it creates artificial binding between the pages. Now, I assume that the OP is passing an explicit parameter to cause the page to change its behavior which is a much better approach.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com