You can do this through javascript. If you pass the querystring in the URL, you can fetch it with javascript and update the embed
element.
How to get querystring. Code from answer, below:
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
So in your Content Editor Web Part, you place the following javascript above/below (whichever) your embed
element.
Example:
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var qsValue = getParameterByName("query string name here");
if (qsValue)
{
var embed = document.getElementById("ExampleEmbed");
embed.src = qsValue;
}
</script>
<object><embed id="ExampleEmbed" src="somfile" height="850" width="850"
type="application/pdf"></embed></object>