Using Google’s proxy is a wrong solution for the problem stated in the question. Despite the question body stating ‘Downloading and showing then deleting the pdf is not an option’, this is actually the only remotely sensible option: embed a PDF renderer in your application, then download the PDF into a private application storage and use your built-in renderer to view it. Though remember it is still possible to capture the file in transit by MITM-ing the device, or at rest (when it’s in temporary storage, private or not) with a rooted phone, so preventing the file from being saved on the device (in the public area) amounts to little more than annoying security theatre anyway.
That said, you should really percent-escape the URI.
Since I am too lazy to start up my own web server, I verified this with Pipedream. I signed up for the free plan, opened https://drive.google.com/viewerng/viewer?embedded=true¶m=1&url=https://███████████████.m.pipedream.net/blah%3Ffoobar=barfoo%26quux=12345
(corresponding to https://███████████████.m.pipedream.net/blah?foobar=barfoo&quux=12345
; note the escaped ?
and &
) and this is what I got in the console:

Clearly the query parameters are passed correctly, as long as the drive.google.com endpoint receives them escaped. In your case, the URL should be https://drive.google.com/viewerng/viewer?embedded=true&url=http://{anydomain}/any.php%3Fargs1=1%26args2=2
. If this still doesn’t work in your case even if you correctly perform the appropriate escaping, your problem is something else. Without knowing your configuration in more detail, I will not be able to tell what it is: it may be a matter of appropriate session cookies not being sent, or the server may be banning Google’s IP addresses (after all, the PDF is requested by Google servers).